简体   繁体   中英

Heroku composer install: Host key verification failed

I am trying to deploy my PHP project on Herkoku trough the git push command. This is going fine until composer fails to install my private packages stored in private repositories at Bitbucket. The message returned is:

remote: Compressing source files... done.
remote: Building source:
remote: -----> PHP app detected
remote: -----> Bootstrapping...
remote: -----> Installing platform packages...
remote:        - php (7.0.6)
remote:        - ext-exif (bundled with php)
remote:        - ext-gd (bundled with php)
remote:        - ext-mbstring (bundled with php)
remote:        - apache (2.4.20)
remote:        - nginx (1.8.1)
remote: -----> Installing dependencies...
remote:        Composer version 1.1.1 2016-05-17 12:25:44
remote:        Loading composer repositories with package information
remote:        Installing dependencies from lock file
remote:          - Installing doctrine/lexer (dev-master 83893c5)
remote:            Downloading: 100%
remote:
remote:          - Installing doctrine/annotations (dev-master f25c8aa)
remote:            Downloading: 100%
remote:
remote:          - Installing doctrine/cache (dev-master e0ef9e9)
remote:            Downloading: 100%
remote:
remote:          - Installing doctrine/collections (dev-master 866e100)
remote:            Downloading: 100%
remote:
remote:          - Installing private-repo/private-repo (dev-master cff3e2d)
remote:            Cloning cff3e2d83977df680e724b8857f18ebea85af420
remote:
remote:          [RuntimeException]
remote:          Failed to execute git clone --no-checkout 'git@bitbucket.org:private-repo/private-repo.git' '/tmp/build_83b3c2f9665a4335124a98bf13b0d85b/vendor/private-repo/private-repo' && cd '/tmp/build_83b3c2f9665a4335124a98bf13b0d85b/vendor/private-repo/private-repo' && git remote add composer 'git@bitbucket.org:private-repo/private-repo.git' && git fetch composer
remote:          Cloning into '/tmp/build_83b3c2f9665a4335124a98bf13b0d85b/vendor/private-repo/private-repo'...

remote:          Host key verification failed.
remote:          fatal: Could not read from remote repository.
remote:          Please make sure you have the correct access rights
remote:          and the repository exists.

remote:
remote:        install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--op
timize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] [<packages>]...
remote:
remote:
remote:  !     Push rejected, failed to compile PHP app
remote:
remote: Verifying deploy...
remote:
remote: !       Push rejected to xxx.

I already uploaded my rsa-key i normally use authenticating with Bitbucket onto my Heroku account.

Does somebody know how to let Heroku authenticate with my Bitbucket repositories?

Finally got it working. Now using http basic authentication to connect Heroku with Bitbucket. Followed these steps:

Converted the repository urls my package.json (containing my private packages) from: git@bitbucket.org:private-repo/private-repo.git to:

https://username@bitbucket.org/private-repo/private-repo.git

Then added the following config to my composer.json:

"config": {
    "bitbucket-oauth": {
        "bitbucket.org": {
            "consumer-key": "Bitbucket username",
            "consumer-secret": "Bitbucket password"
        }
    }
}

Its not recommended to store your password in a plain-text file but unfortunately Bitbucket does not give us a choice

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM