[HN Gopher] Tell HN: Unable to login to HN from Firefox, a Lovec...
       ___________________________________________________________________
        
       Tell HN: Unable to login to HN from Firefox, a Lovecraftian tale
        
       Author : soapdog
       Score  : 112 points
       Date   : 2022-02-01 17:59 UTC (5 hours ago)
        
 (HTM) web link (andregarzia.com)
 (TXT) w3m dump (andregarzia.com)
        
       | rPlayer6554 wrote:
       | OT but what theme is that?
        
         | soapdog wrote:
         | It is called Graffiti - Balanced.
        
       | csnover wrote:
       | When Mozilla started making big changes to tracking protection,
       | somewhere around versions 86-90, I started noticing all sorts of
       | broken credential management stuff, and I wonder if this is just
       | another manifestation of that.
       | 
       | With strict ETP turned on, extensions like Cookie AutoDelete
       | stopped working due to some new access restriction[0], and
       | cookies that had been set while strict ETP was turned on--even
       | when it was turned off again--became zombies that could only be
       | deleted through about:preferences.
       | 
       | I've had to manually set `privacy.purge_trackers.enabled` to
       | `false` to get it to stop automatically erasing (first-party!)
       | login cookies several times per week. I do not understand what
       | kind of heuristic is being used to decide something is a tracker,
       | but it seems to be not good at it.
       | 
       | For a while, Firefox would also randomly prompt me for a master
       | password after running for about 24 hours. This seemed to stop
       | when I turned off strict ETP, but other people reporting the same
       | problem said they didn't even have strict ETP turned on to begin
       | with, so who knows? It's all just so random.
       | 
       | I still have situations today where I navigate (via the address
       | bar or the browser history) to HN, or GitHub, or some other site
       | where I have a valid login cookie, and Firefox just decides that
       | it's not going to send the cookie this time. If I reload the
       | page, it decides now it will send the cookie. If I perform the
       | exact same navigation that broke a moment ago, now it works fine.
       | 
       | I have no idea what changed, and everything that happens--just
       | like the OP's problem--is so weird and vague that I cannot even
       | submit a decent bug report. At least this bug is consistent; most
       | of my problems seem to be data races. I hope they are able to
       | figure out what is going wrong and, ideally, that it leads to
       | some fixes for whatever broken logic is causing so much trouble
       | with credential management in general.
       | 
       | [0] https://github.com/Cookie-AutoDelete/Cookie-
       | AutoDelete/issue...
        
       | nneonneo wrote:
       | Debugging stuff like this is a real nightmare sometimes, but hey,
       | maybe you'll learn something cool in the process!
       | 
       | One thing I'd try would be to make a new profile - you can launch
       | Firefox with the -P option to bring up the profile manager. I
       | know it doesn't work with either of your existing Stable or
       | Nightly profiles, but maybe a clean profile will do the trick?
        
       | jicea wrote:
       | Could you attach a proxy (mitmproxy [1] for instance) and check
       | the differences between HN requests with/without Private Mode ?
       | 
       | [1] https://mitmproxy.org/
        
       | zelos wrote:
       | > Like Ged in Earthsea, this is my own personal devil. I need to
       | get rid of it
       | 
       | The book ends with Ged accepting that the devil/shadow is part of
       | him, I'm hoping this story has a happier ending!
        
         | soapdog wrote:
         | Yes, but it was the only story I remembered on the spot that
         | had a very personal devil that challenged only the main
         | character :-)
         | 
         | I too am hoping this has a happier ending. All wisdom here
         | points towards making a new profile, which is something I'm
         | avoiding, but if there is no other choice I might try it later.
        
       | gjsman-1000 wrote:
       | It's not like HN is a JavaScript-heavy application with lots of
       | polyfills either! If you can't log in to HN, how do you log in
       | anywhere?
        
         | soapdog wrote:
         | I can login to other sites without any hiccup. Also, I can log
         | in to HN from other browsers. I have no idea what is going on.
         | :-(
        
           | runnerup wrote:
           | Can you try Lynx/Brave/Waterfox as well? I'd personally be
           | curious to diff the HN cookie stored in each browser and see
           | if there's a difference unique to FF.
           | 
           | I'd also be curious to diff the HTTP requests sent from each
           | browser, particularly FF vs FF forks.
        
       | kayodelycaon wrote:
       | Posting from a newly installed Firefox 96.0.3 on macOS 11.6.
       | (I've never had Firefox on this OS image before.)
       | 
       | So I'd guess this is a user-specific issue?
        
       | jefftk wrote:
       | Are you running any extensions?
        
       | richbell wrote:
       | This sounds exactly like the issue I've been having with my
       | company's instance of Nexus Repository 3 for the past several
       | months. It's a SPA, so I can "log in" and the UI reflects being
       | logged in, but all of the API calls to the backend return a 403.
       | However, this doesn't happen if I use private mode.
        
       | j_koreth wrote:
       | Have you tried looking at the browser privacy settings and
       | adjusting them? Not sure if you're on strict or standard.
        
         | soapdog wrote:
         | I'm on standard. That was one of the first things I checked
         | even though I didn't write that step on the post.
        
       | soapdog wrote:
       | OP here: I created a new profile in "about:profiles". I can login
       | into HN from that profile. The bug is in the profile then, I just
       | need to figure if it is fixable without nuking the profile.
        
         | andrecarini wrote:
         | Have you tried diff'ing both profiles' about:config?
        
         | __ryan__ wrote:
         | You mentioned clearing cookies from ycombinator.com. Did you
         | also clear cookies from news.ycombinator.com?
        
           | soapdog wrote:
           | yes, I did.
        
       | lostmsu wrote:
       | If you are on Windows and your Firefox profile got borked, try
       | ShadowExporer to restore the profile version that still worked.
       | Also check if File History is on and has a copy of your profile
       | (those two are separate features). Then check if you have image
       | backup enabled.
        
       | jedberg wrote:
       | I see you tried private browsing and it works, so that would
       | imply a bug in something that runs when not private browsing, so
       | most likely a plugin that is blocking something.
       | 
       | Start doing a plugin bisection and see if you can find the
       | offending plugin.
        
         | soapdog wrote:
         | Been through that already. All add-ons disabled and the problem
         | persisted.
        
           | unnouinceput wrote:
           | Well, the idea still stands. Private->ok, not private->not
           | ok. That's your telltale sign, go with the evidence, as a
           | famous TV show says. Maybe you have something on your normal
           | profile, I dunno what, but I like bashing Apple and since you
           | say you're on MacOS, see what Apple does with that profile.
           | Who knows, maybe you encounter a bug and you can get money
           | out of it from Apple's bug hunting program. Good luck!
        
           | nabakin wrote:
           | Have you tried uninstalling Firefox, deleting any residual
           | appdata, and installing again? Have you tried installing the
           | same version of FF Nightly and FF on another macOS computer?
        
             | stjohnswarts wrote:
             | Much less radical is just to use the command line options
             | to create a new profile and see what happens. I have fixed
             | obscure problems in firefox by blowing away the profile.
             | 99% of what I need is stored in firefox sync so it's an
             | easy process to delete an old profile and sync back up.
             | Sounds like OP wants to get to the bottom of this though as
             | a haX0r-ng project.
        
             | soapdog wrote:
             | Not yet. I'm trying to figure out what is going on before
             | destroying everything.
             | 
             | I did try two different versions of Firefox on the same
             | machine though (with different profiles).
        
               | floatingatoll wrote:
               | Did you reuse existing profiles on both versions, or in
               | either case did you start a completely fresh profile? If
               | you haven't yet tested with a _newly-created_ profile
               | (which doesn 't require deleting your existing profile),
               | then you need to do so in order to triage whether the
               | problem is with Firefox-by-default or Firefox-and-your-
               | profile.
        
               | nabakin wrote:
               | I'd try installing your version of FF Nightly on another
               | macOS computer to rule out that possibility. Maybe it's
               | not a config issue but something to do with Nightly which
               | is affecting your other, release FF
        
               | nabakin wrote:
               | Since it exists in both versions of FF, could you have
               | anything installed which could be interfering with FF's
               | communication with the rest of the internet? Are you on a
               | network with a router which is able to modify your
               | traffic (requires custom SSL certificate) (long shot)?
        
           | kzrdude wrote:
           | You can try a new profile? about:profiles
        
             | [deleted]
        
           | nabakin wrote:
           | Maybe an addon made some FF config change which remains
           | despite being disabled? Have you tried uninstalling all the
           | add-ons as well?
        
       | charcircuit wrote:
       | An annoying "feature" of firefox is that if you (even
       | temporarily) run low on storage it will go into a mode where
       | localstorage (and indexdb?) stop working. This makes a lot of
       | sites break for seemingly no reason. You have to restart Firefox
       | to fix it.
        
         | ComputerGuru wrote:
         | Fortunately, HN is not such an abomination that relies on all
         | these "features" when static html, a tiny bit of CSS, and a
         | light sprinkle of JS to gracefully enhance the experience would
         | suffice.
        
       | dahfizz wrote:
       | I experience the same issue, seemingly randomly, on firefox on
       | Android. I log in, it redirects me to the home page, but I am not
       | logged in. I retry over and over with the same result. The form
       | is filled by my password manager, so I know it is right (I have
       | manually typed in credentials as well, same result).
       | 
       | I just switch to chrome when it happens, and it seems to resolve
       | itself at random. Last time it happened was a few months ago.
        
         | nabakin wrote:
         | Just switched to FF Nightly on Android and logged into HN.
         | Haven't reproduced the bug so far.
        
       | ghiculescu wrote:
       | A helpful way to debug this is the "copy as Curl" feature in most
       | browsers. That should give you the most true representation of
       | what request is being sent to HN. Do it in private mode and non-
       | private mode and then compare the differences.
       | 
       | The screenshot is probably out of date but here's how to use it
       | https://everything.curl.dev/usingcurl/copyas#from-firefox
       | 
       | If you do this in chrome you'll get a long curl command that ends
       | like this:                 --data-raw
       | 'goto=item%3Fid%3D30166448&acct=ghiculescu&pw=(YOUR PW)' \
       | --compressed
       | 
       | I found it most helpful to change that to                 --data-
       | raw 'goto=item%3Fid%3D30166448&acct=ghiculescu&pw=(YOUR PW)' -v
       | 
       | So you can also see the response headers etc.
        
       | ww520 wrote:
       | I've tried logging off and on HN, and logon is fine (Linux,
       | version 91).
       | 
       | May be you can try:
       | 
       | 1. Check the clock on your machine. Make sure it's not running at
       | a time beyond 2038.
       | 
       | 2. Check the disk space on your machine, especially where the
       | profile is stored. Out of space error can be causing other
       | errors.
       | 
       | 3. Check the file system read/write permission on the profile
       | folder.
       | 
       | 4. Make sure there's not another instance of Firefox running. In
       | fact, reboot just to be sure.
       | 
       | 5. Try older versions of Firefox, with the portable versions.
       | There's a command line argument to use an existing profile or a
       | new one. Try those. This would narrow the problem down to whether
       | it's caused by your machine or versions of Firefox.
       | https://mozilla-firefox-portable.en.uptodown.com/windows/ver...
       | 
       | Good luck.
        
       | hateful wrote:
       | The one thing I noticed is that the updates you posted are at
       | least 3 hours in the future from me (EST). Where are you located?
       | Maybe it has something to do with you being in a certain
       | timezone?
        
       | zaptheimpaler wrote:
       | Maybe try running Wireshark and check that the request from FF to
       | HN is sending the cookie?
       | 
       | If the server is fine, the only cause I can imagine is that the
       | request after login does not report the cookie as set. Wireshark
       | should help confirm whether the request is ok.
       | 
       | Then run strace on Firefox and check that the request written out
       | by FF is ok. If that's fine too, then Mac OS must be fudging the
       | request somewhere between when FF writes to the socket and when
       | it actually leaves your machine?
        
         | soapdog wrote:
         | No need for a proxy to check it. HN is very old-school, it is
         | very easy to see the raw requests and stuff. Everything looks
         | as it should be, it just doesn't work.
         | 
         | I'm inclined to believe there is something funky going on with
         | both my profiles. The odds of that happening is very low, but I
         | don't see other options.
        
       | iqanq wrote:
        
         | benbristow wrote:
         | If you've got this dated view about Firefox it might be worth
         | giving it another try. It's come on leaps and bounds, pretty
         | much equally on par of speed against Chrome/Edge etc.
         | 
         | Sent from my Firefox install
        
           | jandrese wrote:
           | Firefox is basically as good as Chrome but it also has a
           | default stance of protecting the users instead of giving all
           | of your data directly to Google. Certainly it isn't perfect,
           | but you feel like a bit less of a product when you use it. To
           | make the HN crowd happy they have (re)written a bunch of the
           | codebase in Rust.
        
           | ComputerGuru wrote:
           | Only/One thing I hate about Firefox (under Windows) is it
           | updates in the background with the helper service but the
           | update isn't fully applied until next launch. So you start
           | Firefox, wait the requisite time for the entire browser to
           | load, then your screen flashes and FF disappears, then it
           | relaunches again for real.
           | 
           | The old experience of manually updating it yourself when you
           | felt like it was less annoying than this evergreen
           | implementation!
        
             | chias wrote:
             | If you use multiple profiles (e.g. i have a "personal" and
             | a "work" profile), the experience is pretty bad -- if you
             | close all windows of one profile, it considers itself as
             | "exited" and overwrites the program files. And then your
             | other profile windows no longer work: any page navigation
             | results in "We're sorry, we just need to do one small
             | thing" and a required restart of your browser.
             | 
             | It's still my favorite browser though.
        
               | soapdog wrote:
               | You could use Firefox Containers for that.
        
               | mkl wrote:
               | > "We're sorry, we just need to do one small thing"
               | 
               | I get that even with a single profile. It's infuriating,
               | because it happens when I go to a new site, and that new
               | site is often not restored after it restarts - sometimes
               | I lose it completely.
        
         | [deleted]
        
         | BoxOfRain wrote:
         | Tongue out of cheek, I worry less about Firefox's future than I
         | would a browser with an equivalent market share but without a
         | lot of developers aware of how the sausage is made backing it
         | out of opposition to a Google monopoly. It might be a minority
         | brower, but by virtue of who it attracts that minority is
         | pretty important when it comes to the web.
        
       | mindcrime wrote:
       | I was scared to try this, but I logged out and tried logging in
       | again just now (using Firefox). It worked OK. I'm on Firefox 96.0
       | on Linux, FWIW.
        
       | ddtaylor wrote:
       | What happens if you use Tor Browser?
        
       | jonashus wrote:
       | Does setting the cookie using the javascript console (on
       | ycombinator.com) trigger the same expired message? Could be a
       | good angle if it does.
        
       | shadowgovt wrote:
       | When a problem is this specific to a single user, I begin to
       | suspect actual bit-rot.
       | 
       | Probably worth checksumming the whole Firefox install against
       | what it should be (or the poor man's checksum: uninstall it and
       | reinstall it). If that fixes it, it might have been a one-time
       | thing, or it might be the start of the end of that machine.
       | 
       | Ages ago, I had a machine administered by a company with a very
       | robust binary check-summer. All of a sudden, one of the system
       | libraries started failing to run... The check-summer would block
       | any executable that tried to run with a hash that didn't match
       | one on the allow-list. Took it to company IT, and they checked a
       | couple things and said "No, this is a legit block... Your
       | checksum doesn't match what the binary should be. Have you been
       | having any problems with this machine?"
       | 
       | Wasn't until somebody asked that I realized the once-in-a-blue-
       | moon kernel panics the machine would give were probably worth
       | mentioning to someone. They concluded I probably had a disk
       | controller with just enough badness to fail very, very
       | occasionally... Usually the failure would manifest as a kernel
       | panic, but I must have gotten unlucky and had it fail during a
       | write operation without tripping a validation error. Replaced the
       | machine; no further problems.
        
       | wooque wrote:
       | This is why I use Chrome, never had even the slightest problem
       | with it on any site.
        
       | [deleted]
        
       | doix wrote:
       | This is the epitome of technological blue balls. I really want to
       | know what's going on. Have you tried making a completely new
       | profile rather than modifying an existing one? Trying in private
       | browsing mode? Making a new user in osx, installing Firefox for
       | that user and trying to login?
       | 
       | I expect an update post when you finally get to the bottom of
       | this!
        
         | soapdog wrote:
         | I tried two different profiles, one for Nightly and another for
         | Stable. None worked.
         | 
         | UPDATE: I can log in using private browsing... holy shit, what
         | is going on!
        
           | cornedor wrote:
           | Do you have any add-ons that are installed on both Firefox
           | and Nightly, but that are not enabled in private browsing?
        
           | doix wrote:
           | Make an entirely new profile, I bet it will work. I'm
           | guessing both the existing profiles have something set that
           | is breaking login. No idea what it can be, unless you
           | explicitly blocked cookies from the domain. Not something
           | that you can do accidentally though.
        
             | alx__ wrote:
             | Yeah I've been down this frustrating route before. Somehow
             | your profile has gotten corrupt. You'll probably never know
             | why.
             | 
             | Has happened to me for Chrome and Firefox. Creating a new
             | profile works. Or if you're feeling paranoid, remove any
             | trace of it from the system and do a fresh install.
        
               | millzlane wrote:
               | I stopped trying to figure it out when it happened. First
               | step I take is "refresh firefox"
               | https://support.mozilla.org/en-US/kb/refresh-firefox-
               | reset-a...
               | 
               | If problem persists, new profile.
               | 
               | If problem continues, reinstall FF.
        
               | silon42 wrote:
               | We used to call this "dataloss", "corruption".
        
           | commoner wrote:
           | Can you log in to HN on a separate Firefox container?
           | 
           | https://support.mozilla.org/en-US/kb/containers
           | 
           | Containers do not share cookies, local storage, caches, or
           | other persisted data.
        
             | soapdog wrote:
             | I tried that, it didn't work. I love containers, and it was
             | one of my attempts to solve it. I forgot to include that
             | one in the post, I've tried so many things...
        
               | commoner wrote:
               | At this point, I'd create a new profile and try again. I
               | know that you've already tried both Stable and Nightly,
               | but there is a possibility that both of their profiles
               | have been corrupted by some external factor. If the issue
               | is not at the container level, then it's probably at the
               | profile level.
               | 
               | https://support.mozilla.org/en-US/kb/profile-manager-
               | create-...
        
               | millzlane wrote:
               | Sounds like a corrupt profile in FF. I was coming to look
               | for a comment that mentioned this.
        
               | soapdog wrote:
               | It does. But damn, two corrupt profiles? One on each
               | Firefox? What is the chance of that?!
               | 
               | Anyway, my last attempt will be to create a new profile.
               | I was avoiding that because it feels like quitting. It
               | feels like destroying everything and replanting the soil
               | hoping for a better outcome even though you have no idea
               | what happened before.
        
               | floatingatoll wrote:
               | It's just a debugging step. Don't delete your existing
               | profile. If you confirm that it's fine in a stock
               | profile, then you can use various methods to see what's
               | different and find the bug (eg. "what non-default
               | settings overrides are set in my profile").
        
           | basisword wrote:
           | Private browsing mode is always my first test for these weird
           | issues. Usually it then boils down to an extension, cookies
           | or cache. It sounds like you only cleared ycombinator related
           | cookies. Maybe it's worth clearing everything?
        
             | jedberg wrote:
             | OP tried two different profiles on two different versions
             | of Firefox, so it's unlikely to be cookie or cache related.
        
             | soapdog wrote:
             | I also deleted cache and disabled add-ons, still not
             | working.
             | 
             | The successful login with private browsing makes me hopeful
             | though. Maybe I'll find a solution :-)
        
           | staktrace wrote:
           | Try looking at about:support to see if there are any third-
           | party modules (antivirus etc. loaded). That has been a cause
           | of problems like this in the past. More likely on Windows and
           | I saw you're running macOS, but worth a shot.
        
             | commoner wrote:
             | It's worth a try, though Firefox has discontinued support
             | for NPAPI plugins since version 52 (March 2017)[?]
             | https://support.mozilla.org/en-US/kb/npapi-plugins
             | 
             | The only plugins in the Plugins section of about:addons
             | should be the OpenH264 plugin and the Widevine plugin (only
             | if DRM is enabled). Both can be disabled there.
        
           | ricardobayes wrote:
           | Try FF 95.x? FF 96 broke a lot of stuff.
        
           | powersnail wrote:
           | Have you tried using a different profile?
           | 
           | My FF profile was corrupted once and a lot of sites stopped
           | working mysteriously. Clearing cache didn't help either. It
           | has to be a new profile.
        
       | mfashby wrote:
       | Time to attach a debugger?
        
       | gildas wrote:
       | This might be related to a corrupt profile.
        
         | soapdog wrote:
         | It looks like it, but it is happening on two separate profiles.
         | Both my Nightly profile and my Firefox stable version profile.
         | Unless both profiles are corrupt, which would be odd.
        
           | eadmund wrote:
           | Maybe they are both corrupt due to the near-2038 cookie? It
           | would be weird, but ... bugs can be weird.
        
             | nabakin wrote:
             | Then other people on FF and FF Nightly should be having the
             | same issue
        
       | ffpip wrote:
       | > That problem lasted just some minutes. I'm back logged in in
       | Safari.
       | 
       | You were probably rate limited. I've gotten the "We're having
       | trouble serving your request" thing many times when I
       | accidentally open 20+ HN bookmarks.
        
         | Nextgrid wrote:
         | HN limits POST requests to one every 2 seconds or so per IP
         | address. I'm often getting this when upvoting/posting and then
         | immediately performing an action in a different tab. I suspect
         | this is a fairly recent change because I don't remember this
         | being a problem a year ago or so.
        
           | rzzzt wrote:
           | Same here, when replying to someone in a thread and upvoting
           | their comment in close succession.
        
             | Dylan16807 wrote:
             | Sometimes just vote and immediate click on 'reply' makes it
             | happen, and only one of those is a POST.
        
               | rzzzt wrote:
               | What's the upvote action? Wasn't it changed to a POST
               | after the "this upvotes itself" entry?
        
               | [deleted]
        
       | Resonance1584 wrote:
       | How many bytes is the cookie? Large cookies silently fail to be
       | stored. Do the cookie contents change significantly between
       | private and non private?
        
       | [deleted]
        
       | _Microft wrote:
       | Could it be that setting cookies for the domain was disallowed
       | via the permissions dialog?
       | 
       | When I do that, I see behaviour like you are describing it: when
       | I e.g. tried upvoting jedberg's comment with cookies disallowed,
       | it actually worked. I was redirected to the login page and back
       | to the discussion without staying logged in. After undoing the
       | permission change, logging in and having a look at the exact
       | comment, I saw that the vote actually went through. Posting a new
       | comment showed the same behaviour.
       | 
       | You can find that permission on the "page info" dialog (shortcut
       | _Ctrl+I_ if that isn 't localized?)?
       | 
       | Edit: the error message on the console would be different though.
       | The described procedure leads to the message _" Setting cookie
       | ... has been denied because of a permission set by the user"_
       | (translated from German, so the actual message will be
       | different). It looks like I was only describing the behaviour
       | when cookies are unavailable and not the actual reason.
        
       ___________________________________________________________________
       (page generated 2022-02-01 23:02 UTC)