1

There is a command to run Satis: php bin/satis build satis.json response

Satis itself lies on the server, for example, example.com/satis

How to run a command on a server remotely?

I tried to make a script with the command shell_exec('php bin/satis build satis.json response/') but encountered an error when Satis cannot log in to Git:

Scanning packages
Failed to clone the git@gitlab.com:project/project.git repository, try running in interactive mode so that you can enter your credentials

In Git.php line 354:

  Failed to execute git clone --mirror 'git@gitlab.com:project/project
  .git' '/var/www/.composer/cache/vcs/git-gitlab.com-project.git/'                                                                         

  Cloning into bare repository '/var/www/.composer/cache/vcs/git-gitlab.com-project.git'...                                                
  Host key verification failed.                                                
  fatal: Could not read from remote repository.                                

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


build [--repository-url [REPOSITORY-URL]] [--repository-strict] [--no-html-output] [--skip-errors] [--stats] [--] [ [ [...]]]

Where is a problem?

phd
  • 82,685
  • 13
  • 120
  • 165
Jack
  • 514
  • 3
  • 11
  • 30
  • Does this answer your question? [Git error: "Host Key Verification Failed" when connecting to remote repository](https://stackoverflow.com/questions/13363553/git-error-host-key-verification-failed-when-connecting-to-remote-repository) – phd Dec 04 '19 at 11:24
  • https://stackoverflow.com/search?q=%5Bssh%5D+Host+key+verification+failed – phd Dec 04 '19 at 11:24

1 Answers1

0

Host key verification failed.

Probably your command is not executed with the same user as the one managing satis on the server.

That means $HOME is not the same, and $HOME/.ssh/known_hosts (used to verify the host key of the remote host) is not there or not the same.

Try at least shell_exec('id -a; env') to check out what user/environment is seen through a shell_exec() call.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250