Login error with GitHub’s Copilot plugin in JetBrains 2024.2 IDEs: Here’s how I fixed it

The latest versions of WebStorm, PhpStorm, and other JetBrains IDEs can throw an error that prevents users who are using GitHub's Copilot from not being able to log in. Here's my fix.

I’m using WebStorm by JetBrains as my go-to IDE for most of my front-end projects. As I was about to start it to continue one of my projects, from one day to the next, I was confronted with multiple errors that, in the end, wouldn’t let me log in to the super helpful GitHub Copilot plugin.

A thorough Google search didn’t yield any useful results on how to fix this, but it seemed like this is not a new bug. I’ve seen similar reports going back as far as February 2023.

However, the good news is, after tinkering around a bit, I found a way to fix this issue and use Copilot on every JetBrains product again. The following steps explain how I solved it, step by step. I can’t guarantee that it’ll work on your system, but it’s worth giving it a try.

The System

The problem occurred on my iMac. I haven’t tested it on other Apple devices, but it should be universal, at least for other devices running macOS. Here are some details about my iMac:

The latest versions of WebStorm, PhpStorm, and other JetBrains IDEs can throw an error that prevents users who are using GitHub's Copilot from not being able to log in. Here's my fix.

Note: I’m using macOS version 15.0 Beta (24A5320a).

And this is the affected WebStorm version. It’s the latest version, v2024.2.342, released on August 9, 2024:

JetbBrains WebStorm 2024.2

The Error

Upon starting the latest version of WebStorm, v2014.2, I was greeted with a red balloon in the bottom right corner, which read:

IDE error occurred
See details and submit report
The latest versions of WebStorm, PhpStorm, and other JetBrains IDEs can throw an error that prevents users who are using GitHub's Copilot from not being able to log in. Here's my fix.

Okay, I thought, then let’s have a look at this error and check out the “See details” link. An IDE Internal Errors window popped up with the full stack trace:

GitHub Copilot plugin error

Unfortunately, not being a huge fan of Java, I didn’t get any information out of it. Those who do can download the full data here.

When trying to log in via the Copilot icon (now marked with a red X), I was asked which way I’d like to log in (the labels might be slightly different since I took this screenshot after I’ve already removed my GitHub account from WebStorm. More about this below):

Sign in to GitHub

No matter what I chose, another IDE error balloon popped up, stating:

GitHub Copilot
Sign in failed. Reason: Request signininitiate failed with message: EditorFetcher request failed: Error in JSON-RPC request handler: undefined, request id: 14, error code: -32603
GitHub Copilot connection error

To me, this sounded like a network error. I’m using two apps that influence my ethernet connection:

  1. ClearVPN (bought through Setapp)
  2. AdGuard (the best ad-blocker on the market)

The Solution

I disconnected the VPN and killed the two apps to avoid them running silently in the background and probably interfering with WebStorm.

Since all JetBrains IDEs also have internal proxy settings, I clicked on the still disabled Copilot icon and selected “Edit Settings…”:

The latest versions of WebStorm, PhpStorm, and other JetBrains IDEs can throw an error that prevents users who are using GitHub's Copilot from not being able to log in. Here's my fix.

This opened the following window:

JetBrains settings

The only setting I changed was removing the “Authentication Provider” field. Don’t bother about the “Update channel”; it doesn’t make any difference.

I then clicked on the link “Manage HTTP proxy settings (requires restart)”:

The latest versions of WebStorm, PhpStorm, and other JetBrains IDEs can throw an error that prevents users who are using GitHub's Copilot from not being able to log in. Here's my fix.

As you can see, I selected “No proxy.”

Next, I went into an unlikely setting: “Version Control” → “GitHub”

My private GitHub account was listed there, which I deleted, as you can see here:

The latest versions of WebStorm, PhpStorm, and other JetBrains IDEs can throw an error that prevents users who are using GitHub's Copilot from not being able to log in. Here's my fix.

I clicked “Apply” and was asked whether or not I’d like to log into GitHub:

Sign in to GitHub
No GitHub account configured for your IDE, continue to github.com to authenticate for GitHub Copilot.
The latest versions of WebStorm, PhpStorm, and other JetBrains IDEs can throw an error that prevents users who are using GitHub's Copilot from not being able to log in. Here's my fix.

Here, I clicked “Cancel” because an earlier setting said that if I changed the proxy settings, I’d have to restart the editor. So I did.

Once restarted, the familiar “Sign in failed” balloon showed up again. I dismissed it and clicked on the Copilot icon once again, this time, I chose the “Login to GitHub” item:

The latest versions of WebStorm, PhpStorm, and other JetBrains IDEs can throw an error that prevents users who are using GitHub's Copilot from not being able to log in. Here's my fix.

Since I deleted my GitHub account from the IDE, a different popup showed up, saying the following:

Sign in to GitHub
GitHub Copilot uses a GitHub account. Please enter the following code on the GitHub website to authorize your GitHub account with GitHub Copilot.
The latest versions of WebStorm, PhpStorm, and other JetBrains IDEs can throw an error that prevents users who are using GitHub's Copilot from not being able to log in. Here's my fix.

As you can see, this time, I was given a URL and a 9-character device code. I copied the code and clicked on the provided link.

This led me straight to GitHub’s OAuth login page, where I entered my credentials and logged in. After confirming the authorization, I received positive feedback:

The latest versions of WebStorm, PhpStorm, and other JetBrains IDEs can throw an error that prevents users who are using GitHub's Copilot from not being able to log in. Here's my fix.

That looked good, so I headed back into WebStorm, clicked once again on the Copilot icon, and again chose “Login to GitHub.” This time, the response was:

GitHub Copilot
Successfully logged in to GitHub for GitHub Copilot.
The latest versions of WebStorm, PhpStorm, and other JetBrains IDEs can throw an error that prevents users who are using GitHub's Copilot from not being able to log in. Here's my fix.

Et voilà, GitHub Copilot was back in business — and in my JetBrains WebStorm IDE. That’s all it took!

I tested if this would be saved if I restarted the IDE, and yes, it did. I also went through the same routine with PhpStorm and PyCharm, which I use for small scripting tools. The latter surprisingly had no problems connecting, despite all IDEs being on the latest version, v2024.2.

If you’ve encountered the same bug with the Copilot plugin as I have, I hope this little guide solves it for you!