-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
An unexpected error occurred: Request failed \"404 Not Found\"". #2738
Comments
As an aside, the package clearly does exist and |
Having ran some more tests, I've found that the same package fails to install from other repositories that require it when using This leads me to think it isn't my repository specific config. Could it be something to do with the name of the package tripping Clutching at straws here, but hopefully this might bump someone in the right direction |
I fixed this: I simply re-published the offending package with a new version number. I have no idea why that fixed it. I will leave this here in case it aids debugging. |
I'm experiencing the same issue. This seems to happen randomly and is often resolved by simply retrying the build. |
We're also experiencing the exact same issue. |
We just experienced the same issue. Some more context here in the hopes that it might help
As mentioned above as workaround, publishing a new version of the package resolved the issue. Unfortunately, I was unable to obtain a detailed |
I am seeing the same issue. I'm using a docker image in circleci 2.0 and having some unrelated issues that I'm debugging locally (compilation difference on cci vs local).
I have setup Verbose didn't provide me with any information that I can spot: root@2adc7c09ff9a:~/af/spec/dummy# yarn --pure-lockfile --ignore-optional
yarn install v0.21.3
[1/4] Resolving packages...
[2/4] Fetching packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/@alienfast/build/-/build-2.0.38.tgz: Request failed \"404 Not Found\"".
info If you think this is a bug, please open a bug report with the information provided in "/root/af/spec/dummy/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
root@2adc7c09ff9a:~/af/spec/dummy# yarn --pure-lockfile --ignore-optional --verbose
yarn install v0.21.3
verbose 0.178 current time: 2017-03-01T20:22:52.715Z
[1/4] Resolving packages...
[2/4] Fetching packages...
verbose 0.798 Performing "GET" request to "https://registry.yarnpkg.com/@alienfast/build/-/build-2.0.38.tgz".
verbose 0.861 Performing "GET" request to "https://registry.yarnpkg.com/@alienfast/ui/-/ui-1.0.34.tgz".
verbose 0.894 Performing "GET" request to "https://registry.yarnpkg.com/react-relay/-/react-relay-0.10.0.tgz".
verbose 0.895 Performing "GET" request to "https://registry.yarnpkg.com/react-dom/-/react-dom-15.4.2.tgz".
verbose 0.919 Performing "GET" request to "https://registry.yarnpkg.com/eslint/-/eslint-3.15.0.tgz".
verbose 0.941 Performing "GET" request to "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.39.0.tgz".
verbose 0.951 Performing "GET" request to "https://registry.yarnpkg.com/@alienfast/material-ui/-/material-ui-0.16.87.tgz".
verbose 0.966 Performing "GET" request to "https://registry.yarnpkg.com/@alienfast/react-formal/-/react-formal-0.24.7.tgz".
verbose 1.003 Performing "GET" request to "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz".
verbose 1.103 Performing "GET" request to "https://registry.yarnpkg.com/graphql/-/graphql-0.9.1.tgz".
verbose 1.178 Performing "GET" request to "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz".
verbose 1.206 Performing "GET" request to "https://registry.yarnpkg.com/material-ui/-/material-ui-0.16.7.tgz".
verbose 1.249 Performing "GET" request to "https://registry.yarnpkg.com/react-i18next/-/react-i18next-2.2.0.tgz".
verbose 1.261 Performing "GET" request to "https://registry.yarnpkg.com/react-relay-network-layer/-/react-relay-network-layer-1.4.0.tgz".
verbose 1.272 Performing "GET" request to "https://registry.yarnpkg.com/react-router/-/react-router-3.0.2.tgz".
verbose 1.696 Performing "GET" request to "https://registry.yarnpkg.com/react-router-relay/-/react-router-relay-0.13.5.tgz".
verbose 1.764 Performing "GET" request to "https://registry.yarnpkg.com/react-sizeme/-/react-sizeme-2.2.0.tgz".
verbose 2.063 Performing "GET" request to "https://registry.yarnpkg.com/recompose/-/recompose-0.22.0.tgz".
verbose 2.144 Error: https://registry.yarnpkg.com/@alienfast/build/-/build-2.0.38.tgz: Request failed "404 Not Found"
at Request.handleRequestError (/root/.yarn/lib/fetchers/tarball-fetcher.js:231:20)
at emitOne (events.js:96:13)
at Request.emit (events.js:189:7)
at Request.onRequestResponse (/root/.yarn/node_modules/request/request.js:986:10)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:189:7)
at HTTPParser.parserOnIncomingClient (_http_client.js:522:21)
at HTTPParser.parserOnHeadersComplete (_http_common.js:99:23)
at TLSSocket.socketOnData (_http_client.js:411:20)
at emitOne (events.js:96:13)
at TLSSocket.emit (events.js:189:7)
error An unexpected error occurred: "https://registry.yarnpkg.com/@alienfast/build/-/build-2.0.38.tgz: Request failed \"404 Not Found\"".
info If you think this is a bug, please open a bug report with the information provided in "/root/af/spec/dummy/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. root@2adc7c09ff9a:~/af/spec/dummy# cat ~/.npmrc
registry=https://registry.npmjs.org/
//registry.npmjs.org/:_authToken=${NPM_TOKEN} root@2adc7c09ff9a:~/af/spec/dummy# echo $NPM_TOKEN
xxxxx-xxxx-xxxx-xxxx-xxxxxxxx |
Same here, it works locally on OSX but not on the CircleCI container (circleci 1.0). I tried to It happens with yarn 0.18.1 as well as 0.21.3 - so maybe something changed in the yarnpkg registry configuration? Or, since I think everyone in the comments here is using CircleCI in the problem-scenario, it's an issue with CircleCI configuration? |
So, we think we've managed to solve the problem; would be keen to see if it works for others:
Thing to note is that we required both normal registry AND one for our private scoped registry. Just make sure you change Let me know if this helps anyone. |
@rogchap i just tried your solution but still see the same problem as before :( we have a hyphen in our scope name, maybe that could be the culprit?
|
@rogchap this workaround didn't have any effect on our situation. root@f41305331cb8:~/af/spec/dummy# cat ~/.npmrc
registry=https://registry.npmjs.org/
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
@alienfast:registry=https://registry.npmjs.org/ |
Confirmed it fails with |
|
So, not fixed for me...again. I had another private module give me the 404 message, even though it seems to resolve the correct version (must be reading something correctly somewhere), and seems to try and download the same tar url as NPM. This time I REMOVED the registries (except the auth one) in There is no consistency at all, randomly "playing" with I'm trying to promote Yarn, but every engineer in our company (rightly) says that Yarn is "not stable", "un usable", "not reliable", "doesn't work with private modules", "fails on the CI server" etc etc. I wonder if the Private NPM registry is doing something "funky" with the user-agent!?? <- Wild guess. |
In order to better understand this we may need some input from core contributors. @bestander, any insights? |
We don't use private packages much so this feature has less eyes on. |
Okay, so I forked yarn and fiddled around a bit. It seems like it loses the token before it fetches the tarball or rather after the first request is sent...
When I explicitly set the EDIT: Okay, so after further inspection, this problem occurs because the check whether the authorization header should be set returns false in
|
Okay, so i figured out how to fix this issue for us without a change to yarns source code.
OR alternatively completely getting rid of registry:
This seems to work because then yarn does not use different registries for the package in question to fetch info and tarballs. However, I'm unsure as to why yarn mixes these two and I think that maybe the check for the auth token could be changed/improved somehow. |
What is the next step? |
I've been trying out every possible combination for the past few hours and I think it's safe to say that there is no reliable workaround for this issue. @flipace any idea if this is something that can be fixed easily? Both of your methods do not work for me :(. |
Actually, scratch that, it does. Removing the registry assignments and only keeping the line with the auth-token seems to do the trick. Damn typos. Thanks @flipace! |
@bestander i'll try to come up with a PR in the next few days, the behavior of yarn in this case is not the way it should be. Thanks @pleunv for confirming that the workaround works for you too! |
The workaround does not work for me unfortunately 😿 |
@willrstern could you post your .npmrc maybe? |
Ah, removing
note, the |
@flipace |
Actually it works if I put this in my docker file:
The scope in question for me is |
|
@levino Can you run |
Wow. Turned out my problem wasn't part of this issue, but more like a part of more global thing: floatdrop/pinkie#18 |
Shit, now we started getting this problem too. Private scoped package. Random reproduction - sometimes works (with some versions), sometimes it doesn't. |
Seeing this error on our project. It is bizarre, since I don't get a 404 when hitting the URL manually:
|
We have solved all errors like these by switching our URLs a little. Avoid tar/gz and use tarball, i.e.:
|
If your package is hosted privately on npmjs.org, removing the line |
I'm exhibiting this today |
+1 for me. Started experiencing it today as well. Trying in install webpack on our CI. |
Same here lol. Tried latest
|
It is being discussed here #5530 |
In my case I had a local
|
Working with CircleCI also had 404 with yarn install.
This worked for me. Digging some more, discovered there were bad urls in the yarn lock. The yarn lock was using registry.yarnpkg.com that would 404'd on CircleCI (no clue why it worked locally). The resulting config that did the trick:
|
Thanks all, I too have resolved this issue by deleting yarn.lock. |
Update nps and nps-utils dependencies because those version depend on event-stream, which is unsafe and was removed from npm. yarnpkg/yarn#2738
For me, the failing command was I was able to run a |
maybe npm is needed due to dependency is not available on yarn repositories |
..that is often seen on Windows like this: ``` An unexpected error occurred: "https://registry.yarnpkg.com/@private/ngffwd-node-processes/-/ngffwd-node-processes-1.0.123.tgz: Request failed "404 Not Found". ``` re yarnpkg/yarn#2738
have the same issue with yarn + CI + material
|
For me it was a |
This is even worse with yarn 2 because the npmrc workaround seems to no longer work |
|
was facing the same issue, fixed it with my .npmrc (repository) looks like this:
Moreover, I noticed that |
After a long search, I found that my project had its own |
if using yarn and this error comes up, what worked for me was deleting the yarn.error file, yarn.lock file and the node_modules directory; then run "yarn" to reinstall the modules and then try to reinstall the package again |
The issue popped up for me using |
We had a gitlab private package registry, and was constantly getting this error. I tried all possible solutions listed on this thread. At last, there was a section in gitlab on troubleshooting yarn installation [1].
Our previous
With the above new line addition, it looked like this,
With that addition, |
My nextjs app deployed on vercel after this Thanks all! |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
I have a package which only depends on modules from the
npmjs
repository. They are predominantly public repositories, however 5 of them are private repositories scoped using an @ symbol. Again, these are hosted onnpmjs
.Up until some time today all of them would download an install without issue. However, something has changed and now one of them fails to install with the following error:
As I stated previously, the other private repositories (all within the same @ scope) download and install as intended. This leads me to think this isn't an authentication issue.
My
.npmrc
which is in the root of my project and contains my_authToken
looks like this:I have already completed the following activities:
npm login
again to get a fresh accessTokenrm -rf node_modules && rm yarn.lock && yarn cache clean
yarn add
itnpm install --save
command. This worked.If the current behavior is a bug, please provide the steps to reproduce.
As I am unsure of the cause I am unsure how to reproduce. Am willing to discuss further on Discord or in comments on this Issue.
What is the expected behavior?
I expect Yarn to install all of my private repositories from
npmjs
Please mention your node.js, yarn and operating system version.
Taken from
yarn-error.log
The text was updated successfully, but these errors were encountered: