zendframework / zend-stdlib

Stdlib component from Zend Framework
BSD 3-Clause "New" or "Revised" License
384 stars 76 forks source link

Invalid zip file, history was rewritten? #12

Closed AndrzejFR closed 9 years ago

AndrzejFR commented 9 years ago

When running composer install we get

 - Installing zendframework/zend-stdlib (2.3.0)
    Downloading: 100%         
    Invalid zip file, retrying...
  - Installing zendframework/zend-stdlib (2.3.0)
    Downloading: 100%         
    Invalid zip file, retrying...
  - Installing zendframework/zend-stdlib (2.3.0)
    Downloading: 100%         
    Failed to download zendframework/zend-stdlib from dist: '/home/vagrant/Web/vendor/zendframework/zend-stdlib/Zend/Stdlib/e5d7b5d9eb93124bf2160eeac532bea2' is not a zip archive.
    Now trying to download from source
  - Installing zendframework/zend-stdlib (2.3.0)
    Cloning d1c481b8a43f2f079b16d3567960ba539e9dacaa
    d1c481b8a43f2f079b16d3567960ba539e9dacaa is gone (history was rewritten?)

  [RuntimeException]                                                           
  Failed to execute git checkout 'd1c481b8a43f2f079b16d3567960ba539e9dacaa' -  
  - && git reset --hard 'd1c481b8a43f2f079b16d3567960ba539e9dacaa' --          
  fatal: reference is not a tree: d1c481b8a43f2f079b16d3567960ba539e9dacaa     

composer update "fixes" the issue but that is not a solution. If nothing has changed we should not need to run update. Before we had a problem with 404 errors that composer update was a solution but it isn't, it just a quick fix.

Why there are these problems with this library and is there something else other than running composer update all the time to fix it?

Maks3w commented 9 years ago

Recently we have splitted the framework in many repositories in a different way as before was.

Unfortunatelly you need to update your composer.lock so git uri and references become updated.

AndrzejFR commented 9 years ago

How often we have to do it? we did it yesterday already and today again, will i have to do it tomorrow again?

Maks3w commented 9 years ago

Only once, may you didn't persist your changes in composer.lock

AndrzejFR commented 9 years ago

i definitely did persist it. we will see tomorrow.

weierophinney commented 9 years ago

Are you using packagist, or packages.zendframework.com as your repository? This may be an issue with one of the repositories.

AndrzejFR commented 9 years ago

I have packages.zendframework.com defined in my json. Looking at current lock file history.

Yesterday when i got this error first time i had in my lock:

"url": https://api.github.com/repos/zendframework/Component_ZendStdlib/zipball/d1c481b8a43f2f079b16d3567960ba539e9dacaa",
 "reference": "d1c481b8a43f2f079b16d3567960ba539e9dacaa",

after running update i had

 "url": "https://packages.zendframework.com/composer/zendframework-zend-stdlib-2.3.0-8134c0.zip",
"reference": "8078c2a5e5e7cb94d1c561dc9da2e9aca9bc9e22",

Later one of my teammates added some lib and run update, it got changed to

"url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/426b5396e89e7da2db9678bc9a0b57865f84fe0f",
"reference": "d1c481b8a43f2f079b16d3567960ba539e9dacaa",

Today morning it didn't work anymore and now after update I have

 "url": "https://packages.zendframework.com/composer/zendframework-zend-stdlib-2.3.0-8134c0.zip",
"reference": "8078c2a5e5e7cb94d1c561dc9da2e9aca9bc9e22",
weierophinney commented 9 years ago

The first update was required due to the change in our component repos (the one that referred to Component_ZendStdlib). It looks like packages.zendframework.com is giving consistent results, while packagist is not. We do not control packagist, so unfortunately cannot help in this case. :-/