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

Composer file could not be downloaded (404 not found) #7021

Closed
bepossitive opened this issue Jan 18, 2018 · 49 comments
Closed

Composer file could not be downloaded (404 not found) #7021

bepossitive opened this issue Jan 18, 2018 · 49 comments

Comments

@bepossitive
Copy link

I tyring to install Laravel

Output of composer diagnose:

d:\web>composer diag
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking HTTP proxy: OK
Checking HTTP proxy support for request_fulluri: OK
Checking HTTPS proxy support for request_fulluri: OK
Checking github.com oauth access: OK
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0 ****
723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B ****
8C AD90147D AFE50952
OK
Checking composer version: OK
Composer version: 1.6.2
PHP version: 7.2.1
PHP binary path: D:\php-7.2.1-nts-Win32-VC15-x86\php.exe

When I run this command:

composer global require "laravel/installer"

I get the following output:

[Composer\Downloader\TransportException]
The "https://packagist.org/p/symfony/console%2433f24f3dbe55cff57fe06a5fa93b
a0bbe3ae3b259e2c5b7d051da0238769fa0f.json" file could not be downloaded (HT
TP/1.1 404 Not Found)

@MirazMac
Copy link

MirazMac commented Feb 4, 2018

I'm having the same problem. It hangs for a long time, then displays this error. I tried uninstalling and re-installing Composer, but the result is same.

@karim10
Copy link

karim10 commented Feb 14, 2018

Same problem for me

@MirazMac
Copy link

