Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to authenticate 403 #504

Open
albibenni opened this issue Nov 17, 2024 · 9 comments
Open

Failed to authenticate 403 #504

albibenni opened this issue Nov 17, 2024 · 9 comments
Labels
question Further information is requested

Comments

@albibenni
Copy link

I am using this plugin with Macos and Nvim 0.10.0 with lazy.

The copilot plugin is working fine and authenticating but for the chat I'm having some issues.
I tried the suggest allow_insecure=true but it's not solving the problem and also the tiktoken part (even tho with the healthcheck it's still missing somehow).
Screenshot 2024-11-17 at 10 18 13

here you can find the copilot chat lua file along side my nvim config

I tried basicly everything suggested in the issue linked above and in the notes.

Thanks to anyone willing to help me :)

@deathbeam
Copy link
Collaborator

Can you check :CopilotChatDebugInfo and also logs? Logs should have slightly more detailed error message

@deathbeam deathbeam added the question Further information is requested label Nov 17, 2024
@albibenni
Copy link
Author

This is the output: (I cut on the current workspace file map since it's just the list without any errors after that)
image

@deathbeam
Copy link
Collaborator

And can you check the log contents?

@albibenni
Copy link
Author

albibenni commented Nov 17, 2024

Yes, the log is full of these errors:

[ERROR Sat Nov 16 17:20:34 2024] /Users/benni/.local/share/nvim/lazy/CopilotChat.nvim/lua/CopilotChat/init.lua:408: ...e/nvim/lazy/CopilotChat.nvim/lua/CopilotChat/copilot.lua:368: {
  exit = 22,
  message = 'get https://api.github.com/copilot_internal/v2/token - curl error exit_code=22 stderr={ "curl: (22) The requested URL returned error: 403" }',
  stderr = '{ "curl: (22) The requested URL returned error: 403" }'
}

@deathbeam
Copy link
Collaborator

deathbeam commented Nov 17, 2024

Hmm and does stuff like copilot.vim or copilot.lua work including the autocomplete? Also do you have copilot chat enabled here: https://github.com/settings/copilot

image

@deathbeam
Copy link
Collaborator

Also can you try updating the plugin to latest version. As the line numbers arent matching with thats on master atm

@albibenni
Copy link
Author

albibenni commented Nov 18, 2024

Hmm and does stuff like copilot.vim or copilot.lua work including the autocomplete? Also do you have copilot chat enabled here: https://github.com/settings/copilot

image

I'm using the chat feature with vscode and it's already enabled.

For the latest version I'm trying to keep it up to date since it's not working for me either way.
Anyway with the latest update calling any chat command I get the same error (it doesn't log tho):

Error executing luv callback:
...ocal/share/nvim/lazy/plenary/lua/plenary/async/async.lua:18: The coroutine failed with this message: ...e/nvim/lazy/Copi
lotChat.nvim/lua/CopilotChat/copilot.lua:414: Failed to authenticate: 403
stack traceback:
        [C]: in function 'error'
        ...ocal/share/nvim/lazy/plenary/lua/plenary/async/async.lua:18: in function 'callback_or_next'
        ...ocal/share/nvim/lazy/plenary/lua/plenary/async/async.lua:45: in function '_user_on_exit'
        .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:241: in function '_shutdown'
        .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:48: in function <.../.local/share/nvim/lazy/plenary.nvi
m/lua/plenary/job.lua:39>

The copilot plugin is working fine and authenticating correctly

@deathbeam
Copy link
Collaborator

Hmm and does stuff like copilot.vim or copilot.lua work including the autocomplete? Also do you have copilot chat enabled here: https://github.com/settings/copilot
image

I'm using the chat feature with vscode and it's already enabled.

For the latest version I'm trying to keep it up to date since it's not working for me either way. Anyway with the latest update calling any chat command I get the same error (it doesn't log tho):

Error executing luv callback:
...ocal/share/nvim/lazy/plenary/lua/plenary/async/async.lua:18: The coroutine failed with this message: ...e/nvim/lazy/Copi
lotChat.nvim/lua/CopilotChat/copilot.lua:414: Failed to authenticate: 403
stack traceback:
        [C]: in function 'error'
        ...ocal/share/nvim/lazy/plenary/lua/plenary/async/async.lua:18: in function 'callback_or_next'
        ...ocal/share/nvim/lazy/plenary/lua/plenary/async/async.lua:45: in function '_user_on_exit'
        .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:241: in function '_shutdown'
        .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:48: in function <.../.local/share/nvim/lazy/plenary.nvi
m/lua/plenary/job.lua:39>

The copilot plugin is working fine and authenticating correctly

Hmm, could you try this in cli:

:lua print(vim.fn.expand('$HOME/.config'))

and this

:lua print(vim.fn.expand('$XDG_CONFIG_HOME'))

also could you check if either of those folders has github-copilot directory and see if theres something weird in github-copilot/hosts.json or github-copilot/apps.json

as it looks like its finding either hosts or apps but the token there might be invalid or something.

@deathbeam
Copy link
Collaborator

Also maybe it would be faster to debug it on discord if you have discord account (link to this plugin discord is in README at top, im there as @deathbeam)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants