Composer \ Downloader \ TransportException

Posted in August 2013 by under developer

One of the problems with relying on third parties, such as packagist and github, is that when they experience problems you end up with problems.

I have scripts to set up my development environment, today it failed with the following error:

[Composer\Downloader\TransportException]
"https://api.github.com/repos/ezyang/htmlpurifier/zipball
/d516e2f8de435ea78cc6152abc425d3ff2c4d289" appears broken,
and returned an empty 200 response
            

Given that my modules depend on HTMLPurifier, and HTMLPurifier cannot be installed, I cannot install those modules or build my application.

Fortunately in this situation the problem is easily fixed.

As this problem is a problem with Github serving Zip files, the easiest workaround is to get composer to install from source rather than downloading zip archives. We don't want to do this as a matter of course because it takes longer to download dependencies.

Use the composer option --prefer-source and run again.

For example:

composer install --prefer-source
            

This highlights the importance of not relying on third parties to build your application. Spend some time in setting up your own forks of third party code and configure composer to use them.