Exafunction / codeium.nvim

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

In small files works, big not #115

Closed brunojoao closed 7 months ago

brunojoao commented 7 months ago

job.lua:405: Failed to spawn process: image image

this is my load lazy astronvim config


return {
    {
        "Exafunction/codeium.nvim",
        lazy = false,
        dependencies = {"nvim-lua/plenary.nvim", "hrsh7th/nvim-cmp"},
        config = function()
            local lspkind = require("lspkind")
            local cmp = require("cmp")
            require("codeium").setup {
                cmp.setup({
                    -- ...
                    sources = {
                        -- ...
                        {name = "codeium"}
                    }
                }),
                formatting = {
                    format = lspkind.cmp_format({
                        mode = "symbol",
                        maxwidth = 50,
                        ellipsis_char = '...',
                        symbol_map = {Codeium = ""}
                    })
                }
            }
        end
    }
}

this happen in big files only, in small files works perfectly.

Full error:

Erro detectado ao processar TextChangedI Autocommands for "*":                                                                                                                                                     
Error executing lua callback: .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:405: Failed to spawn process: {                                                                                          
  _additional_on_exit_callbacks = {},                                                                                                                                                                              
  _shutdown_check = <userdata 1>,                                                                                                                                                                                  
  _stderr_results = {},                                                                                                                                                                                            
  _stdout_results = {},                                                                                                                                                                                            
  _user_on_exit = <function 1>,                                                                                                                                                                                    
  args = { "-sSL", "-D", "/run/user/1000/plenary_curl_5ace460a.headers", "-X", "POST", "-H", "Content-Type: application/json", "--data-raw", "{\"editor_options\": {\"insert_spaces\": true, \"tab_size\": 4}, \"me
tadata\": {\"extension_name\": \"vim\", \"ide_name\": \"neovim\", \"request_id\": 244, \"api_key\": \"**", \"extension_version\": \"1.2.90\", \"ide_version\": \"0.9.4\"}, \"doc
ument\": {\"editor_language\": \"php\", \"language\": 29, \"line_ending\": \"\\n\", \"cursor_offset\": 26, \"text\": \"<?php\\n\\nnamespace SM;\\n\\nretur [\\n    'router' => [\\n        'routes' => [\\n        
    'login' => [\\n                'type' => 'Segment',\\n                'options' => [\\n                    'route' => '/[:action]',\\n                    'defaults' => [\\n                        'controller
' => 'SM\\\\Controller\\\\Auth',\\n                        'action' => 'index'\\n                    ]\\n                ]\\n            ],\\n            'api' => [\\n                'type' => 'Segment',\\n     
           'options' => [\\n                    'route' => '/api',\\n                    'defaults' => [\\n                        'controller' => 'SMApi\\\\Controller\\\\Index',\\n                        'actio
n' => 'index'\\n                    ]\\n                ],\\n                'may_terminate' => true,\\n                'child_routes' => [\\n                    'wildcard' => [\\n                        'type' 
=> 'Wildcard',\\n                        'options' => [\\n                            'key_value_delimiter' => '?',\\n                            'param_delimiter' => '='\\n                        ],\\n         
               'may_terminate' => true\\n                    ],\\n                    'getClienteByKey' => [\\n                        'type' => 'Segment',\\n                        'options' => [\\n            
                'route' => '/atendimentos/:key/cliente',\\n                            'defaults' => [\\n                                'action' => 'get-cliente-by-key'\\n                            ]\\n       
                 ]\\n                    ],\\n                    'getOrcamentosByKey' => [\\n                        'type' => 'Segment',\\n                        'options' => [\\n                            '
route' => '/atendimentos/:key/orcamentos',\\n                            'defaults' => [\\n                                'action' => 'getOrcamentosByKey'\\n                            ]\\n                     
   ]\\n                    ],\\n                    'calculaFrete' => [\\n                        'type' => 'Segment',\\n                        'options' => [\\n                            'route' => '/calcula-
frete',\\n                            'defaults' => [\\n                                'action' => 'calculaFrete'\\n                            ]\\n                        ]\\n                    ],\\n         
           'system' => [\\n                        'type' => 'Segment',\\n                        'options' => [\\n                            'route' => '/change-system/:system_key',\\n                         
   'defaults' => [\\n                                'action' => 'change-system'\\n                            ]\\n                        ],\\n                        'may_terminate' => true\\n                 
   ],\\n                    'atendimentobycdcli' => [\\n                        'type' => 'Segment',\\n                        'options' => [\\n                            'route' => '/atendimento-by-cdcli[/:cdc
li]',\\n                            'constraints' => [\\n                                'cdcli' => '[0-9]+'\\n                            ],\\n                            'defaults' => [\\n                     
           'action' => 'listAtendimentoByCdcli'\\n                            ]\\n                        ],\\n                        'may_terminate' => true\\n                    ],\\n                    'gets
tatusatendimento' => [\\n                        'type' => 'Segment',\\n                        'options' => [\\n                            'route' => '/atendimento-get-status/:cdcli/:cdfil/:nrorc',\\n         
                   'constraints' => [\\n                                'cdcli' => '[0-9]+'\\n                            ],\\n                            'defaults' => [\\n                                'actio
n' => 'getStatusAtendimento'\\n                            ]\\n                        ],\\n                        'may_terminate' => true\\n                    ],\\n                    'update-nome-clientes' =
> [\\n                        'type' => 'Segment',\\n                        'options' => [\\n                            'route' => '/update-nome-clientes',\\n                            'constraints' => [\\n  
                              'cdcli' => '[0-9]+'\\n                            ],\\n                            'defaults' => [\\n                                'action' => 'update-nome-clientes'\\n           
                 ]\\n                        ],\\n                        'may_terminate' => true\\n                    ],\\n                    'getobjetoscorreios' => [\\n                        'type' => 'Seg
ment',\\n                        'options' => [\\n                            'route' => '/get-objetos-correios/:cdcli/:cdfil/:nrorc',\\n                            'constraints' => [\\n                         
       'cdcli' => '[0-9]+'\\n                            ],\\n                            'defaults' => [\\n                                'action' => 'getObjetosCorreios'\\n                            ]\\n    
                    ],\\n                        'may_terminate' => true\\n                    ],\\n                    'autocomplete' => [\\n                        'type' => 'Segment',\\n                      
  'options' => [\\n                            'route' => '/autocomplete/:type',\\n                            'defaults' => [\\n                                'action' => 'autocomplete'\\n                     
       ]\\n                        ],\\n                        'may_terminate' => true\\n                    ],\\n                    'getstatuspagamento' => [\\n                        'type' => 'Segment',\\n 
                       'options' => [\\n                            'route' => '/get-status-pagamento/:idPedido/:nrorc/:cdfil',\\n                            'defaults' => [\\n                                'ac
tion' => 'get-status-pagamento'\\n                            ]\\n                        ],\\n                        'may_terminate' => true\\n                    ],\\n                    'import-service-bulk'
 => [\\n                        'type' => 'Segment',\\n                        'options' => [\\n                            'route' => '/93634f26dfc8c7b13817e16ecfdcbb62b62a9836/:idAtendente',\\n                
            'defaults' => [\\n                                'action' => 'import-service-bulk'\\n                            ]\\n                        ],\\n                        'may_terminate' => true\\n  
                  ],\\n                    'workflow-transfer-column' => [\\n                        'type' => 'Segment',\\n                        'options' => [\\n                            'route' => '/workf
low-transfer-column/:idAtendimento/:idColumn',\\n                            'defaults' => [\\n                                'action' => 'workflow-transfer-column'\\n                            ]\\n           
             ],\\n                        'may_terminate' => true\\n                    ]\\n                ]\\n            ],\\n            'gerar-link-continuidade' => [\\n                'type' => 'Segment',\
\n                'options' => [\\n                    'route' => '/gerar-link-continuidade',\\n                                                                                                                   
Error executing vim.schedule lua callback: .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/log.lua:166: /home/develop/.cache/nvim/codeium: É um diretório                                                      
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  21:41:15] /home/develop/.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 d75bfe49-e8e9-4f68-b577-e5e1aa82b443, sessionId "}',                                                                                   
[codeium]   response = {                                                                                                                                                                                           
[codeium]     body = '{"code":"unknown","message":"no session state for apiKey d75bfe49-e8e9-4f68-b577-e5e1aa82b443, sessionId "}',                                                                                
[codeium]     exit = 0,                                                                                                                                                                                            
[codeium]     headers = { "Accept-Encoding: gzip", "Content-Type: application/json", "Vary: Origin", "Date: Tue, 28 Nov 2023 00:39:56 GMT", "Content-Length: 107", "", "" },                                       
[codeium]     status = 500                                                                                                                                                                                         
[codeium]   },                                                                                                                                                                                                     
[codeium]   status = 500                                                                                                                                                                                           
[codeium] } 
pqn commented 7 months ago

Are you able to share any big files in which this happens?

brunojoao commented 7 months ago

yes, an old legacy project, a php file with an array of 5 thousand lines for example. 293Kb file .php

module.config.php.tar.gz This happens for example when I click on "return" and remove a letter and try to add more, but in other smaller files this does not happen and works normally.

pqn commented 7 months ago

Thanks for the sample. I've just updated the extension with a newer language server version. Can you try again to see if the problem is still around? Also, in the original post, can you paste the full red error message? The yellow warning message is probably benign.

brunojoao commented 7 months ago

Yes, I updated bringing the full error.
image

I tried again with the last commit, but the error persists, maybe I have a wrong nvim-cmp configuration? the standard I found is the file size, unfortunately there are files with more than 5k lines in PHP.

this is my configuration nvim-cmp https://github.com/brunojoao/astronvim_monster/blob/main/plugins/nvim-cmp.lua

in small files works fine: image

after update i receive this error:

Error executing vim.schedule lua callback: .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/log.lua:166: /home/develop/.cache/nvim/codeium: É um diretório                                                      
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>                                                                                                                                                           
[codeium] [ERROR 22:23:58] /home/develop/.local/share/nvim/lazy/codeium.nvim/lua/codeium/notify.lua:14: completion request failed:  {                                                                              
[codeium]   code = 0,                                                                                                                                                                                              
[codeium]   out = '{"code":"unknown","message":"unable to get language from file: unrecognized language"}',                                                                                                        
[codeium]   response = {                                                                                                                                                                                           
[codeium]     body = '{"code":"unknown","message":"unable to get language from file: unrecognized language"}',                                                                                                     
[codeium]     exit = 0,                                                                                                                                                                                            
[codeium]     headers = { "Accept-Encoding: gzip", "Content-Type: application/json", "Vary: Origin", "Date: Tue, 28 Nov 2023 01:23:58 GMT", "Content-Length: 86", "", "" },                                        
[codeium]     status = 500                                                                                                                                                                                         
[codeium]   },                                                                                                                                                                                                     
[codeium]   status = 500                                                                                                                                                                                           
[codeium] }

... but my file is index.php, unrecognized

when stats nvim now:

[codeium] [DEBUG 23:01:31] /home/develop/.local/share/nvim/lazy/codeium.nvim/lua/codeium/api.lua:206: 19804: I1127 23:01:29.371191 19804 main.go:533] Starting language server manager with pid 19804              
Aperte ENTER ou digite um comando para continuar                                                                                                                                                                   
Error executing vim.schedule lua callback: .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/log.lua:166: /home/develop/.cache/nvim/codeium: É um diretório                                                      
stack traceback:                                                                                                                                                                                                   
        [C]: in function 'assert'                                                                                                                                                                                  
        .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/log.lua:166: in function 'debug'                                                                                                                       
        .../.local/share/nvim/lazy/codeium.nvim/lua/codeium/api.lua:206: in function ''                                                                                                                            
        vim/_editor.lua: in function <vim/_editor.lua:0>

astronvim / lubuntu 22.04

cleong14 commented 7 months ago

I'm also hitting the same Error executing vim.schedule lua callback: .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/log.lua:166: /path/to/.cache/nvim/codeium: It is a directory error.

I hit this error a few times in the past but the issue eventually resolved itself so I figured maybe it was just something with my setup.

I confirmed the bad commit is 1b87c86686fe65561cf993f9bb06dad3c56184e0 since rolling back to 822e762567a0bf50b1a4e733c8c93691934d7606 resolved the issues and I'm not hitting any errors anymore.

Hope this bit of context helps!

cleong14 commented 7 months ago

Also, in my particular case the issue was not dependent on whether the file was small or large; I would hit the error on every file regardless of size.

brunolpsousa commented 7 months ago

Is this the same bug as #20?

cleong14 commented 7 months ago

Is this the same bug as #20?

@brunolpsousa

Personally, I'd say the 2 bugs are not the same but I'm also not 100% sure.

Apologies, I wish I had a more helpful answer I could give you.

pqn commented 7 months ago

The original issue seems similar to #20. The issue that @cleong14 is encountering is #121. The issue that @brunojoao is encountering in https://github.com/Exafunction/codeium.nvim/issues/115#issuecomment-1828916083 after an upgrade is also #121. I will close this issue as a duplicate of #20. (We can continue the discussion there.)

pqn commented 7 months ago

Linking the directory issue fix here for convenience: https://github.com/Exafunction/codeium.nvim/issues/121#issuecomment-1832819652