No solution yet? Still facing the same problem :(

@siduke000
Copy link

siduke000 commented Mar 4, 2018

Same problem for me - but this was cleared by:

composer clear-cache

@johnabelardom
Copy link

Can you try

composer clear-cache

then

composer -vvv

after that try running the install command for laravel, it worked for me though

@q10242
Copy link

q10242 commented Jun 11, 2018

having the same problem.

@iamsambath
Copy link

Also my problem

@MirazMac
Copy link

This issue was never fixed.

@alcohol
Copy link
Member

alcohol commented Aug 16, 2018

For proxy issues, try:
https://gist.github.com/naderman/377e40c1c76e0fe8b905c1a333c4112a

Details:
https://twitter.com/naderman/status/1029839134070853637

@raveesgohiel9
Copy link

Anybody found the solution?

@MirazMac
Copy link

I didn't find any solution. But I found when the problem occurs. It seems the problem only occurs when I'm using my broadband connection IP. If I use mobile data via hotspot everything seems to work fine. But for some reason won't work on my broadbrand IP.

@raveesgohiel9
Copy link

raveesgohiel9 commented Jan 29, 2019 via email

@ryyip
Copy link

ryyip commented Mar 29, 2019

First I try the command "composer clear-cache". It still not working.
Then I try the command "composer dump-autoload".
It works for me.

@ViperMY
Copy link

ViperMY commented Apr 16, 2019

Can you try

composer clear-cache

then

composer -vvv

after that try running the install command for laravel, it worked for me though

It works for me.

@zhouxlin
Copy link

Can you try

composer clear-cache

then

composer -vvv

after that try running the install command for laravel, it worked for me though

it works for me too

@OZZlE
Copy link

OZZlE commented May 14, 2019

we had a ton of vcs repos pointing to different private github repos, I simply removed most of them added a packagist url to those, tried install again, then it asked me for github ssh access token, I entered it, it failed installing some modules, I reverted composer.json back to the original, removed everything in vendor folder and ran install again and then everything worked fine :P

@fffeiip
Copy link

fffeiip commented May 22, 2019

Can you try

composer clear-cache

then

composer -vvv

after that try running the install command for laravel, it worked for me though

This worked for me aswell

@Marks-1
Copy link

Marks-1 commented May 30, 2019

composer clear-cache rectifies the error

@OZZlE

This comment has been minimized.

@Sciecha
Copy link

Sciecha commented Jun 21, 2019

Probably sometimes you have to add repositories to composer, it solved my problem.

@faniabdo99
Copy link

the composer clear-cache Solution Worked For Me , Thanks to @johnabelardom

@UmarSaeed456
Copy link

Can you try

composer clear-cache

then

composer -vvv

after that try running the install command for laravel, it worked for me though

This work for me also

@SV-ZeroOne
Copy link

SV-ZeroOne commented Jul 30, 2019

Hello, I recently encountered the same following error when trying to composer require seostats/seostats package.
Was first getting this error
[Composer\Downloader\TransportException] The "https://packagist.org/p/provider-2019-04%244380046a2dfa549bfcf196bfc2c1a5cca9d58c63fb9b8e836367bfe2c01f062b.json" file could not be downloaded (HTTP/1.1 404 Not Found)

Then tried a composer clear-cache
Now getting this error
[Composer\Downloader\TransportException] Content-Length mismatch, received 551423 bytes out of the expected 2019004

Can anybody explain why this is happening?

Here is my composer diagnose results
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys:
Checking composer version: OK
Composer version: 1.8.6
PHP version: 7.2.20
PHP binary path: /opt/cpanel/ea-php72/root/usr/bin/php

@SV-ZeroOne
Copy link

Hello, I recently encountered the same following error when trying to composer require seostats/seostats package.
Was first getting this error
[Composer\Downloader\TransportException] The "https://packagist.org/p/provider-2019-04%244380046a2dfa549bfcf196bfc2c1a5cca9d58c63fb9b8e836367bfe2c01f062b.json" file could not be downloaded (HTTP/1.1 404 Not Found)

Then tried a composer clear-cache
Now getting this error
[Composer\Downloader\TransportException] Content-Length mismatch, received 551423 bytes out of the expected 2019004

Can anybody explain why this is happening?

Here is my composer diagnose results
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys:
Checking composer version: OK
Composer version: 1.8.6
PHP version: 7.2.20
PHP binary path: /opt/cpanel/ea-php72/root/usr/bin/php

Changed my composer default repos to this and it solved the content-length mismatch errors and I was able to successfully install my package.
composer config -g repo.packagist composer https://packagist.org
composer config -g github-protocols https ssh

@anovix
Copy link

anovix commented Jul 30, 2019

@SV-ZeroOne This might be the problem: https://twitter.com/packagist/status/1156148973738110978

@Indexo-Git
Copy link

Indexo-Git commented Aug 5, 2019

Can you try

composer clear-cache

then

composer -vvv

after that try running the install command for laravel, it worked for me though

This was a solution for me

@NamaSeydou1
Copy link

composer clear-cache

composer -vvv

@viraljetani
Copy link

if "composer clear-cache" doesnt work, try using "composer self-update" before your composer update command and it should fix any composer related issues itself and should fix your problem.

@kaluzki
Copy link

kaluzki commented Sep 18, 2019

composer clear-cache didn't work for me

it seems that there are some network issues from time to time on the main server https://packagist.org

i tried one of the mirrors as a temporary workaround:

composer config -g repo.packagist composer https?://packagist.jp

it was pretty slow, but worked finally

@BorisGautier
Copy link

composer config -g -- disable-tls false

@LMDeb
Copy link

LMDeb commented Sep 19, 2019

composer clear-cache no funcionó para mí

parece que hay algunos problemas de red de vez en cuando en el servidor principal https://packagist.org

probé uno de los espejos como una solución temporal:

composer config -g repo.packagist composer https?://packagist.jp

fue bastante lento, pero finalmente funcionó

It worked for me. I installed laravel / ui, I had the same error. Thank you

@ixperiencenl
Copy link

ixperiencenl commented Sep 19, 2019

This is very strange behaviour.
I run Ubuntu 18 in a VM and try to update my Laravel packages.
It gives me this error.

When I try to open the JSON url, it gives the neat 404 error from the Packagist.

When I try to open the JSON url on the Windows host, it show the json data just fine.

I think it is worth investigating this further. Is maybe packagist blocking certain requests?
Edit: When I run the command (inside the Ubuntu machine) in another Laravel project, it works just fine.
Edit 2: When I run the command (inside the Ubuntu machine) after running it in another project (where it worked fine), it also does work fine now. Very strange!

@mohsinalipro
Copy link

composer clear-cache didn't work for me

it seems that there are some network issues from time to time on the main server https://packagist.org

i tried one of the mirrors as a temporary workaround:

composer config -g repo.packagist composer https?://packagist.jp

it was pretty slow, but worked finally

Worked (I am using cPanel Terminal)

@hameedhub
Copy link

composer clear-cache didn't work for me

it seems that there are some network issues from time to time on the main server https://packagist.org

i tried one of the mirrors as a temporary workaround:

composer config -g repo.packagist composer https?://packagist.jp

it was pretty slow, but worked finally

This worked for me! Thanks so much

@p2made
Copy link

p2made commented Nov 3, 2019

I've been having an occurence of this issue. None of the suggestions in this thread have worked, but I've found that the issue only occurs when I attempt to load "npm-asset/pdfmake": "~0.1". When I use "bower-asset/pdfmake": "~0.1" (as I previously had been, I'm migrating some of my dependancies to using npm) there's no error. I've opened an issue here. For now my fix is to stick with using "bower-asset/pdfmake": "~0.1".

@MohammadTaher99
Copy link

composer clear-cache didn't work for me

it seems that there are some network issues from time to time on the main server https://packagist.org

i tried one of the mirrors as a temporary workaround:

composer config -g repo.packagist composer https?://packagist.jp

it was pretty slow, but worked finally

This worked for me.Thanks:)

@peter279k
Copy link

It seems that this problem is about failing to download required JSON from Packagist mirror site.

And I've suffered this issue from main and my Packagist mirror before.

It usually gets failed when the specific mirror site is upgrading mirror data.

And it doesn't have the current way to resolve this issue at this moment.

Some possible ways I try are as follows:

  • Running failed command again. That is, when using the composer install command is failed, running this command again.
  • Using the composer clear-cache to remove possible cached files and run the failed command again.

@RoseRiyadh
Copy link

Can you try

composer clear-cache

then

composer -vvv

after that try running the install command for laravel, it worked for me though

This helped me, Thank you <3.

@oussamabouchikhi
Copy link

composer clear-cache didn't work for me

it seems that there are some network issues from time to time on the main server https://packagist.org

i tried one of the mirrors as a temporary workaround:

composer config -g repo.packagist composer https?://packagist.jp

it was pretty slow, but worked finally

I tried all previous sollution and nothing happened but finally this worked for me

@andreas-hub
Copy link

I got this issue when I forgot to use SUDO. So sudo composer update worked for me.

@github-actions
Copy link

This issue has been automatically marked Stale and will be closed in 15 days if no further activity happens.

@github-actions github-actions bot added the Stale label Aug 30, 2021
@ixperiencenl
Copy link

ixperiencenl commented Aug 30, 2021 via email

@github-actions github-actions bot removed the Stale label Aug 31, 2021
@savandholu
Copy link

Can you try

composer clear-cache

then

composer -vvv

after that try running the install command for laravel, it worked for me though

Same issue

@paugnu
Copy link

paugnu commented Feb 28, 2022

There are many reasons for this error. One additional thing to check is that, if you're using private repos with user/pass, you might not have the correct permissions.

Check:

  • auth.json file, check credentials
  • if necessary, set up new credentials and try again

@victorboilevin
Copy link

There are many reasons for this error. One additional thing to check is that, if you're using private repos with user/pass, you might not have the correct permissions.

Check:

  • auth.json file, check credentials
  • if necessary, set up new credentials and try again

Credentials problem for me!

@martinberlin
Copy link

Yes that happened for me too!
To know the current version and update details:

composer diagnose

If you spot there:
Checking github.com oauth access: The oauth token for github.com seems invalid, run "composer config --global --unset github-oauth.github.com" to remove it

Just remove it. And try install again. In my case I was getting 404 errors because an outdated key was there (Although it expected other error with that instead of 404)

@selcuktemizsoy
Copy link

Yes that happened for me too! To know the current version and update details:

composer diagnose

If you spot there: Checking github.com oauth access: The oauth token for github.com seems invalid, run "composer config --global --unset github-oauth.github.com" to remove it

Just remove it. And try install again. In my case I was getting 404 errors because an outdated key was there (Although it expected other error with that instead of 404)

This one helped me for some situation. I think token is expired and it couldn't connect to git repo due to this reason. But after removing it, it asked me for new token and I generated new one and it fixed the problem. Thank you.

@Hillaryudechukwu
Copy link

nano ~/.composer/auth.json
change ==>
"github-oauth": {
"github.com": "ghp_[YOUR-PERSONAL-TOKEN]"
}
to ==>
delete the github.com entry under "github-oauth": {}
That's it.

@github-actions
Copy link

This issue has been automatically marked Stale and will be closed in 15 days if no further activity happens.

@github-actions github-actions bot added the Stale label Sep 21, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests