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

Coc in infinite loop for installing extensions #1902

Closed
alecStewart1 opened this issue May 12, 2020 · 21 comments
Closed

Coc in infinite loop for installing extensions #1902

alecStewart1 opened this issue May 12, 2020 · 21 comments

Comments

@alecStewart1
Copy link

alecStewart1 commented May 12, 2020

Result from CocInfo

## versions

vim version: NVIM v0.5.0-504-g55b62a937
node version: v13.2.0
coc.nvim version: 0.0.78-3f305ac739
term: xterm-256color
platform: linux

Describe the bug

Upon opening any filetype (after the recent update) I've set coc to be used in, the window will split with the [Scratch] buffer with coc trying to install a couple of extensions. It tries to install coc-snippets and coc-elixir. I've even removed coc from the plugged directory and reinstalled and it does the same thing.

Reproduce the bug

  • Create file mini.vim with:

    set nocompatible
    filetype plugin indent on
    syntax on
    set hidden
    call plug#begin()
    Plug 'neoclide/coc.nvim', { 'branch': 'release',
      						\ 'for': ['c', 'cpp', 'crystal', 'd', 'elixir',
      						\ 'javascript', 'latex', 'nim', 'ruby', 'tex',
      						\ 'typescript', 'vim', 'vue'] }
    call plug#end()
    let g:coc_global_extensions=[ 'coc-yank', 'coc-snippets', 'coc-template',
      		\ 'coc-elixir', 'coc-solargraph', 'coc-texlab',
      		\ 'coc-tsserver', 'coc-vetur', 'coc-vimlsp',
      		\ ]
    " Don't even need to include this, just the coc_gloabl_extensions bit above will work too.
    " if textDocument.documentSymbol
    xmap if <Plug>(coc-funcobj-i)
    xmap af <Plug>(coc-funcobj-a)
    omap if <Plug>(coc-funcobj-i)
    omap af <Plug>(coc-funcobj-a)
    
    nmap <silent> <TAB> <Plug>(coc-range-select)
    xmap <silent> <TAB> <Plug>(coc-range-select)
    
    command! -nargs=0 Format :call CocAction('format')
    command! -nargs=? Fold   :call CocAction('fold', <f-args>)
    command! -nargs=0 OR     :call CocAction('runCommand', 'editor.action.organizeImport')
  • vim -u mini.vim mini.vim to edit the vim file (though any vim file, or file for any language in the Plug for statement works)

  • Operate vim.

  • Window will split with coc in a scratch buffer "installing" coc-snippets and coc-elixir

Screenshots

Screenshot with mini.vim above running vim -u mini.vim mini.vim

Screenshot with just using my personal config (opening the mini.vim)

EDIT:

From :CocOpenLog

2020-05-12T13:30:06.472 INFO (pid:6660) [services] - registered service "languageserver.ccls"
2020-05-12T13:30:06.474 INFO (pid:6660) [services] - registered service "languageserver.dls"
2020-05-12T13:30:06.474 INFO (pid:6660) [services] - registered service "languageserver.nimlsp"
2020-05-12T13:30:06.517 INFO (pid:6660) [model-extension] - Using npm from: /usr/bin/npm
2020-05-12T13:30:06.517 INFO (pid:6660) [model-extension] - Loading info of coc-snippets.
2020-05-12T13:30:06.522 INFO (pid:6660) [model-fetch] - fetch: https://registry.npmjs.org/coc-snippets
2020-05-12T13:30:06.537 INFO (pid:6660) [model-extension] - Using npm from: /usr/bin/npm
2020-05-12T13:30:06.537 INFO (pid:6660) [model-extension] - Loading info of coc-elixir.
2020-05-12T13:30:06.538 INFO (pid:6660) [model-fetch] - fetch: https://registry.npmjs.org/coc-elixir
2020-05-12T13:30:06.539 INFO (pid:6660) [plugin] - coc 0.0.78-3f305ac739 initialized with node: v13.2.0
2020-05-12T13:30:06.543 INFO (pid:6660) [services] - registered service "vimlsp"
2020-05-12T13:30:06.544 INFO (pid:6660) [services] - vim language server state change: stopped => starting
2020-05-12T13:30:06.550 INFO (pid:6660) [language-client-index] - vimlsp started with 6674
2020-05-12T13:30:06.708 INFO (pid:6660) [services] - vim language server state change: starting => running
2020-05-12T13:30:06.714 INFO (pid:6660) [services] - service vimlsp started
@fannheyward
Copy link
Member

2020-05-13 11 52 07

After installation finished, you will see this result. Can you get this? Looks like installations are failed. Doest ~/.config/coc/extensions/node_modules/coc-snippets/package.json exists?

@alecStewart1
Copy link
Author

I've let it run for about 10 minutes and nothing changed. ~/.config/coc/extensions/node_modules/coc-snippets doesn't exist.

For the hell of it I'll just remove ~/.config/coc and the extension in ~/.config/nvim/plugged to see if that changes anything.

@alecStewart1
Copy link
Author

alecStewart1 commented May 13, 2020

Removed both ~/.config/coc and ~/.config/nvim/plugged/coc.nvim and it's just failing to download anything now.

Running :CocInstall coc-[whatever] also is just in an infinite loop. It was working fine yesterday so I don't know what changed since then. I didn't change anything except for a remove some extensions from g:coc_global_extensions.

I added the coc-elixir extension and set where the language_server.sh file is in coc-settings.json with just "elixir.pathToElixirLS": "~/path/to/the/shellscript".

@chemzqm
Copy link
Member

chemzqm commented May 13, 2020

Try disable proxies from env or add "http.proxyStrictSSL": false in your coc-settings.json

@chemzqm chemzqm closed this as completed May 13, 2020
@alecStewart1
Copy link
Author

Fixes the issue of coc.nvim doing the auto install out the gate of opening the file, but it does not fix the issue of the infinite download.

Running :CocInstall coc-snippets show it changes nothing in that regard. It just sits on the download, again. I'll wait a bit to see if it actually downloads.

Screenshot of the coc-settings.json.

@alecStewart1
Copy link
Author

Nope. Been about 10 minutes since I started the download.

Nothing changed.

@doums
Copy link

doums commented May 13, 2020

Hi, I think I have the same problem, I try to install clangd: :CocInstall coc-clangd.
A window opens and almost instantly shows:

Install finished

- ✓ coc-clangd

But the extension is not installed (it's not present when I check with :CocInfo or :CocList extensions)

In the node_modules I just see a file -rw-r--r-- 1 pierre users 0 12.05.2020 01:34 coc-clangd.

## versions

vim version: NVIM v0.4.3
node version: v12.16.1
coc.nvim version: 0.0.78-0033e4e624
term: alacritty
platform: linux

## Output channel: Rust Analyzer Language Server Trace

"http.proxyStrictSSL": false changes nothing

@ronniedroid
Copy link

I have the same problem as above, I am also on Void linux like @The-BigDaddy

On a fresh Install, running :CocInstall coc-css or coc-css or anything keeps in downloading forever and never finishes. Please reopen the issue as it clearly is not fixed yet.

@alecStewart1
Copy link
Author

alecStewart1 commented May 13, 2020

@doums @ronniedroid

I'm thinking this is an NPM issue actually.

Complete reinstall node (and npm if your distro's package manager does not ship it with node), and try running npm i -g some-package.

For me, I got an error that said cb() never called. There are two issue open on npm/cli

1
2

Though, I would recommend you set some of the node/npm environment variables so you never have to run sudo with npm (it's stupid you even have to do that anyway).

POSIX Shell:

export XDG_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_RUNTIME_DIR="$HOME/.runtime"
export NPM_PACKAGES="$XDG_DATA_HOME/npm-packages"
export NODE_PATH="$NPM_PACKAGES/lib/node_modules"
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc"

Fish Shell:

set -x XDG_CONFIG_HOME "$HOME/.config"
set -x XDG_CACHE_HOME "$HOME/.cache"
set -x XDG_DATA_HOME "$HOME/.local/share"
set -x XDG_RUNTIME_DIR "$HOME/.runtime"
set -x NPM_PACKAGES "$XDG_DATA_HOME/npm-packages"
set -x NODE_PATH "$NPM_PACKAGES/lib/node_modules"
set -x NPM_CONFIG_USERCONFIG "$XDG_CONFIG_HOME/npm/npmrc"

The log with the error I get (the log is in ~/.npm/_logs/some-stupidly-formatted-timestamp-debug.log):

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'i', '-g', 'pnpm' ]
2 info using npm@6.13.1
3 info using node@v13.2.0
4 verbose npm-session deeed2eecd352040
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 timing npm Completed in 715ms
8 error cb() never called!
9 error This is an error with npm itself. Please report this error at:
10 error <https://npm.community>

If you both get the same issue, then it is now justifiable that this issue is closed.

@doums
Copy link

doums commented May 13, 2020

In doubt I updated my node version to the latest current v14.2.0 and npm after that, 6.14.5.
After a reboot (just in case), I retried :CocInstall coc-clangd. Nothing change.
No error in npm logs like you have posted @The-BigDaddy.
So no, it's not the same error. And I'm agree with @ronniedroid, the issue is still here. Why keep it closed ??

@ronniedroid
Copy link

It's bugling my mind, I installed coc.nvim on my work computer today, on a void Linux installation that is exactly the same as my home computer, and it worked fine, but it won't work in my home computer.

@alecStewart1
Copy link
Author

@chemzqm this issue seems to not be fixed. Please reopen the issue.

@fannheyward
Copy link
Member

Try npm cache clean and run CocInstall again.

@chemzqm chemzqm reopened this May 14, 2020
@alecStewart1
Copy link
Author

@fannheyward that changes nothing in the context of npm itself. npm cache clean --force does not change the result of running into this issue of cb() never called, and does not change this infinite download problem I'm having.

@chemzqm
Copy link
Member

chemzqm commented May 14, 2020

@daern91 please provide the log opened by :CocOpenLog

@chemzqm
Copy link
Member

chemzqm commented May 14, 2020

Apparently you network get blocked when requesting https://registry.npmjs.org/coc-snippets

@doums
Copy link

doums commented May 14, 2020

Running myself npm i coc-clangd in ~/.config/coc/extensions solves the problem.

@alecStewart1
Copy link
Author

Fixes with updating Void Linux's version of Node. *Sighhhhh*

@ronniedroid
Copy link

Same thing, got fixed after updating the Node version after running `xbps-install -Su' thank you very much.

@fannheyward
Copy link
Member

@The-BigDaddy @ronniedroid what's the wrong node version when you occur this issue?

@chemzqm
Copy link
Member

chemzqm commented May 16, 2020

Should be network issue.

On master branch, I've add timeout support and new UI for extension install status, check messages in window or check the log by :CocOpenlog

@chemzqm chemzqm closed this as completed May 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants