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

Log and error spamming when language server binary is unavailable "Codeium server crashed" 127 (nixos) #288

Open
clorl opened this issue Mar 23, 2025 · 0 comments

Comments

@clorl
Copy link

clorl commented Mar 23, 2025

These are two related bugs

  1. Every few seconds I get a lua error that I fixed. It points to codeium/api.lua::255 trying to concat a null value "v".
		local function on_output(_, v, j)
			log.debug(j.pid .. ": " .. v)
		end

I fixed it with the following snippet which checks if v is nil

		local function on_output(_, v, j)
			log.debug(j.pid .. ": " .. (v and v or ""))
		end
  1. I'm running NixOS and after authing successfully and fixing the aforementioned bug I spammed with this type of log
~/.local/share/nvim/lazy/codeium.nvim/lua/codeium/notify.lua:14: codeium server crashed:  {
  code = 127
}

Which indicates codeium tries to run a binary that isn't found.

Reproducing steps

  1. Install nvim + codeium NixOs (or any system that will prevent running downloaded executables)
  2. Start codeium
  3. Enter insert mode
  4. Chaos

Solutions :

  1. Add config opts for number of restart attempts and debounce time. A plugin should never spam logs even on fail.
  2. Don't use vim.notify to notify similar logs in a row. Print the first one and then defer it to the logs file
  3. Add a more useful error message for error code 127
  4. Add a portion in the readme for nixos users and to explain that you're downloading/using this binary in the background if it is something that is done
  5. I also added this snippet as a quick workaround to the plugin's config
  -- enabled = function()
  --   return vim.fn.executable("codeium") == 1
  -- end,

Environment info

Plugin version

        branch main
        commit 2b10c17

Plugin config

{
  "Exafunction/codeium.nvim",
  cmd = "Codeium",
  event = "InsertEnter",
  build = ":Codeium Auth",
  dependencies = {
        "nvim-lua/plenary.nvim",
        -- I'm using blink.cmp in impersonation mode
  },
  opts = {
    enable_cmp_source = true,
    virtual_text = {
      enabled = true,
      key_bindings = {
        accept = "<C-enter>",
        next = "<M-]>",
        prev = "<M-[>",
      },
    },
  },
}

Lazy.nvim

- {lazy.nvim} version `11.17.1`
- OK {git} `version 2.47.0`

List of plugins
  Loaded (15)
    ● blink.cmp 21.03ms  nvim-lspconfig
    ● blink.compat 1.93ms  blink.cmp
    ● blink.compat 1.93ms  blink.cmp
    ● lazy.nvim 23.46ms  init.lua
    ● mason-lspconfig.nvim 0.3ms  mason.nvim
    ● mason-nvim-dap.nvim 0.31ms  mason.nvim
    ● mason-tool-installer.nvim 5.61ms  mason.nvim
    ● mason.nvim 53.88ms  start
    ● nvim-dap 0.68ms 󰢱 dap.ext.vscode  mason.nvim
    ● nvim-lspconfig 25.6ms  mason.nvim
    ● nvim-treesitter 13.93ms  start
    ● oil.nvim 8.79ms  start
    ● snacks.nvim 2.66ms  start
    ● vim-sleuth 0.7ms  start
    ● which-key.nvim 1.95ms  VeryLazy

  Not Loaded (24)
    ○ conform.nvim  BufWritePre  <leader>cf  ConformInfo 
    ○ lazydev.nvim  lua 

Neovim

NVIM v0.10.3
Build type: Release
LuaJIT 2.1.1713773202
Run "nvim -V1 -v" for more info

NixOs 25.05 with a flake-based system configuration

BUG_REPORT_URL="https://github.com/NixOS/nixpkgs/issues"
BUILD_ID="25.05.20250104.8f3e1f8"
CPE_NAME="cpe:/o:nixos:nixos:25.05"
DEFAULT_HOSTNAME=nixos
DOCUMENTATION_URL="https://nixos.org/learn.html"
HOME_URL="https://nixos.org/"
ID=nixos
ID_LIKE=""
IMAGE_ID=""
IMAGE_VERSION=""
LOGO="nix-snowflake"
NAME=NixOS
PRETTY_NAME="NixOS 25.05 (Warbler)"
SUPPORT_URL="https://nixos.org/community.html"
VARIANT=""
VARIANT_ID=""
VENDOR_NAME=NixOS
VENDOR_URL="https://nixos.org/"
VERSION="25.05 (Warbler)"
VERSION_CODENAME=warbler
VERSION_ID="25.05"```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant