composer / composer

Dependency Manager for PHP
https://getcomposer.org/
MIT License
28.67k stars 4.56k forks source link

GitDownloader fails on composer.json update, when there is packages added as git repositories #2202

Closed shivas closed 7 years ago

shivas commented 11 years ago
[exec] *** [err :: internal.xxx.com] [RuntimeException]
     [exec] *** [err :: internal.xxx.com] Failed to execute git remote set-url composer 'ssh://xxx@xxx.xxx.com/home/repositories/xxx.git' && git fetch composer && git fetch --tags composer
     [exec] *** [err :: internal.xxx.com] 
     [exec] *** [err :: internal.xxx.com] Error reading response length from authentication socket.
     [exec] *** [err :: internal.xxx.com] Permission denied, please try again.
     [exec] *** [err :: internal.xxx.com] Permission denied, please try again.
     [exec] *** [err :: internal.xxx.com] Permission denied (publickey,password).
     [exec] *** [err :: internal.xxx.com] fatal: The remote end hung up unexpectedly

Looking at code i see only one option that there is no composer remote setup yet, and he trying to set url for that...?

its in composer.phar/src/Composer/Downloader/GitDownloader.php:74

shivas commented 11 years ago

I found out it happens only when composer.json file was update (that is package added or removed) if its just versions update - all works fine

Seldaek commented 11 years ago

The composer remote is set up when the package is first installed, so yes it should be there unless you are messing with the vendor directory in between.

shivas commented 11 years ago

This error occurs when symfony2 application gets deployed with capifony, that means there is no "old" vendors repository, that is quite confusing. Maybe composer cache somehow involved?

Seldaek commented 11 years ago

Not the cache but do you really have a clear vendor dir? If it exists with some stuff leftover it might try to update a package that is not actually installed.

shivas commented 11 years ago

We currently have Satis (local/private composer repository), and looks like problems always happens when/only when one of repositories/packages what are "hosted" there are updated, maybe that's the case? Maybe composer doesn't get all info it needs from Satis?

jkobus commented 10 years ago

I get this error all the time. Will investigate.

frederikbosch commented 9 years ago

@jkobus @shivas Could you clone the code in this PR (https://github.com/composer/composer/pull/3608), use the composer binary in there to update/install and see if the bug is still there? I have investigated quite some time now in GitDownloader and helper classes. If the problem still occurs, I might be able to help fixing the problem.

EagleEyeJohn commented 9 years ago

i'm getting this issue. my token got revoked, after months of use. using

composer config -g github-oauth.github.com myoathtoken

'worked' (composer seemed happy), but when running composer update again, it still tried to use the old token and fails. As I've provided a token, why doesn't composer prompt me to update it if it's not working? And as it doesn't, where is the config file stored on Windows so I can change the token manually?

frederikbosch commented 9 years ago

What happends if you remove your vendor folder and then composer update again?

EagleEyeJohn commented 9 years ago

Now you tell me!... I've just returned to post that that is indeed the solution to the problem. There must be a way for Composer to deal with this automatically? I've now got to delete vendor directories on 20+ projects.

frederikbosch commented 9 years ago

I already submitted #3608 for this issue a while ago. It has not been merged yet. From what I understand, there are other problems that need more attention at this moment.

frederikbosch commented 9 years ago

@EagleEyeJohn Could you actually confirm that PR #3608 fixes your problem? The steps to test it would be clone https://github.com/frederikbosch/composer, run composer install for the composer package, and then try to redo the steps of your problem with composer binary from my PR (bin/composer).

cnizzardini commented 9 years ago

This happened when I changed the branch I am requiring. To get past this error I deleted the project in the vendor directory and ran composer update.

frederikbosch commented 9 years ago

@cnizzdotcom If this happends again, I am interested if #3608 solves the problem. Could you try with the same instructions I gave to @EagleEyeJohn?

Seldaek commented 7 years ago

Closing as it doesn't seem extremely relevant anymore.

ShayanAliProgrammer commented 9 months ago

Hey I was getting this error:

Failed to execute git show-ref --head -d

  fatal: detected dubious ownership in repository at 'C:/Users/NTEch/AppData/Roaming/Composer/vendo
  r/doctrine/inflector'
  'C:/Users/NTEch/AppData/Roaming/Composer/vendor/doctrine/inflector' is owned by:
        'S-1-5-32-544'                                                                                
  but the current user is:
        'S-1-5-21-3269338778-2856369246-3259115991-1002'                                              
  To add an exception for this directory, call:

        git config --global --add safe.directory C:/Users/NTEch/AppData/Roaming/Composer/vendor/doctrine
  /inflector

I fixed that error using: git config --global --add safe.directory C:/Users/NTEch/AppData/Roaming/Composer/vendor/doctrine/inflector