laravel / nova-issues

554 stars 35 forks source link

No longer able to install via composer on GitHub runners #3846

Closed chinleung closed 2 years ago

chinleung commented 2 years ago

Description:

I was able to install Nova previously on GitHub runners with a composer auth.json following the instructions from the documentation but it is no longer working.

I have not changed anything on my end and I've started receiving the following error this morning:

Failed to download laravel/nova from dist: The checksum verification of the file failed (downloaded from https://nova.laravel.com/dist/laravel/nova/laravel-nova-7f4781370193d23e9ffa218ae2c03fee3883821e-zip-54dd0e.zip)
    Now trying to download from source
  - Syncing laravel/nova (3.31.0) into cache
Error: Failed to execute git clone --mirror -- 'git@github.com:laravel/nova.git' '/home/runner/.cache/composer/vcs/git-github.com-laravel-nova.git/'

Cloning into bare repository '/home/runner/.cache/composer/vcs/git-github.com-laravel-nova.git'...
Warning: Permanently added the RSA host key for IP address '140.82.114.4' to the list of known hosts.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

In Git.php line 453:

  Failed to execute git clone --mirror -- 'git@github.com:laravel/nova.git' '  
  /home/runner/.cache/composer/vcs/git-github.com-laravel-nova.git/'           

  Cloning into bare repository '/home/runner/.cache/composer/vcs/git-github.c  
  om-laravel-nova.git'...                                                      
  Warning: Permanently added the RSA host key for IP address '140.82.114.4' t  
  o the list of known hosts.                                                   
  git@github.com: Permission denied (publickey).                               
  fatal: Could not read from remote repository.                                

  Please make sure you have the correct access rights                          
  and the repository exists.
crynobone commented 2 years ago

You can solved this by following these steps:

  1. Run composer update mirrors (this would update checksum in composer.lock without changes the versions)
  2. Commit the changes in composer.lock
  3. Run composer install
chinleung commented 2 years ago

Thanks @crynobone ! đŸ˜„

Peterragheb commented 2 years ago

This fix does not work on version 2.12.0 running composer update mirrors doesn't change the checksum even after running composer clearcache Update: Had to downgrade and upgrade again for the checksum to be recalculated

jspekken commented 2 years ago

@crynobone This indeed does not work. I have PHP 8.1 with composer 2.3.2 but composer update mirrors triggers no update. I'm currently, without any change, not able to deploy using Github actions. Any idea how I can fix this?

Thanks in advance!

crynobone commented 2 years ago

composer update mirrors just update composer.lock with the correct checksum and not your vendor dependencies.

jspekken commented 2 years ago

So what is the suggested fix for this? Locally this works, only on github actions this fails with the following message:

git@github.com: Permission denied (publickey).                               
  fatal: Could not read from remote repository.                                

  Please make sure you have the correct access rights                          
  and the repository exists.     

I did run the composer update mirrors, composer clearcache and all the steps but composer returns with:

Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove

So nothing to commit for me.

I'm running nova4

crynobone commented 2 years ago

@jspekken please refer to Nova 4 installation guide, you are experiencing completely different issue vs what's described in this issue.