'npm install' always runs into ERR_SOCKET_TIMEOUT

I have a simple drone pipeline that unfortunately always runs into ERR_SOCKET_TIMEOUT.

pipeline:

type: docker
kind: pipeline
name: pre merge checks

clone:
  disable: true

steps:
- name: clone
  image: xxx/ci/git:latest
  commands:
  - git clone http://xxx/xxx/xxx.git .
  - git checkout $DRONE_COMMIT

- name: install agent
  image: node:16
  commands:
  - npm install

result is always after some packages:

npm install
npm WARN deprecated [email protected]: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
npm ERR! code ERR_SOCKET_TIMEOUT
npm ERR! network Socket timeout
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-11-10T08_05_06_720Z-debug-0.log

I’m now behind a proxy.
This happens with registry.npmjs.org as my registry set.

also npm set timeout=240000 did not help.

I even tried with verdaccio as self-hosted registry with cache enabled. Also timeouts.
If i run npm install in this repo on the host machine itself, it works fine.

Is this a drone or docker setting maybe? Thanks in advance
On any other client in my network no matter what os, i can install without any issue.

Hello @TautFlorian

When you say “I’m now behind a proxy.”, does that mean you recently added a proxy? Have you verified that other traffic out to the internet is working?

My first thought is you might need to explicitly set proxy settings in your install step.

Im sorry. That was a typo, i meant i’m not behind a proxy.

Ah I see.

My next guess would be something to do with DNS resolution. In your clone step, is http://xxx/xxx/xxx.git an internal endpoint? Is it using an IP or hostname? Depending on whether that address is internal or external, it could be a clue.

Can you try running a different command that uses networking in the “install agent” step? The node:16 image is based on debian, can you try running apt-get update?

Could it be related to seccomp - see 20.04 vs. 22.04 inside docker, with a 16.04 host == thread start failures? - Ask Ubuntu?