Http request in drone are all connect timeout


#1

All http request in drone return connect timeout error, but git repo clone is ok. what should I do to fix it?

   + npm config set registry http://registry.npmjs.org/
    npm info it worked if it ends with ok
    npm info using npm@2.15.8
    npm info using node@v4.4.7
    npm info config set "registry" "http://registry.npmjs.org/"
    npm info ok 
    + npm install
    npm info it worked if it ends with ok
    npm info using npm@2.15.8
    npm info using node@v4.4.7
    npm info preinstall @q/qalarm@3.0.9
    npm info attempt registry request try #1 at 2:24:45 PM
    npm http request GET registry.npmjs.org/request-promise-native
    npm info attempt registry request try #1 at 2:24:45 PM
    npm http request GET registry.npmjs.org/request
    npm info attempt registry request try #1 at 2:24:45 PM
    npm http request GET registry.npmjs.org/thinkit
    npm info attempt registry request try #1 at 2:24:45 PM
    npm http request GET registry.npmjs.org/ava
    npm info attempt registry request try #1 at 2:24:45 PM
    npm http request GET registry.npmjs.org/babel-cli
    npm info attempt registry request try #1 at 2:24:45 PM
    npm http request GET registry.npmjs.org/babel-core
    npm info attempt registry request try #1 at 2:24:45 PM
    npm http request GET registry.npmjs.org/babel-preset-es2015
    npm info attempt registry request try #1 at 2:24:45 PM
    npm http request GET registry.npmjs.org/eslint
    npm info attempt registry request try #1 at 2:24:45 PM
    npm http request GET registry.npmjs.org/eslint-config-think
    npm info attempt registry request try #1 at 2:24:45 PM
    npm http request GET registry.npmjs.org/mock-require
    npm info attempt registry request try #1 at 2:24:45 PM
    npm http request GET registry.npmjs.org/nyc
    npm info attempt registry request try #1 at 2:24:45 PM
    npm http request GET registry.npmjs.org/moment
    npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT 151.101.0.162:80
    npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT 151.101.0.162:80
    npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT 151.101.0.162:80
    npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT 151.101.0.162:80
    npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT 151.101.0.162:80
    npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT 151.101.0.162:80
    npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT 151.101.0.162:80
    npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT 151.101.0.162:80
    npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT 151.101.0.162:80
    npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT 151.101.0.162:80
    npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT 151.101.0.162:80
    npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT 151.101.0.162:80

#2

If this is your yaml:

pipeline:
  build:
    image: node
    commands:
      - npm install
      - npm test

Drone translates this to the following docker command:

docker run node /bin/sh -c "npm install; npm test"

So to clarify, these are not ‘requests in drone’. These are requests inside a Docker container. Therefore, it might make sense to engage Docker support with this question, since this seems more like a generic Docker runtime question to me.

In this case, it looks like a problem with networking. Drone creates a user-defined network per-pipeline execution. I would recommend you test and verify that there are no issues with user-defined networks on your machines.


#3

@bradrydzewski thank you for your opinion, I think you are right. I’ll check docker node image why it happens.


#4

also if you are running behind a firewall you might need to provide drone with HTTPS_PROXY, HTTP_PROXY, NO_PROXY variables. That fact that you are seeing timeouts indicates a network issue. This is a common root cause.