Problem with Gmail on iMac

Recent problem with accessing my Gmail account when I changed my password. It works fine on my iPhone and my iPad but I keep getting the 400 error code about the request being malformed. I am using Safari and am up to date on updates.

iMac 27″ 5K, macOS 13.6

Posted on Jan 10, 2024 1:24 PM

Reply
Question marked as Top-ranking reply

Posted on Jan 10, 2024 1:48 PM

Just to be sure I understand ... you are accessing your Gmail account using Safari, not the Apple Mail app ... correct?


If so, when you try accessing it, that is when you are seeing this "HTTP 400 Bad Request" error message ... correct?


A "400" code would indicate that the Gmail server could not "understand" the request coming from Safari due a syntax error. Basically something got jumbled up, either at the source (Safari), its transmission (over the Internet), or at the server end.


Let's start with, do you use any of the following on your Mac:

  • Software firewalls?
  • Anti-virus apps?
  • VPNs?


Have you tried any/all of the following:

  • Deleted the Safari cache?
  • Restarted your Mac?
  • Restarted your network router?
  • Tried accessing your Gmail account from a different web browser? From the Apple Mail app?
10 replies
Question marked as Top-ranking reply

Jan 10, 2024 1:48 PM in response to SueJZab

Just to be sure I understand ... you are accessing your Gmail account using Safari, not the Apple Mail app ... correct?


If so, when you try accessing it, that is when you are seeing this "HTTP 400 Bad Request" error message ... correct?


A "400" code would indicate that the Gmail server could not "understand" the request coming from Safari due a syntax error. Basically something got jumbled up, either at the source (Safari), its transmission (over the Internet), or at the server end.


Let's start with, do you use any of the following on your Mac:

  • Software firewalls?
  • Anti-virus apps?
  • VPNs?


Have you tried any/all of the following:

  • Deleted the Safari cache?
  • Restarted your Mac?
  • Restarted your network router?
  • Tried accessing your Gmail account from a different web browser? From the Apple Mail app?

Jan 12, 2024 9:07 AM in response to 6x6

While I thought I had private browsing off, I went in settings under Safari and unchecked the advanced tracking line and that took care of my problem. The screen that I always got the 400 error on still had the symbol of a lock and said "private browsing" but I had no problems advancing this time. Thank you so much! Both you and Tesserax were great in offering me help.

Jan 10, 2024 2:22 PM in response to SueJZab

Ok, thank you for the additional information. Although I'm a bit confused about this statement: "I am using the Apple mail app" In that, your original post said that you were using Safari ... so which is it?


FYI, the following are potential reasons that you would see a HTTP 400 error:

  • URL syntax error: this might mean that illegal characters were used in the request. That is, for example, you had inadvertently used www.gooogle.com
  • Uploading a file that is too large: if the server is configured to have a size limit, then it may return this error code.
  • Invalid Web Cookies: when login cookies expire or are no longer valid. Here you will want to delete your saved Safari Cookie cache.
  • DNS cache error: when the client-side version of the DNS cache expires or becomes corrupt, and the name resolution is no longer valid, this error will be returned. This is where rebooting your Mac, and your router may resolve this type of error.


Jan 10, 2024 4:30 PM in response to SueJZab

SueJZab wrote:

II deleted my gmail account in the Apple mail app and attempted to add the gmail account back in. I was able to sign in with my email and it recognized my password. It then goes to "sign in to macOS", the choices are cancel or continue. I press continue and that is when I get the 400 error which is the same as it was when the gmail account was already listed in the mail accounts area.

Hmm, this is where I having trouble understanding. Sorry. You add your Gmail account back to Apple mail. You are successful doing so by providing your Google account credentials. So far, so good.


It's the next part, where you're asked to sign into macOS. I am assuming that this is your macOS user account on your Mac. I don't recall having to do this when I added my Gmail account to the Mail app.


Would you please try repeating those steps again, but this time when you get this error, take a screen shot and post it here?


I'm assuming that you are not having any issues logging into your Mac, or logging into you Apple ID ... correct?

Jan 11, 2024 5:37 PM in response to SueJZab

I noticed in your screenshot that your browser (Safari?) opens a Private window to connect the Google authentication. Could you try to turn off default private browsing?


Also, there was a bug in Safari (I can't remember now which version) that prevented the Google authentication to work properly. The issue was not a 400 error but a never ending loading screen. Try to download another browser (Firefox for instance) and make it your default browser just to set up your email account.

Jan 10, 2024 2:52 PM in response to Tesserax

I'm apologize I was not clear. I am using the Apple Mail app. Since the last post, I restarted my network router and verified I had deleted the Safari cache and cookies. I deleted my gmail account in the Apple mail app and attempted to add the gmail account back in. I was able to sign in with my email and it recognized my password. It then goes to "sign in to macOS", the choices are cancel or continue. I press continue and that is when I get the 400 error which is the same as it was when the gmail account was already listed in the mail accounts area.


I can access my gmail account signing in using Safari with no problems. I use the Apple Mail app on all my devices as I have a hotmail email and an Apple email. I have no problems with Mail app on my iPhone or iPad accessing my gmail account.


I don't know if this is a factor but my iMac is a 2017 and I can not update to Sonoma. I have Ventura 13.6.3.

Jan 11, 2024 4:11 PM in response to SueJZab

Hmm, well we know that this isn't an authentication issue. However, without a data capture of the actual communication between your Mac and the Google server, it would be impossible for me to know what is not working properly.


The only last two things I can think of, would be to:

  1. Boot up your Mac in Safe Mode. Then try accessing your Gmail account again. (less drastic)
  2. Completely erase your Mac's system drive, and then, reinstalling a fresh copy of macOS. (very drastic)


Otherwise, maybe someone who has experienced something like this, will chime in to offer you a potential solution. Good luck! Sorry, I couldn't help you with this.

Jan 10, 2024 1:58 PM in response to Tesserax

Thank you for responding. I am using the Apple mail app. I am able to access my gmail account in Safari. I do not use Chrome. I use the Apple app on my iPhone and iPad and have no problems accessing the gmail account. I do get the "400" error message.


I have not changed firewalls . I use Malwarebytes free version. I do not have a VPN on my iMac.


I have deleted the Safari cache and restarted my Mac. I have not restarted my network router.



This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Problem with Gmail on iMac

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.