Exafunction / codeium.nvim

A native neovim extension for Codeium
MIT License
644 stars 50 forks source link

[Bug] After update to 1b87c86 #121

Closed chenhuiapp closed 7 months ago

chenhuiapp commented 7 months ago
Error executing vim.schedule lua callback: .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/log.lua:166: /Users/user/.cache/nvim/codeium: Is a directory
stack traceback:
        [C]: in function 'assert'
        .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/log.lua:166: in function <.../.local/share/nvim/lazy/plenary.nvim/lua/plenary/log.lua:121>
        ...ocal/share/nvim/lazy/codeium.nvim/lua/codeium/notify.lua:14: in function 'error'
        .../.local/share/nvim/lazy/codeium.nvim/lua/codeium/api.lua:310: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>
Press ENTER or type command to continue
[codeium] [ERROR 07:00:52] /Users/user/.local/share/nvim/lazy/codeium.nvim/lua/codeium/notify.lua:14: completion request failed:  {
Press ENTER or type command to continue
[codeium]   code = 0,
Press ENTER or type command to continue
[codeium]   out = '{"code":"unknown","message":"unable to get language from file: unrecognized language"}',
Press ENTER or type command to continue
[codeium]   response = {
Press ENTER or type command to continue
[codeium]     body = '{"code":"unknown","message":"unable to get language from file: unrecognized language"}',
Press ENTER or type command to continue
[codeium]     exit = 0,
Press ENTER or type command to continue
[codeium]     headers = { "Accept-Encoding: gzip", "Content-Type: application/json", "Vary: Origin", "Date: Tue, 28 Nov 2023 15:00:51 GMT", "Content-Length: 86", "", ""
 },
Press ENTER or type command to continue
[codeium]     status = 500
Press ENTER or type command to continue
[codeium]   },
Press ENTER or type command to continue
[codeium]   status = 500
Press ENTER or type command to continue
[codeium] }

How can I fix this? Thank you.

serranomorante commented 7 months ago

Same issue here! Thanks for opening this.

gonviegas commented 7 months ago

Already reported here

pqn commented 7 months ago

As @gonviegas says, duplicate of #119 which is resolved in 1.4.22

pqn commented 7 months ago

@chenhuiapp I deleted your comment to hide your API key, reproducing it below:

I fetched the latest update and it fixed the problem but it is not stable. Sometimes I will still receive the same error. Should it still be a bug? Here is the log

Error executing vim.schedule lua callback: .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/log.lua:166: /Users/user/.cache/nvim/codeium: Is a directory
stack traceback:
[C]: in function 'assert'
.../.local/share/nvim/lazy/plenary.nvim/lua/plenary/log.lua:166: in function 'warn'
.../.local/share/nvim/lazy/codeium.nvim/lua/codeium/api.lua:275: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
[codeium] [WARN  14:39:13] /Users/user/.local/share/nvim/lazy/codeium.nvim/lua/codeium/api.lua:275: failed to cancel in-flight request {
[codeium]   code = 0,
[codeium]   out = '{"code":"unknown","message":"no session state for apiKey API_KEY, sessionId "}',
[codeium]   response = {
[codeium]     body = '{"code":"unknown","message":"no session state for apiKey API_KEY, sessionId "}',
[codeium]     exit = 0,
[codeium]     headers = { "Accept-Encoding: gzip", "Content-Type: application/json", "Vary: Origin", "Date: Tue, 28 Nov 2023 22:37:28 GMT", "Content-Length: 107", "", "
" },
[codeium]     status = 500
[codeium]   },
[codeium]   status = 500
[codeium] }
pqn commented 7 months ago

@chenhuiapp this is just a warning, is there a way to hide this/is it interfering with the completions?

marceldev89 commented 7 months ago

This is caused by a semi-recent update to plenary. I've submitted a fix for it here :) https://github.com/nvim-lua/plenary.nvim/pull/546

chenhuiapp commented 7 months ago

@pqn This warning isn't interfering with the completions. It will sometimes pop up and I can skip it. Not sure what caused it. And thank you for hiding my API key.

pqn commented 7 months ago

Really appreciate the find, @marceldev89. So I guess this issue had actually two problems, the directory issue (not our code) and the unrecognized language issue (fixed). I think then the workaround people can use is pinning their plenary.nvim to 62d1e2e5691865586187bd6aa890e43b85c00518 which is one commit before the broken one. This can be done by passing the commit option in their lazy.nvim config.