Skip to content

Plenary curl error when laptop loses Internet connectionΒ #484

@jaywonchung

Description

@jaywonchung

I typically leave my Neovim & terminal open and close my MacBook and move around, at which point the laptop loses Internet connection. After that, I often see errors like this on my Neovim instance when I re-open my laptop:

Error executing callback:
....local/share/nvim/lazy/plenary.nvim/lua/plenary/curl.lua:310: get https://api.github.com/copilot_internal/v2/token - curl error exit_code=28 stderr={ "curl: (28) Failed to connect to api.github.com port 443 after 960094 ms: Timeout was reached" }
stack traceback:
        [C]: in function 'error'
        ....local/share/nvim/lazy/plenary.nvim/lua/plenary/curl.lua:310: 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.nvim/lua/plenary/job.lua:39>

Another variant is:

Error executing callback:
....local/share/nvim/lazy/plenary.nvim/lua/plenary/curl.lua:310: get https://api.github.com/copilot_internal/v2/token - curl error exit_code=6 stderr={ "curl: (6) Could not resolve host: api.github.com" }
stack traceback:
        [C]: in function 'error'
        ....local/share/nvim/lazy/plenary.nvim/lua/plenary/curl.lua:310: 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.nvim/lua/plenary/job.lua:39>

While the error message is from plenary, I thought this might be some kind of periodic token refreshment by copilot that fails when there's no Internet connection. If periodic token refreshment is needed, I think a better way is to print a message and disable copilot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions