25

I have been using copilot for a while now, and one fine day on opening VSCode this error appeared.

"[ERROR] [default] [2022-04-09T08:38:10.995Z] GitHub Copilot could not connect to server. Extension activation failed: "certificate has expired"

I looked up for it everywhere and found nothing, it'd be a great help if someone could fix this for me!

[here's the error and how the extension looks like on the status bar]

Arnish B
  • 251
  • 1
  • 3
  • 3

8 Answers8

43

Three common causes:

  1. An out of date IDE. Solution: make sure your IDE is up to date
  2. If you're not properly signed in to GitHub CoPilot. Solution: make sure you're signed in to GitHub CoPilot

E.g. In VSCode look on the bottom left, if you see this, you might not be signed in:

enter image description here

Click the icon, and follow the prompts to sign in, then CoPilot should work.

  1. Try closing and reopening your IDE (e.g. vscode), that may also help.
stevec
  • 41,291
  • 27
  • 223
  • 311
17

I know its a bit late. But I encountered this problem today. If disabling and restarting doesn't help, you could try:

At uninstall, select Install another version, and select the version before the latest

Reload vscode

After doing this, my copilot started working again.

calypso
  • 171
  • 1
  • 4
7

Two things you should check:

1=> Update VSCode to the latest version

2=> Update GitHub Copilot to the latest version (Enable it from the extension section)

After the update, it MAY require that you Reload/Restart VSCode.

From the Menubar, go to View -> Output; Choose GitHub Copilot from the pulldown on the left to see the log of what is going on in the background.

Look at my pulldown here imgur.com/VVHfqwv

Good Muyis
  • 127
  • 9
  • 3
    I did ```View -> Output```, but I don't see GitHub Copilot in any pulldown on the left. – Kevin Weinrich Jun 21 '22 at 16:24
  • Try to update the **GitHub Copilot** to the latest version and Enable it from the extension section. After the update, it MAY require that you Reload VSCode. Look at my pulldown here https://imgur.com/VVHfqwv – Good Muyis Jun 23 '22 at 09:07
  • After updating VSCode, it works again! – Tim Yao Aug 05 '22 at 04:47
3

Go to your Github account and check if you have paid the bill, In my case that was the problem.

Kushagra Kumar
  • 131
  • 1
  • 3
3

Went to copilot extension settings and changed

    "github.copilot.enable": {

        "*": true,
        "plaintext": false,
        "markdown": false,
        "scminput": false
    }

to

    "github.copilot.enable": {

        "*": true,
        "typescript": true,
        "plaintext": false,
        "markdown": false,
        "scminput": false
    }

and it suddenly started working. I may have opted to disable it for typescript in a GUI a day or two ago - if so that would indicate more state than what is seen in the settings.json file (?).

Craig Hicks
  • 2,199
  • 20
  • 35
  • As time passed it happened again. Checked the settings and the "typescript" property had disappeared. Set it again and all was well. – Craig Hicks Jul 20 '23 at 23:34
1

In Visual Studio, if you are the one that disabled the Copilot before you can enable the following way.

Either search for "Copilot". Or go to Tools>>Options>>GitHub>>Copilot

Go to Enable Globally and change from false to True.

enter image description here

Vectoria
  • 1,627
  • 14
  • 13
-1

All the above solutions didn't work for me.

What worked for me was opening VS Code as an "administrator". Then Github Copilot just started working ✅

Here's where I found that solution: https://github.com/orgs/community/discussions/6785#discussioncomment-1561804

Sean McCarthy
  • 4,838
  • 8
  • 39
  • 61
-2

Given that GitHub Copilot is so fresh and well-liked, updates are made often. When encountering this kind of problem, I would advise entirely purging and reinstalling.

Installation of GitHub Copilot in Visual Studio Code

The documentation lists extensions for Visual Studio Code, Visual Studio, Neovim, and the JetBrains suite as IDEs that GitHub Copilot supports.

The installation consists of three main steps:

  1. Create a GitHub account (if you don’t have one already).
  2. Go to GitHub Copilot and click on “Start my free trial”. Follow the sign-up steps and make sure to cancel before your 60-day free trial is up (if you don’t want to continue using the tool).
  3. Install the VSCode extension by searching for “GitHub Copilot” on the extensions tab. You’ll be asked to sign in to GitHub, authorize the extension, and then Copilot will be set up.

If you would like a more thorough explanation, my colleague Rafael wrote a great article based on his time with Copilot and VSCode: https://www.scalablepath.com/full-stack/ai-pair-programming-github-copilot-review

Adam Biggs
  • 42
  • 3