open-lms-open-source / moodle-plugin-ci

Assist with running a Moodle plugin in Travis CI
https://blackboard-open-source.github.io/moodle-plugin-ci/
GNU General Public License v3.0
42 stars 37 forks source link

Build fails during initialisation process #56

Open FMCorz opened 7 years ago

FMCorz commented 7 years ago

I'm not sure what is going on, but I'm hitting this:

$ moodle-plugin-ci install

 4/7 [================>-----------]  57% 9 secs [Install dependencies]

  [Symfony\Component\Process\Exception\ProcessFailedException]                                                                                                                                                                                                                                                        

  The command "composer install --no-interaction --prefer-dist" failed.                                                                                                                                                                                                                                               

  Exit Code: 1(General error)                                                                                                                                                                                                                                                                                         

  Working directory: /home/travis/build/moodle                                                                                                                                                                                                                                                                        

  Output:                                                                                                                                                                                                                                                                                                             

  ================                                                                                                                                                                                                                                                                                                    

  Error Output:                                                                                                                                                                                                                                                                                                       

  ================                                                                                                                                                                                                                                                                                                    

  Loading composer repositories with package information                                                                                                                                                                                                                                                              

  Failed to clone the git@github.com:moodlehq/moodle-behat-extension.git repository, try running in interactive mode so that you can enter your GitHub credentials                                                                                                                                                    

    [RuntimeException]                                                                                                                                                                                                                                                                                                

    Failed to execute git clone --mirror 'git@github.com:moodlehq/moodle-behat-extension.git' '/home/travis/.composer/cache/vcs/git-github.com-moodlehq-moodle-behat-extension.git/'                                                                                                                                  

  install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...  

install [--moodle MOODLE] [--data DATA] [--repo REPO] [--branch BRANCH] [--plugin PLUGIN] [--db-type DB-TYPE] [--db-user DB-USER] [--db-pass DB-PASS] [--db-name DB-NAME] [--db-host DB-HOST] [--not-paths NOT-PATHS] [--not-names NOT-NAMES] [--extra-plugins EXTRA-PLUGINS]

The command "moodle-plugin-ci install" failed and exited with 1 during .

Your build has been stopped.

Would that be that there are too many requests coming from Travis? Or is it the branch?

This particular failure happened on 2.7 and 2.8 with PHP 5.4, but I've noticed it happening with other combinations.

Full build: https://travis-ci.org/FMCorz/moodle-block_xp/builds/273875512

mackensen commented 7 years ago

I've seen this too, and only with older Moodle releases (pre 3.0 I think). This might be related to MDL-50732; with the VCS upstream specified prefer-dist doesn't failover correctly and you hit the GitHub credentials limit.

polothy commented 7 years ago

I tried removing --prefer-dist and the same error occurred. Maybe something changed with the new Trusty image?

I couldn't find anything helpful, so you will likely have to do something like this: https://github.com/moodle/moodle/blob/master/.travis.yml#L99

That way Composer can authenticate with GitHub and get around any API rate limits.

adrian-sarmas commented 5 years ago

I still get this error. Are there any other workarounds?

adrian-sarmas commented 5 years ago

Could you have a look at this? https://travis-ci.org/elearningsoftware/moodle-mod_journal/jobs/482905389 I'm looking for another workaround as the one @polothy added is not working for me. Any help would be greatly appreciated!

polothy commented 5 years ago

Have you tried adding a GitHub API token?

https://github.com/moodle/moodle/blob/0e1e1e5586a1f43c951d9a399243220a3ccf882c/.travis.yml#L98

https://getcomposer.org/doc/articles/troubleshooting.md#api-rate-limit-and-oauth-tokens

polothy commented 5 years ago

Looking at your build log, looks like you did. I assume you added GITHUB_APITOKEN to your Travis settings for the project.

adrian-sarmas commented 5 years ago

Sorry for the late reply. Yes, I've added GITHUB_APITOKEN to travis settings. I still have this issue. Any ideas?