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

Debug option to find source of broken dependency on fresh install #7496

Closed
bryan-kramer opened this issue Jul 26, 2018 · 2 comments
Closed
Labels

Comments

@bryan-kramer
Copy link

When composer fails on a missing package error, it would be really nice to see the path to the root through the dependency graph to find out why that package is to be included. There has to be a better way than removing all dependencies and adding them back one at a time.

I'm not sharing my composer.json since this is a general request for showing the dependency graph. The reason for the failure in this case is clear.

Composer version 1.6.5 2018-05-04 11:44:59

I have a composer.json file that is a few years old using old packages. It turns out that one of the packages has disappeared from github and even though it is still mentioned on packagist, it fails to install:

  [RuntimeException]                                                                         
  Failed to clone https://github.com/Phil-F/Setting.git via https, ssh protocols, aborting.  
  - https://github.com/Phil-F/Setting.git                                                    
    remote: Invalid username or password.                                                    
    fatal: Authentication failed for 'https://github.com/Phil-F/Setting.git/'                
  - git@github.com:Phil-F/Setting.git                                                        
    ERROR: Repository not found.                                                             
    fatal: Could not read from remote repository.                                            
                                                                                             
    Please make sure you have the correct access rights                                      
    and the repository exists.                                                               

The access to github fails because the repository no longer exists there.

The package is not explicitly mentioned in the composer.json. The verbose option to composer is not helpful.

composer why doesn't provide any answers:

$ composer why philf/setting

                                                          
  [InvalidArgumentException]                              
  Could not find package "philf/setting" in your project  
                                                          

depends [-r|--recursive] [-t|--tree] [--] <package> [<constraint>]

The package is not mentioned anywhere in the composer.json of any package already installed:

$ grep -ir philf .

returns nothing.

composer show -t on the partially installed directory also does not mention philf/settings.

A variety of google searches on this particular package did not return any useful information either.

@Seldaek
Copy link
Member

Seldaek commented Jul 26, 2018

That's.. very odd. In the composer.lock it should be present and at the very least should be required by one other package.

@Seldaek
Copy link
Member

Seldaek commented Jul 26, 2018

Well I guess technically if you removed something that required it but didn't remove philf/setting itself, you could end up with this dangling package. This is something Composer handles better nowadays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants