neoclide/coc-tabnine

failed to install, at GetAddrInfoReqWrap.onlookup

jminh opened this issue · 9 comments

jminh commented

Hi,

I tried to use the ":CocInstall coc-tabnine" command to install this plugin and met following error

at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)

Seems like network issue. As for the network status, CocInstall works fine for other plugins like ":CocInstall coc-word" and My vim is also able to install tabnine-vim[1].

Do you have any suggestions?

[1] tabnine-vim: https://github.com/zxqfl/tabnine-vim

sQVe commented

@jminh Installs fine for me. Can you access/ping https://update.tabnine.com/version etc?

jminh commented

It cannot access.

ping https://update.tabnine.com/version
ping: cannot resolve https://update.tabnine.com/version: Unknown host

Any workaround? Like offline install?

BTW I tried this command on another machine (my home machine) and saw the same "cannot resolve" message but the browser can access this URL.

sQVe commented

@jminh That's the problem then. It had nothing to do with this plugin. Most likely something wrong with your network. Offline install is not possible.

Closing.

EDIT : I read your post a bit too quickly, apologies. I still do think this likely is some network issue on your end though. I would recommend you to try one of the other TabNine plugins available for Vim and see if they work. If they do, please let me know and I'll reopen this issue 👍

jminh commented

Hi @sQVe

I can successfully install tabnine-vim.

Plug 'zxqfl/tabnine-vim'

While running :PlugInstall in vim, it shows

tabnine-vim: Checking connectivity... done.

- Finishing ... Done!
- tabnine-vim: Already installed

Next, I type following string in a vim buffer

TabNine::version

It shows 2.1.22.

sQVe commented

@jminh Alright. That's strange. Can you provide the full error message you're getting, information about your system (OS, Arch etc) and what node version you're running?

jminh commented

Please see

node version

node --version
v10.16.0

OS

lsb_release -a
LSB Version:	:base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID:	CentOS
Description:	CentOS release 6.10 (Final)
Release:	6.10
Codename:	Final

:CocInfo

## versions

vim version: VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jan  5 2020 22:54:12)
node version: v10.16.0
coc.nvim version: 0.0.74-15f685206a
term: dumb
platform: linux

## Messages
Messages maintainer: Bram Moolenaar <Bram@vim.org>

:CocInstall coc-tabnine

at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)

:CocOpenLog

020-01-09T23:31:09.942 INFO (pid:30654) [plugin] - coc 0.0.74-15f685206a initialized with node: v10.16.0
2020-01-09T23:31:18.913 INFO (pid:30654) [model-extension] - Using npm from: /home/ming/nodejs/node-v10.16.0-linux-x64/bin/npm
2020-01-09T23:31:18.913 INFO (pid:30654) [model-extension] - Loading info of coc-tabnine.
2020-01-09T23:31:18.927 INFO (pid:30654) [model-fetch] - fetch: https://registry.npmjs.org/coc-tabnine
2020-01-09T23:31:19.050 INFO (pid:30654) [model-extension] - Downloading from https://registry.npmjs.org/coc-tabnine/-/coc-tabnine-1.2.2.tgz
2020-01-09T23:31:19.229 INFO (pid:30654) [model-extension] - Moving to new folder.
2020-01-09T23:31:19.248 INFO (pid:30654) [model-extension] - Installed extension: coc-tabnine
2020-01-09T23:31:19.287 INFO (pid:30654) [model-fetch] - fetch: https://update.tabnine.com/version
2020-01-09T23:31:19.318 ERROR (pid:30654) [extensions] - { Error: getaddrinfo ENOTFOUND update.tabnine.com update.tabnine.com:443
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)
  errno: 'ENOTFOUND',
  code: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: 'update.tabnine.com',
  host: 'update.tabnine.com',
  port: 443 }
sQVe commented

@jminh Thank you for providing detailed information. Your issue is very likely related to nodejs/node#5436. This is a glibc issue which node in turn uses. Could you possibly try to update glibc on your machine?

Also... what does your system output when running the below snippet through node?

const { parse } = require('url')
const https = require('https')

const TARGET_URL = 'https://update.tabnine.com/version'

const { hostname, protocol, path } = parse(TARGET_URL)

https
  .request(
    {
      method: 'GET',
      headers: {
        'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64)',
        'Accept-Encoding': 'gzip',
      },
      hostname,
      path,
      port: 443,
      protocol,
    },
    res => {
      const chunks = []

      res.on('data', chunk => chunks.push(chunk))
      res.on('end', () =>
        console.log(
          Buffer.concat(chunks)
            .toString()
            .trim()
        )
      )
    }
  )
  .end()

If if fails, could you try the following snippet instead (a possible workaround):

const { parse } = require('url')
const https = require('https')

const TARGET_URL = 'https://update.tabnine.com/version'

const { hostname, protocol, path } = parse(TARGET_URL)

https
  .request(
    {
      method: 'GET',
      family: 4,
      headers: {
        'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64)',
        'Accept-Encoding': 'gzip',
      },
      hostname,
      path,
      port: 443,
      protocol,
    },
    res => {
      const chunks = []

      res.on('data', chunk => chunks.push(chunk))
      res.on('end', () =>
        console.log(
          Buffer.concat(chunks)
            .toString()
            .trim()
        )
      )
    }
  )
  .end()
jminh commented

Could you possibly try to update glibc on your machine?

Updating glibc on centos 6 seems to be challenging. I will check if I can get a centos7 machine.

Following scripts were executed on centos 6 machine.

Output of snippet 1

events.js:174
      throw er; // Unhandled 'error' event
      ^

Error: getaddrinfo ENOTFOUND update.tabnine.com update.tabnine.com:443
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)
Emitted 'error' event at:
    at TLSSocket.socketErrorListener (_http_client.js:392:9)
    at TLSSocket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)

Output of snippet 2

events.js:174
      throw er; // Unhandled 'error' event
      ^

Error: getaddrinfo ENOTFOUND update.tabnine.com update.tabnine.com:443
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)
Emitted 'error' event at:
    at TLSSocket.socketErrorListener (_http_client.js:392:9)
    at TLSSocket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)
sQVe commented

@jminh Sadly this issue is not ours nor Nodes. You need to update glibc to solve the issue, or manually install TabNine and point this plugin to the binary.

Closing this issue.