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

Private packages not working on TravisCI #1208

Open
jeffcarbs opened this issue Oct 18, 2016 · 10 comments
Open

Private packages not working on TravisCI #1208

jeffcarbs opened this issue Oct 18, 2016 · 10 comments

Comments

@jeffcarbs
Copy link

jeffcarbs commented Oct 18, 2016

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Running yarn from within TravisCI fails at the "fetching packages" step. See output below.

If the current behavior is a bug, please provide the steps to reproduce.

  • Add private package to your dependencies.
  • Push build to travis (with NPM_TOKEN appropriately set as env variable).
  • View failure

What is the expected behavior?
Running yarn should successfully download all packages.

Please mention your node.js, yarn and operating system version.
Output from yarn-error.log (manifest/lock file excluded for brevity):

Arguments:
  /home/travis/.nvm/versions/node/v6.6.0/bin/node /home/travis/.nvm/versions/node/v6.6.0/bin/yarn

PATH:
  /home/travis/.rvm/gems/ruby-1.9.3-p551/bin:/home/travis/.rvm/gems/ruby-1.9.3-p551@global/bin:/home/travis/.rvm/rubies/ruby-1.9.3-p551/bin:/home/travis/.rvm/bin:/home/travis/.nvm/versions/node/v6.6.0/bin:/home/travis/bin:/home/travis/.local/bin:/home/travis/.gimme/versions/go1.4.1.linux.amd64/bin:/usr/local/phantomjs/bin:./node_modules/.bin:/usr/local/maven-3.2.5/bin:/usr/local/clang-3.4/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/travis/.debug:/home/travis/.rvm/bin

Yarn version:
  0.16.0

Node version:
  6.6.0

Platform:
  linux x64

Trace: 
  Error: https://registry.yarnpkg.com/@mycompany/mycompany-api/-/mycompany-api-0.4.0.tgz: invalid tar file
      at Extract.Parse._startEntry (/home/travis/.nvm/versions/node/v6.6.0/lib/node_modules/yarn/node_modules/tar/lib/parse.js:149:13)
      at Extract.Parse._process (/home/travis/.nvm/versions/node/v6.6.0/lib/node_modules/yarn/node_modules/tar/lib/parse.js:131:12)
      at BlockStream.<anonymous> (/home/travis/.nvm/versions/node/v6.6.0/lib/node_modules/yarn/node_modules/tar/lib/parse.js:47:8)
      at emitOne (events.js:96:13)
      at BlockStream.emit (events.js:188:7)
      at BlockStream._emitChunk (/home/travis/.nvm/versions/node/v6.6.0/lib/node_modules/yarn/node_modules/block-stream/block-stream.js:145:10)
      at BlockStream.flush (/home/travis/.nvm/versions/node/v6.6.0/lib/node_modules/yarn/node_modules/block-stream/block-stream.js:70:8)
      at BlockStream.end (/home/travis/.nvm/versions/node/v6.6.0/lib/node_modules/yarn/node_modules/block-stream/block-stream.js:66:8)
      at Extract.Parse.end (/home/travis/.nvm/versions/node/v6.6.0/lib/node_modules/yarn/node_modules/tar/lib/parse.js:86:23)
      at UnpackStream.onend (_stream_readable.js:511:10)

Here's my travis.yml (adapted from https://github.com/javascriptair/site/blob/master/.travis.yml):

language: node_js

cache:
  directories:
    - $HOME/.npm
    - $HOME/.yarn-cache
    - node_modules

before_install:
  - mv .travis.npmrc .npmrc
  - npm i -g yarn --cache-min 999999999

install:
  - yarn

script:
  - yarn run lint && yarn run test

.travis.npmrc is:

//registry.npmjs.org/:_authToken=${NPM_TOKEN}

NOTE: This same configuration works when building/installing on TravisCI with npm.

@abtris
Copy link

abtris commented Oct 19, 2016

I have some problem with our private registry based on Sinopia.

@oliverwoodings
Copy link

Experiencing the same thing with our private registry, but not just on CI - locally as well.

@el-davo
Copy link

el-davo commented Oct 25, 2016

Experiencing same problem with private artifactory

@edvinerikson
Copy link

I removed the local yarn cache and it solved the issue

@oliverwoodings
Copy link

Clearing the cache didn't help our issue - still getting 'invalid tar file' which normally means the auth token is not being sent correctly.

@oliverwoodings
Copy link

Here is our trace, if it is any help:

Trace: 
  Error: https://registry.redacted.com/@redacted/redacted/download/@redacted/redacted-0.0.4.tgz: invalid tar file
      at Extract.Parse._startEntry (/Users/oliverwoodings/.nvm/versions/node/v6.2.2/lib/node_modules/yarn/node_modules/tar/lib/parse.js:149:13)
      at Extract.Parse._process (/Users/oliverwoodings/.nvm/versions/node/v6.2.2/lib/node_modules/yarn/node_modules/tar/lib/parse.js:131:12)
      at BlockStream.<anonymous> (/Users/oliverwoodings/.nvm/versions/node/v6.2.2/lib/node_modules/yarn/node_modules/tar/lib/parse.js:47:8)
      at emitOne (events.js:96:13)
      at BlockStream.emit (events.js:188:7)
      at BlockStream._emitChunk (/Users/oliverwoodings/.nvm/versions/node/v6.2.2/lib/node_modules/yarn/node_modules/block-stream/block-stream.js:145:10)
      at BlockStream.flush (/Users/oliverwoodings/.nvm/versions/node/v6.2.2/lib/node_modules/yarn/node_modules/block-stream/block-stream.js:70:8)
      at BlockStream.end (/Users/oliverwoodings/.nvm/versions/node/v6.2.2/lib/node_modules/yarn/node_modules/block-stream/block-stream.js:66:8)
      at Extract.Parse.end (/Users/oliverwoodings/.nvm/versions/node/v6.2.2/lib/node_modules/yarn/node_modules/tar/lib/parse.js:86:23)
      at UnpackStream.onend (_stream_readable.js:517:10)

bdentino added a commit to bdentino/yarn that referenced this issue Oct 26, 2016
@bdentino
Copy link

i have a fix for this at bdentino@558850a. if i can get a second opinion that it works for others and isn't likely to cause a regression i'll probably submit a PR.

@vinnymac
Copy link

vinnymac commented Oct 26, 2016

I have this issue as well.

macOS 10.12.1
node 6.8.0
yarn 0.16.1

Trace:
  Error: https://registry.redacted.com/@redacted/redacted/download/@redacted/redacted-0.0.1.tgz: invalid tar file
      at Extract.Parse._startEntry (/usr/local/lib/node_modules/yarn/node_modules/tar/lib/parse.js:149:13)
      at Extract.Parse._process (/usr/local/lib/node_modules/yarn/node_modules/tar/lib/parse.js:131:12)
      at BlockStream.<anonymous> (/usr/local/lib/node_modules/yarn/node_modules/tar/lib/parse.js:47:8)
      at emitOne (events.js:96:13)
      at BlockStream.emit (events.js:188:7)
      at BlockStream._emitChunk (/usr/local/lib/node_modules/yarn/node_modules/block-stream/block-stream.js:145:10)
      at BlockStream.flush (/usr/local/lib/node_modules/yarn/node_modules/block-stream/block-stream.js:70:8)
      at BlockStream.end (/usr/local/lib/node_modules/yarn/node_modules/block-stream/block-stream.js:66:8)
      at Extract.Parse.end (/usr/local/lib/node_modules/yarn/node_modules/tar/lib/parse.js:86:23)
      at UnpackStream.onend (_stream_readable.js:511:10)

I attempted @bdentino's fix and received the same stack trace with the same error invalid tar file.

@bdentino
Copy link

@vinnymac for me the root cause of the 'invalid tar file' error was that authentication headers weren't properly being sent with the request. are you able to confirm whether or not your issue is related to authentication by logging out the status code of the actual request to https://registry.redacted.com/@redacted/redacted/download/@redacted/redacted-0.0.1.tgz?

@vinnymac
Copy link

vinnymac commented Oct 28, 2016

@bdentino my mistake, whatever the problem was it seems to be resolved now. I had an issue with this, and for some reason everything is working today. I had a separate issue with private github installs. Which I fixed by doing git+ssh://git@github.com/org/repo.git#branch instead. So I no longer have any issues using yarn in private repos 👍 Wish I could provide you with more info of what changed. If I discover it I will surely post it.

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

9 participants