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

Unable to register against the Forest Admin server: Socket connection timeout. #601

Open
mminklet opened this issue Jun 7, 2023 · 10 comments

Comments

@mminklet
Copy link

mminklet commented Jun 7, 2023

Trying to use forest login but immediately receive this message. Can't get any further details as there doesn't appear to be a verbose flag. CLI is the latest version. Tried different networks

On MacOS 12.6.6, using version
forest-cli/3.4.2 darwin-x64 node-v20.2.0

× Unable to register against the Forest Admin server: Socket connection timeout.

@mminklet
Copy link
Author

mminklet commented Jun 7, 2023

This is the output of NODE_DEBUG. Don't really see anything unusual when compared to my colleagues

HTTP 8414: call onSocket 0 0
HTTP 8414: createConnection api.forestadmin.com:443::::::::::::::::::::: [Object: null prototype] {
  protocol: 'https:',
  hostname: 'api.forestadmin.com',
  hash: '',
  search: '',
  pathname: '/oidc/.well-known/openid-configuration',
  path: null,
  href: 'https://api.forestadmin.com/oidc/.well-known/openid-configuration',
  method: 'GET',
  retry: {
    calculateDelay: [Function: calculateDelay],
    limit: 0,
    methods: [ 'GET', 'PUT', 'HEAD', 'DELETE', 'OPTIONS', 'TRACE' ],
    statusCodes: [
      408, 413, 429, 500,
      502, 503, 504, 521,
      522, 524
    ],
    errorCodes: [
      'ETIMEDOUT',
      'ECONNRESET',
      'EADDRINUSE',
      'ECONNREFUSED',
      'EPIPE',
      'ENOTFOUND',
      'ENETUNREACH',
      'EAI_AGAIN'
    ],
    maxRetryAfter: Infinity
  },
  headers: {
    'user-agent': 'openid-client/4.2.2 (https://github.com/panva/node-openid-client)',
    accept: 'application/json',
    'accept-encoding': 'gzip, deflate, br'
  },
  hooks: {
    init: [],
    beforeRequest: [],
    beforeRedirect: [],
    beforeRetry: [],
    beforeError: [],
    afterResponse: []
  },
  cache: undefined,
  dnsCache: undefined,
  decompress: true,
  throwHttpErrors: false,
  followRedirect: false,
  isStream: false,
  responseType: 'json',
  resolveBodyOnly: false,
  maxRedirects: 10,
  prefixUrl: '',
  methodRewriting: true,
  ignoreInvalidCookies: false,
  http2: false,
  allowGetBody: false,
  https: undefined,
  pagination: {
    transform: [Function: transform],
    paginate: [Function: paginate],
    filter: [Function: filter],
    shouldContinue: [Function: shouldContinue],
    countLimit: Infinity,
    backoff: 0,
    requestLimit: 10000,
    stackAllItems: true
  },
  parseJson: [Function: parseJson],
  stringifyJson: [Function: stringifyJson],
  cacheOptions: {},
  username: '',
  password: '',
  url: URL {
    href: 'https://api.forestadmin.com/oidc/.well-known/openid-configuration',
    origin: 'https://api.forestadmin.com',
    protocol: 'https:',
    username: '',
    password: '',
    host: 'api.forestadmin.com',
    hostname: 'api.forestadmin.com',
    port: '',
    pathname: '/oidc/.well-known/openid-configuration',
    search: '',
    searchParams: URLSearchParams {},
    hash: ''
  },
  shared: undefined,
  cacheHeuristic: undefined,
  immutableMinTimeToLive: undefined,
  ignoreCargoCult: undefined,
  _defaultAgent: Agent {
    _events: [Object: null prototype] {
      free: [Function (anonymous)],
      newListener: [Function: maybeEnableKeylog]
    },
    _eventsCount: 2,
    _maxListeners: undefined,
    defaultPort: 443,
    protocol: 'https:',
    options: [Object: null prototype] {
      keepAlive: true,
      scheduling: 'lifo',
      timeout: 5000,
      noDelay: true,
      path: null
    },
    requests: [Object: null prototype] {},
    sockets: [Object: null prototype] {
      'api.forestadmin.com:443:::::::::::::::::::::': []
    },
    freeSockets: [Object: null prototype] {},
    keepAliveMsecs: 1000,
    keepAlive: true,
    maxSockets: Infinity,
    maxFreeSockets: 256,
    scheduling: 'lifo',
    maxTotalSockets: Infinity,
    totalSocketCount: 0,
    maxCachedSessions: 100,
    _sessionCache: { map: {}, list: [] },
    [Symbol(kCapture)]: false
  },
  port: 443,
  host: 'api.forestadmin.com',
  keepAlive: true,
  scheduling: 'lifo',
  timeout: 5000,
  noDelay: true,
  servername: 'api.forestadmin.com',
  _agentKey: 'api.forestadmin.com:443:::::::::::::::::::::',
  [Symbol(isNormalizedAlready)]: true,
  [Symbol(request)]: [Function: request]
}
TLS 8414: client _init handle? true
NET 8414: pipe false null
NET 8414: connect: find host api.forestadmin.com
NET 8414: connect: dns options { family: undefined, hints: 1024 }
NET 8414: connect: autodetecting
HTTP 8414: sockets api.forestadmin.com:443::::::::::::::::::::: 1 1
HTTP 8414: outgoing message end.
(node:8414) Warning: Setting the NODE_DEBUG environment variable to 'http' can expose sensitive data (such as passwords, tokens and authentication headers) in the resulting log.
(Use `node --trace-warnings ...` to show where the warning was created)
TLS 8414: client initRead handle? true buffered? false
NET 8414: _read - n 16384 isConnecting? true hasHandle? true
NET 8414: _read wait for connection
NET 8414: connect/multiple: will try the following addresses [
  { address: '54.73.26.109', family: 4 },
  { address: '108.128.72.146', family: 4 },
  { address: '54.216.252.255', family: 4 }
]
NET 8414: connect/multiple: attempting to connect to 54.73.26.109:443 (addressType: 4)
NET 8414: connect/multiple: attempting to connect to 108.128.72.146:443 (addressType: 4)
NET 8414: connect/multiple: ignoring successful but timedout connection to 54.73.26.109:443
NET 8414: connect/multiple: attempting to connect to 54.216.252.255:443 (addressType: 4)
NET 8414: connect/multiple: ignoring successful but timedout connection to 108.128.72.146:443
NET 8414: destroy
NET 8414: close
NET 8414: close handle
HTTP 8414: SOCKET ERROR: Socket connection timeout Error [ERR_SOCKET_CONNECTION_TIMEOUT]: Socket connection timeout
    at new NodeError (node:internal/errors:399:5)
    at internalConnectMultiple (node:net:1099:20)
    at Timeout.internalConnectMultipleTimeout (node:net:1638:3)
    at listOnTimeout (node:internal/timers:575:11)
    at process.processTimers (node:internal/timers:514:7)
× Unable to register against the Forest Admin server: Socket connection timeout.

@mminklet
Copy link
Author

mminklet commented Jun 7, 2023

I have no VPN, I have changed the DNS to use googles (8.8.8.8), used a tethered mobile network. I've also downgraded to versions that my colleagues are using.

I have pinged all 3 IP addresses listed above that it is trying to connect to and they all respond

@arnaudbesnier
Copy link
Member

Hi @mminklet,

Before digging into this error, it could be interesting to know if the latest beta version has the same issue.

We are working on a version 4 of the toolbelt v4 that drops the support of Node 10-11-12-13 and probably provides better support for Node 20 (according to our automated tests base).

A pre-release is available via a first beta version (v4.0.0-beta.1).

You can install it:

Let me know if it helps.

@mminklet
Copy link
Author

mminklet commented Jun 9, 2023

I solved this by downgrading node to 18. The latest version of node does not work with this package

@arnaudbesnier
Copy link
Member

arnaudbesnier commented Jun 9, 2023

The latest version of node does not work with this package

You could be right for the toolbelt v3 you are currently using, as it as not be tested on Node 20.

That being said, with the toolbelt v4.0.0.beta.1, we added Node 20 to our automated test base, and all tests are green.
That’s why I suggested to test this latest version.

@mminklet
Copy link
Author

Could you update the engine in the package.json to limit the cli to node versions that it does work on?

@arnaudbesnier
Copy link
Member

arnaudbesnier commented Jun 14, 2023

Using the toolbelt v3.4.3 and Node 20.2.0, the login command works as expected on my end.

Screenshot 2023-06-14 at 10 42 15

So I would not say that the toolbelt v3 is incompatible with Node 20 based on my own experience.
I don’t think we should restrict the toolbelt usage.

@mminklet
Copy link
Author

Which OS are you on? I still get it. 20.3.0 works, but 20.2.0 will not

image

@arnaudbesnier
Copy link
Member

MacOS v13.2

Screenshot 2023-06-15 at 09 14 31

@arnaudbesnier
Copy link
Member

Hi @mminklet,
For your information, we officially released the toolbelt v4.0.0.

You can upgrade with the following command line: npm install -g forest-cli@latest
Please let us know if this version is still not compatible with the specific Node version 20.2.0.

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

2 participants