How to fix 400 Bad Request in Gmail after Offline Mode

Gmail Offline mode failed me for the second time today as I was testing it. For some reason, it keeps thinking that I’m not online when I am. So I disabled it, but made the mistake of keeping all the offline files associated with it, thinking that I might turn it back on again later. I saved the settings and reloaded Gmail. It still didn’t think I was connected and thought that Google Offline was still enabled. So I emptied my cache and restarted Safari.

When I tried to launch Gmail again, I received a “BAD REQUEST ERROR 400” message in large bold letters. When I loaded Gmail in Firefox it worked fine. So I emptied my cache and deleted my cookies and restarted Safari. Same error. Then I went to Safari—>Google Gears Settings… and removed all the Google Gears information related with my Gmail account. I then flushed the cache and restarted Safari again. Same error. I then tried resetting Safari. Same error.

If you encounter this error, here’s how to fix it:

Step 1: Locate the Google Gears database and permissions files on your computer. I found them via the information provided in this very helpful blog post that talks about how Google Offline isn’t really a secure option. If you are using Safari on OS X, the files are located in this folder:
~/Library/Application Support/Google/Google Gears for Safari
Step 2: Grab localserver.db and permissions.db inside this folder. Move them to the Trash.
Step 3: Restart Safari (or whatever browser in which you were having this problem). When you try to login again it should work fine.

So, evidently, the Google Gears Settings… function doesn’t really work at all for truly removing corrupt Google Gears databases. Fun! And none of Google’s help documents explain any of this. Huzzah!

Hope this helps!

UPDATE: Alternate solution / version of the problem. So in addition to the above problem, this also appears to happen from time to time simply because of the cookies associated with Gmail and it is a known issue that Google is currently ignoring, from the sounds of this:

Error 400 Bad Request on Safari
Users with Mac OSX 10.5.6 may see this error when accessing Gmail on Safari. Please reset Safari or use a different browser to access Gmail while the problem continues.

Google advises resetting Safari, which is overkill. To fix it, simply open up your Preferences: Safari—>Preferences… and then select Security and then choose Show Cookies. Select all the cookies beginning with mail.google.com (SHIFT+CLICK to select multiple) and then choose Remove. Reloading Gmail should work now, however, it’s not a permanent fix, so get used to repeating these steps several times a week until Google fixes this problem.

Another Update: If you want to fully uninstall Google Gears from Safari, simply navigate to your Applications folder, then your Utilities folder and launch the Terminal application. At the command line type in:
/Library/Internet\ Plug-Ins/Gears.plugin/Contents/Resources/uninstall.command
Hit return and you will be prompted for your password. Enter your password and it will be removed. Restart Safari and you’re good to go.
bye google gears
Full Google Gears uninstallation instructions for Windows, OS X, Linux, and even Windows Mobile can be found here.

About C.K. Sample III

I am a father, a husband, a blogger, a parrot owner, a pug owner, and the Chief Product Officer for YouEarnedIt. This site has no comments. If you want to talk to me, send me an @cksample on Twitter. If you like this post, feel free to buy me something off of my wishlist.
This entry was posted in google support sucks, Tech and tagged , , , , , , , , , , . Bookmark the permalink.

16 Responses to How to fix 400 Bad Request in Gmail after Offline Mode

  1. caddisfly says:

    FUCK!!

  2. I have the exact same problem (but I've never used Google Gears), and posted about it on the Google forums.

    I wish your solution would fix it, but I don't even have that Google Gears folder on my hard drive.

    Any ideas?

  3. Jason says:

    Thanks for this blog post! First, gmail stopped working with the WebKit nightliesl and then Safari 4 didn't work when I installed it toay. I knew the problem started after I played around with offline gmail, but never thought to do anything with the Gears data files.

  4. Eric Watson says:

    Try going into preferences/security and deleting all of the cookies from gmail/google. That worked for me.

  5. cksthree says:

    I agree with Eric. The error seems to be happening because of cookies / Google Gears database files becoming flawed somehow. Let us know if clearing out those cookies works.

  6. ae says:

    please help me.

    i did what you said but when i restarted safari (4 beta) the cursed google gears settings is still part of the menu

    do i need to reinstall safari

    please email me

    • c.k. says:

      Hey ae,

      I just updated the post with full instructions on how to completely remove Google Gears, if that is what you want to do.

      Cheers,

      C.K.

  7. Joachim says:

    Thanks very much for sharing, solved my problem entirely! http://tinyurl.com/bb5a6h

  8. cksthree says:

    Hey ae,

    I just updated this post with full instructions for how to completely uninstall Google Gears.

    Cheers,

    C.K.

  9. y77 says:

    Turn off “Block HTML Refreshing” (Shift-Apple-R)

  10. cksthree says:

    I do not see that setting anywhere. Where is it?

  11. maska407 says:

    Any body help me please, I received a 400 Bad Request. I cannot view videos from yputube anymore.

Comments are closed.