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

Cannot install extensions. #2127

Closed
JSamir opened this issue Jun 30, 2020 · 6 comments
Closed

Cannot install extensions. #2127

JSamir opened this issue Jun 30, 2020 · 6 comments

Comments

@JSamir
Copy link

JSamir commented Jun 30, 2020

Result from CocInfo

versions

vim version: NVIM v0.5.0-579-g1920ba4b5
node version: v14.4.0
coc.nvim version: 0.0.78-55ff49c9b7
coc.nvim directory: /home/samir/.local/share/nvim/plugged/coc.nvim
term: st-256color
platform: linux

Describe the bug

If I try to install a new extension with CocInstall coc-java i get following message in new buffer (using mini.vim):

Install finished
- ✗ coc-java getaddrinfo EAI_AGAIN registry.npmjs.org

Navigating to the second line gives a modal with following message:

Using npm from: /usr/bin/npm
Get info from https://registry.npmjs.org/
getaddrinfo EAI_AGAIN registry.npmjs.org

CocOpenLog:

2020-06-30T23:43:04.922 INFO (pid:9079) [services] - registered service "languageserver.bash"
2020-06-30T23:43:04.924 INFO (pid:9079) [services] - registered service "languageserver.dockerfile"
2020-06-30T23:43:04.924 INFO (pid:9079) [services] - registered service "languageserver.groovy"
2020-06-30T23:43:04.926 INFO (pid:9079) [plugin] - coc.nvim 0.0.78-55ff49c9b7 initialized with node: v14.4.0 after 45ms
2020-06-30T23:43:29.652 INFO (pid:9079) [model-installer] - Using npm from: /usr/bin/npm 
2020-06-30T23:43:29.656 INFO (pid:9079) [model-installer] - Get info from https://registry.npmjs.org/ 
2020-06-30T23:43:29.921 ERROR (pid:9079) [model-fetch] - Fetch error for https://registry.npmjs.org/coc-java: {
  method: 'GET',
  hostname: 'registry.npmjs.org',
  port: 443,
  path: '/coc-java',
  agent: null,
  rejectUnauthorized: false,
  maxRedirects: 3,
  headers: {
    'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64)',
    'Accept-Encoding': 'gzip, deflate'
  },
  timeout: 10000
} Error: getaddrinfo EAI_AGAIN registry.npmjs.org
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) {
  errno: -3001,
  code: 'EAI_AGAIN',
  syscall: 'getaddrinfo',
  hostname: 'registry.npmjs.org'
}
2020-06-30T23:43:29.924 ERROR (pid:9079) [extensions] - Error on install coc-java Error: getaddrinfo EAI_AGAIN registry.npmjs.org
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) {
  errno: -3001,
  code: 'EAI_AGAIN',
  syscall: 'getaddrinfo',
  hostname: 'registry.npmjs.org'
}

I am not sure since when this bug appeared. It could be after I removed/reinstalled node/npm (ubuntu 20.04). It seems to be related to the network, but npm install works fine (I am behind corporate proxy with proxy configured), for example npm install -g neovim.

I have already reinstalled coc.nvim, node/npm. I tried removing everything node related to have a fresh installation, did not help.

Since I have this problem only with coc, but (apparently) not with node in general (or any other neovim plugins), I kindly ask if you have an idea what I could look at to tackle this issue.

Reproduce the bug

Since it did work some time ago, I am pretty sure this is not reproducible for others. I must have screwed something up.

@fannheyward
Copy link
Member

EAI_AGAIN is a DNS lookup error. Can your dig registry.npmjs.org or ping registry.npmjs.org works?

@JSamir
Copy link
Author

JSamir commented Jul 1, 2020

They both don't work. As I understand it dig does not work if you are behind a proxy (which I am).
dig:

❯ dig registry.npmjs.org

; <<>> DiG 9.16.1-Ubuntu <<>> registry.npmjs.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 13387
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;registry.npmjs.org.            IN      A

;; Query time: 175 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Wed Jul 01 04:03:33 CEST 2020
;; MSG SIZE  rcvd: 47

ping:

❯ ping registry.npmjs.org
ping: registry.npmjs.org: Temporary failure in name resolution

If anything node-related would not work I would kind of understand it, but as of now I only have problems while installing coc extensions.

Installing node neovim provider (npm install -g neovim) uses the same mechanism as coc does for the installation of the extensions right? If yes, why does it work for npm at all if it is a general issue with dns?

@fannheyward
Copy link
Member

CocInstall will fetch extension package from registry.npmjs.org, this is why it failed for you.

You can use vim-plug to install extensions: https://github.com/neoclide/coc.nvim/wiki/Using-coc-extensions#use-vims-plugin-manager-for-coc-extension

