pre-commit-ci / issues

public issues for https://pre-commit.ci
17 stars 3 forks source link

failure: failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org #55

Closed ssbarnea closed 3 years ago

ssbarnea commented 3 years ago

While pre-commit runs locally just fine, it seem that on pre-commit.ci we get errors like: https://results.pre-commit.ci/run/github/325286676/1618825991.fIk4sg8rSYWVVJC29fL5lg

?25hnpm ERR! code EAI_AGAIN
npm ERR! errno EAI_AGAIN
npm ERR! request to https://registry.npmjs.org/eslint/-/eslint-7.20.0.tgz failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org

npm ERR! A complete log of this run can be found in:
npm ERR!     /tmp/npm/_logs/2021-04-19T09_53_25_056Z-debug.lo

Apparently that may be related to the docker containers being used during testing.

asottile commented 3 years ago

this is intentional, network is not allowed at runtime (for now, it may be allowed in the future in paid tiers) as it is prone to abuse

you can skip that hook using ci: skip: ...: https://pre-commit.ci/#configuration-skip

ssbarnea commented 3 years ago

Thanks for clarifying it. As crippling CI is out of question, I removed use of pre-commit.ci and switched to old manual running of pre-commit tool, which is not affected by this limitation.

One interesting thing is that I observed that executions randomly fail with above error, is not as if all executions will fail due to not having network access. That means that only some containers are secured and others are not.

asottile commented 3 years ago

can you show examples? all runs run with the same configuration

asottile commented 3 years ago

@ssbarnea by the way your commit message is misleading, eslint is fine -- it's your hook which runs npm ci as a side-effect (which I'd argue isn't a good fit for pre-commit anyway)

asottile commented 3 years ago

I see why it's flakey -- you literally just added the bad check: https://github.com/ansible-community/vscode-ansible/pull/73 (meaning some of your executions were out-of-date with master)