32

For Intellij plugin, GitHub Copilot shows error please login to github and try again.

I have already done the following:

  • Authenticated GitHub Copilot with my GitHub user and password.
  • Allowed GitHub Copilot in GitHub account profile.
  • Restarted the IDE multiple times after the plugin installation.
  • I have license for Github Copilot.

What should I do to resolve this error?

Exploring
  • 2,493
  • 11
  • 56
  • 97
  • Please state what versions you're using and confirm that you have a license for copilot. – rethab Aug 05 '22 at 05:38
  • The process was eventually resolved after uninstall/reinstall of the GitHub Copilot plugin. – Exploring Aug 05 '22 at 05:40
  • I'd like to add that it is entirely possible your company is blocking access, like mine does. No error is shown. It just tries to connect and then disconnects. – bdetweiler Apr 04 '23 at 18:52
  • just updated to v1.2.5.2507 for jetbrains and getting this issue again, seems it was working ok for a while but the problem is back and constantly have to do this log out restart dance. Really annoying for a premium plugin – Brad Apr 06 '23 at 23:20

3 Answers3

36

I have to restart my IDE, then go to tools->GitHub copilot:

1- restart IDE

2- got to "tools" -> "GitHub copilot" -> "login to GitHub"

3- it will show you a popup with code, click on copy and open to add and trust your device.

enter image description here

Mina Farid
  • 5,041
  • 4
  • 39
  • 46
5

Debanjan Basu suggests in the comments:

logout, restart IDE and login again.
You might have signed up for copilot after the session was initiated


You have multiple discussion reporting this error.

discussions 18132 includes:

Behind corporate proxy. Used latest stable version with CLion 1.1.28.1744 and added -Dcopilot.agent.disabled=true to Custom VM properties.

Also delete github-copilot.local.xml and github-copilot.xml in .config/JetBrains/CLion2022.2/options.


This has since been answered by GitHub staff member Benjamin Muskalla (Aug. 11th, 2022):

We’re happy to announce that the latest release of Copilot for Visual Studio Code and Copilot for IntelliJ contains preliminary support for connecting through HTTP proxy servers.

The current version supports basic HTTP proxy setups, with and without basic authentication.

For Jetbrains IntelliJ

  • Ensure you have Copilot for IntelliJ 1.1.29.1869 or higher installed in your IDE.
  • Setup the HTTP proxy in your Preferences.
  • Restart your editor so the proxy configuration is applied correctly to all components requiring connections via the proxy.

IntelliJ -- Screenshot 2022-08-03 at 20 24 31

For Visual Studio Code

Ensure you have Copilot for VS Code 1.39.6432 or higher installed in your editor.

  • To set up your proxy, go to your VSCode Settings and ensure your HTTP proxy configuration is set up properly.
    Alternatively, Copilot uses the http_proxy and https_proxy variables from your environment.
    VScode -- Screenshot 2022-08-11 at 10 18 49

  • Restart your editor so the proxy configuration is applied correctly to all components requiring connections via the proxy.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 5
    This doesn't work. – c-an Feb 20 '23 at 03:03
  • @c-an I am sorry to read that. Can you describe your setup? What IDE are you using? – VonC Feb 20 '23 at 05:27
  • I am using Android Studio - Electric Eel. – c-an Feb 20 '23 at 07:37
  • @c-an The [2022.1.1 edition](https://developer.android.com/studio/releases), I see. Do you see [error messages similar to this?](https://github.com/community/community/discussions/18132). – VonC Feb 20 '23 at 07:40
  • 2
    No, I have no message alert but when I open Copilot panel, It says, Please Login to GitHub and try again. Even though I login, it doesn't go away. – c-an Feb 22 '23 at 10:09
  • @c-an OK. What Os are you using? And are you behind a proxy? – VonC Feb 22 '23 at 10:35
  • @c-an logout, restart IDE and login again. You might have signed up for copilot after the session was initiated. – Debanjan Basu Mar 14 '23 at 10:24
  • Can the IDE get an update to do this for us? It's been almost a month. Tagging anyone at jetbrains.... – rollsch Apr 08 '23 at 06:52
  • 1
    @rollsch good question. Let me know if you get an reply from support, I will update this answer. – VonC Apr 08 '23 at 07:15
1

I had the same problem after I quit my personal trial period and got access from the organization. Restarting didn't help, and logging in/out didn't work at all for some reason.

I uninstalled the plugin completely, restarted IDE, and installed it again and after another restart, everything worked.

Dach0
  • 309
  • 4
  • 11