Plug 'neoclide/coc-java', {'do': 'yarn install --frozen-lockfile'}

@JSamir
Copy link
Author

JSamir commented Oct 30, 2020

@fannheyward

I still have this issue, even in a freshly installed VM. I still use a proxy, but that is not an issue in any other apps.

Please note that in the last answer I mentioned that npm itself has no problems, only while issuing CocUpdate it does not work. It is still the same.

Details:
Through some other script I got some coc extensions installed in the folder ~/.config/coc/extensions. I removed that plugin but it left the extensions there. So when I use CocUpdate, it tries to update those extensions, but fails with a timeout (that's how I discovered it by accident).

If I navigate to this directory and try to update this extensions with npm update, it works. Installing new extensions works too. So for me this does look like a Coc issue.

The error has changed (as I said I have a new VM now), for example CocInstall coc-html:

Install finished

- ✗ coc-html Request timeout after 10000ms

If I hover over the last line:

Using npm from: /usr/bin/npm
Get info from https://registry.npmjs.org/
Request timeout after 10000ms

CocInfo:

## versions
   
   vim version: NVIM v0.5.0-784-gc6ccdda26
   node version: v15.0.1
   coc.nvim version: 0.0.79-8230b63641
   coc.nvim directory: /home/samir/.local/share/nvim/plugged/coc.nvim
   term: alacritty
   platform: linux
   
   ## Log of coc.nvim
   
   2020-10-30T15:18:07.893 INFO (pid:164383) [services] - registered service "languageserver.bash"
   2020-10-30T15:18:07.895 INFO (pid:164383) [services] - registered service "languageserver.dockerfile"
   2020-10-30T15:18:07.895 INFO (pid:164383) [services] - registered service "languageserver.groovy"
   2020-10-30T15:18:07.971 INFO (pid:164383) [services] - registered service "highlight"
   2020-10-30T15:18:07.983 INFO (pid:164383) [language-client-index] - highlight started with 164396
   2020-10-30T15:18:08.010 INFO (pid:164383) [plugin] - coc.nvim 0.0.79-8230b63641 initialized with node: v15.0.1 after 247ms
   2020-10-30T15:18:27.257 INFO (pid:164383) [model-installer] - Using npm from: /usr/bin/npm
   2020-10-30T15:18:27.260 INFO (pid:164383) [model-installer] - Get info from https://registry.npmjs.org/
   2020-10-30T15:18:37.285 ERROR (pid:164383) [model-fetch] - Fetch error for https://registry.npmjs.org/coc-html: {
     method: 'GET',
     hostname: 'registry.npmjs.org',
     port: 443,
     path: '/coc-html',
     agent: null,
     rejectUnauthorized: false,
     maxRedirects: 3,
     headers: {
       'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64)',
       'Accept-Encoding': 'gzip, deflate',
       'Proxy-Authorization': null
     },
     timeout: 10000
   } Error: Request timeout after 10000ms
       at RedirectableRequest.<anonymous> (/home/samir/.local/share/nvim/plugged/coc.nvim/build/index.js:69706:25)
       at RedirectableRequest.emit (node:events:327:20)
       at Timeout._onTimeout (/home/samir/.local/share/nvim/plugged/coc.nvim/build/index.js:47738:13)
       at listOnTimeout (node:internal/timers:555:17)
       at processTimers (node:internal/timers:498:7)
  2020-10-30T15:18:37.286 ERROR (pid:164383) [extensions] - Error on install coc-html Error: Request timeout after 10000ms
       at RedirectableRequest.<anonymous> (/home/samir/.local/share/nvim/plugged/coc.nvim/build/index.js:69706:25)
       at RedirectableRequest.emit (node:events:327:20)
       at Timeout._onTimeout (/home/samir/.local/share/nvim/plugged/coc.nvim/build/index.js:47738:13)
       at listOnTimeout (node:internal/timers:555:17)
       at processTimers (node:internal/timers:498:7)

With npm it works:

❯ npm install coc-html
npm WARN extensions No description
npm WARN extensions No repository field.
npm WARN extensions No license field.

+ [email protected]
added 2 packages from 2 contributors and audited 42 packages in 4.825s
found 0 vulnerabilities

Can you have a look at this?

@Th3FirstAvenger
Copy link

Th3FirstAvenger commented May 18, 2021

I had the same problem and just adding the manual ip worked for me.

Try with that:

echo "104.16.17.35\tregistry.npmjs.org" >> /etc/hosts

And then try to install again.

@JohanChane
Copy link

JohanChane commented Nov 11, 2022

You can use other registries according to :h coc-extensions-npm:

To customize npm registry for coc.nvim add coc.nvim:registry in your
~/.npmrc, like:

coc.nvim:registry=https://registry.mycompany.org/

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

4 participants