Bitbucket Pipelines banned from packages.npmjs.org by Cloudflare

Issue #16373 resolved
Martin Vandersteen created an issue

An issue has been opened at NPM's repo

It looks like Bitbucket Pipelines is banned from downloading packages at packages.npmjs.org. Pipelines containing npm install commands will therefore fail most of the time.

Link to a gist to the complete error message in Pipeline logs

Comments (15)

  1. Martin Vandersteen reporter

    Something that was said in the Github issue is that you could just setup a Verdaccio proxy for NPM. It's pretty easy to do and you just have to add a "npm set registry <host>" command to your pipelines. You need a server for that though, but in case of great disturbance, that is what I would do.

  2. Rachael Ludwick

    Not a great immediate workaround but that looks pretty interesting (and there's k8s support which is convenient for us.) Thanks for the link!

  3. Jeroen De Raedt staff

    It looks like npm had issues with their rate limiting. We got in touch with them and they whitelisted our IP ranges, so normally your builds should be working again.

  4. Martin Vandersteen reporter

    Jeroen De Raedt - "It looks like npm had issues with their rate limiting. We got in touch with them and they whitelisted our IP ranges, so normally your builds should be working again."

  5. Swarup Donepudi

    This is not resolved. My builds keep failing sporadically with the below error.

    npm ERR! code E404
    npm ERR! 404 Not Found: @types/node@9.4.2
    
  6. Jeroen De Raedt staff

    Hi @cfc-swarupdonepudi,

    You can also get this error if the referenced library does not exist on the registry you are authenticated with. Could you check if that might be the case?

  7. Fernando Buccella

    @jeroendr I'm getting 404 and the packages exist because I can run npm install locally with the same node version. There's been some days now so this is quite annoying. I'd say this ticket shouldn't be marked as resolved.

  8. Jeroen De Raedt staff

    Hey @buccfer, we haven't got any reports about npm blockages. Which package are you trying to access? Could you provide the error that you get in the logs?

  9. Fernando Buccella

    @jeroendr

    Error log:

    + npm install
    npm WARN tar ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/is-ci-4260e694/package.json'
    npm WARN tar ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/kind-of-67f9f10b/package.json'
    npm WARN tar ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/is-builtin-module-dc04b2ae/package.json'
    npm WARN tar ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/is-ci-4260e694/bin.js'
    npm WARN tar ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/kind-of-67f9f10b/README.md'
    npm WARN tar ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/is-accessor-descriptor-6b3c5167/package.json'
    npm WARN tar ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/is-callable-b108a571/package.json'
    npm WARN tar ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/is-builtin-module-dc04b2ae/index.js'
    npm WARN tar ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/is-ci-4260e694/index.js'
    npm WARN tar ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/kind-of-67f9f10b/LICENSE'
    npm WARN tar ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/is-accessor-descriptor-6b3c5167/README.md'
    npm WARN tar ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/is-callable-b108a571/.editorconfig'
    npm WARN tar ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/is-builtin-module-dc04b2ae/license'
    npm WARN tar ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/is-ci-4260e694/LICENSE'
    npm WARN tar ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/kind-of-67f9f10b/index.js'
    npm WARN tar ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/is-accessor-descriptor-6b3c5167/LICENSE'
    npm WARN tar ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/is-callable-b108a571/.eslintrc'
    npm WARN tar ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/is-builtin-module-dc04b2ae/readme.md'
    npm WARN tar ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/is-ci-4260e694/README.md'
    npm WARN tar ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/is-accessor-descriptor-6b3c5167/index.js'
    npm WARN tar ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/is-callable-b108a571/.istanbul.yml'
    npm WARN tar ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/is-callable-b108a571/.jscs.json'
    npm WARN tar ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/is-callable-b108a571/.travis.yml'
    npm WARN tar ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/is-callable-b108a571/CHANGELOG.md'
    npm WARN tar ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/is-callable-b108a571/index.js'
    npm WARN tar ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/is-callable-b108a571/LICENSE'
    npm WARN tar ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/is-callable-b108a571/Makefile'
    npm WARN tar ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/is-callable-b108a571/README.md'
    npm WARN tar ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/node_modules/.staging/is-callable-b108a571/test.js'
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
    npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/opt/atlassian/pipelines/agent/build/node_modules/.staging/fsevents-28107b46/node_modules/abbrev' -> '/opt/atlassian/pipelines/agent/build/node_modules/.staging/abbrev-f9689457'
    npm ERR! code E404
    npm ERR! 404 Not Found: event-stream@https://registry.npmjs.org/event-stream/-/event-stream-3.3.6.tgz
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /root/.npm/_logs/2018-12-02T23_25_23_174Z-debug.log
    

    pipelines yml..

    image: node:8.11.3
    
    pipelines:
      default:
        - step:
            caches:
              - node
            script:
              - npm install
              - npm run lint
    
  10. Fernando Buccella

    @jeroendr

    I don't have that package as a direct dependency in my package.json file. On the other hand if I run npm install locally it works fine.. So what else can it be?

    {
      "engines": {
        "node": "8.11.3",
        "npm": "5.6.0"
      },
      "dependencies": {
        "bluebird": "^3.5.3",
        "body-parser": "^1.18.3",
        "celebrate": "^9.0.1",
        "cors": "^2.8.5",
        "debug": "^4.1.0",
        "express": "^4.16.4",
        "helmet": "^3.15.0",
        "http-errors": "^1.7.1",
        "http-status": "^1.3.1",
        "lodash": "^4.17.11",
        "moment": "^2.22.2",
        "mongoose": "^5.3.12",
        "mongoose-paginate": "^5.0.3",
        "morgan": "^1.9.1",
        "require-all": "^3.0.0",
        "winston": "^3.1.0"
      },
      "devDependencies": {
        "chai": "^4.2.0",
        "chai-as-promised": "^7.1.1",
        "chai-http": "^4.2.0",
        "chance": "^1.0.16",
        "eslint": "^5.9.0",
        "eslint-config-airbnb-base": "^13.1.0",
        "eslint-plugin-import": "^2.14.0",
        "mocha": "^5.2.0",
        "nodemon": "^1.18.6",
        "nyc": "^13.1.0"
      }
    }
    
  11. José Ramón Blanco Rey

    Hi all, I had the same issue and it was nodemon 1.18 pulling the event-stream package... I upgraded nodemon to 1.18.9 and the issue was resolved because it seems that it does not have that dependency anymore (checked with npm ls nodemon)

  12. Log in to comment