composer: Packagist does not contain valid JSON / Down

When I run this command:

composer update

I get the following output:

"https://packagist.org/packages.json" does not contain valid JSON
Parse error on line 1:

^
Expected one of: 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['
https://packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date

I have tried this on 2 complete different servers, and both result in the same problem.

When I go to https://packagist.org/packages.json is is actually empty!


What happened? is packagist down?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 7
  • Comments: 33 (1 by maintainers)

Most upvoted comments

quickfix via hosts:

144.217.203.53 packagist.org

WARNING: KEEP IN MIND THIS WILL CHANGE IN THE FUTURE!

Composer should check status of packagist and if error returned then return false with a message.

All systems have been restored and our DNS is updated with a 2min TTL so hopefully any future event we can react quicker. Sorry for the inconvenience and have a good day everyone.

Please don’t forget to remove any /etc/hosts entries you made as they are not needed anymore.

A valid reason to tell the project manager … composer was down! oops I am the project manager by the way.

Been pulling my hair over this for an hour, glad it’s not me.

502. Bad gateway. Nginx. As of Tweet :: a short interruption(...) 12 hrs is short ??

getting this now:

 [Composer\Repository\RepositorySecurityException]                                                                                                                                                  
  The contents of https://packagist.org/p/provider-latest%240cbfb40ab72a881d21b70f78286d39cd72e3b0eb8704c13e79dc49624e549973.json do not match its signature. This could indicate a man-in-the-middle attack. Try running composer again and report this if you think it is a mistake.

working again…@Seldaek can we have some kind of info within composer like “Maintenance, Please wait” …

i flushed all my composer cache and also tried different version trying to fix that issue 😉