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

Travis CI deployment fails due to "uncommitted" travis_wait* log file #4012

Closed
UTCGilligan opened this issue Feb 13, 2020 · 8 comments · Fixed by #4016
Closed

Travis CI deployment fails due to "uncommitted" travis_wait* log file #4012

UTCGilligan opened this issue Feb 13, 2020 · 8 comments · Fixed by #4016
Labels
Support A support request

Comments

@UTCGilligan
Copy link
Contributor

UTCGilligan commented Feb 13, 2020

I want to...
Deploy from Travis CI an updated Github private codebase with Drupal 8.8 and BLT 11 (recently updated from D8.7.1/BLT10.7.2).

I can...
Deploy direct from local to Acquia Cloud Enterprise via ads deploy). Site also builds locally via blt setup, and has been successfully deployed to ACE Stage environment by tag and tested with refreshed prod database and files. "IT JUST WORKS!"

Github/Travis deploy fails.

I have also tried deleting the Travis log and restarting the build, and triggered a new build via a minimal code commit/PR/merge in Github.

It's not working because...
Entire Travis CI build process passes, but fails at deployment.

blt artifact:deploy --commit-msg "Automated commit by Travis CI for Build ${TRAVIS_BUILD_ID}" --branch "${TRAVIS_BRANCH}-build" --no-interaction --verbose
1145 ?? travis_wait_2130.log
1146 [error]  There are uncommitted changes on the source repository (listed above). Commit, stash, or remove these changes before deploying, or use the --ignore-dirty flag. Additional guidance is available at https://support.acquia.com/hc/en-us/articles/360035204013-Dirty-BLT-source-directory-prevents-deploys.
1147 For troubleshooting guidance and support, see https://docs.acquia.com/blt/support/ 
1148 0.238s total time elapsed.
1149
1150 Script failed with status 1
1151 failed to deploy

Project's travis.yml:

language: php
dist: xenial

php:
  - 7.3

matrix:
  fast_finish: true

env:
  global:
    - COMPOSER_BIN=$TRAVIS_BUILD_DIR/vendor/bin
    - BLT_DIR=$TRAVIS_BUILD_DIR/vendor/acquia/blt
    - BUILD_DIR=$TRAVIS_BUILD_DIR

jdk:
  - oraclejdk8

cache:
  bundler: true
  apt: true
  directories:
    - "$HOME/.npm"
    - "$HOME/.nvm"
    - "$HOME/.composer/cache"
    - "$HOME/.drush/cache"
    - ".rules"
    # Cache front end dependencies to dramatically improve build time.
    - "docroot/themes/custom/xxx_st/node_modules"
    - "docroot/themes/custom/xxx_st/bower_components"
    - "docroot/themes/custom/xxx/node_modules"
    - "docroot/themes/custom/xxx/bower_components"

services:
- mysql
- xvfb

addons:
  ssh_known_hosts:
  # xxx app
  #  - svn-redacted.devcloud.hosting.acquia.com
  # xxx app
    - svn-redacted.prod.hosting.acquia.com
    - staging-redacted.prod.hosting.acquia.com
  chrome: stable

# @see https://docs.travis-ci.com/user/notifications
# notifications:
#   - hipchat: [api token]@[room id or name]
#   - slack: '<account>:<token>#[channel]'

before_install:
  # Disable xdebug.
  - phpenv config-rm xdebug.ini
  - composer self-update
  - composer validate --no-check-all --ansi
  - composer install
  # Exit build early if only documentation was changed in a Pull Request.
  - source ${BLT_DIR}/scripts/travis/exit_early

install:
  - source ${BLT_DIR}/scripts/travis/setup_environment
  - source ${BLT_DIR}/scripts/travis/setup_project

script:
  # Uncomment these lines to test database updates using live content.
  # - blt drupal:sync:default:site
   - source ${BLT_DIR}/scripts/travis/run_tests
   - source ${BLT_DIR}/scripts/travis/simulate_deploy

deploy:
   - provider: script
     script: "${BLT_DIR}/scripts/travis/deploy_branch"
     skip_cleanup: true
     on:
       branch: develop
       php: 7.3
   - provider: script
     script: "${BLT_DIR}/scripts/travis/deploy_branch"
     skip_cleanup: true
     on:
       branch: master
       php: 7.3
   - provider: script
     script: "${BLT_DIR}/scripts/travis/deploy_tag"
     skip_cleanup: true
     on:
       tags: true
       php: 7.3

System information

  • Operating system type: Travis CI Ubuntu
  • Operating system version: N/A
  • BLT version: 11.2.0
@UTCGilligan UTCGilligan added the Support A support request label Feb 13, 2020
@UTCGilligan
Copy link
Contributor Author

I see from #3927 that /travis_wait* should be ignored... but apparently it is not.

I did update my project's travis.yml with the simulate_deploy script, and it gives me the same error on a PR test build:

The command "source ${BLT_DIR}/scripts/travis/run_tests" exited with 0.
1119 $ source ${BLT_DIR}/scripts/travis/simulate_deploy
1120
1121 blt artifact:deploy --dry-run --commit-msg "Automated commit by Travis CI for Build ${TRAVIS_BUILD_ID}" --no-interaction --verbose
1122 [warning] This will be a dry run, the artifact will not be pushed.
1123 ?? travis_wait_1963.log
1124 [error]  There are uncommitted changes on the source repository (listed above). Commit, stash, or remove these changes before deploying, or use the --ignore-dirty flag. Additional guidance is available at https://support.acquia.com/hc/en-us/articles/360035204013-Dirty-BLT-source-directory-prevents-deploys.
1125 For troubleshooting guidance and support, see https://docs.acquia.com/blt/support/ 

@UTCGilligan UTCGilligan changed the title Travis CI deployment fails due to "uncommitted" log file Travis CI deployment fails due to "uncommitted" travis_wait* log file Feb 13, 2020
@UTCGilligan
Copy link
Contributor Author

UTCGilligan commented Feb 13, 2020

I did also add /travis_wait* in blt/deploy-exclude-additions.txt, but this also failed with the same error on a travis_wait_xxxx.log file

@UTCGilligan
Copy link
Contributor Author

I am currently working around this issue by patching acquia/blt/scripts/deploy_branch and simulate_deploy to restore the --ignore-dirty flag.

@danepowell
Copy link
Contributor

There are uncommitted changes on the source repository

This has only to do with your source repo, so nothing you do related to deploys (such as the deploy-exclude-additions file) is likely to help.

I suspect you don't have travis_wait in your root .gitignore: https://github.com/acquia/blt/blob/11.2.0/subtree-splits/blt-project/.gitignore#L37

Let me know if that solves the issue and maybe we need to add it to an update hook.

@UTCGilligan
Copy link
Contributor Author

UTCGilligan commented Feb 17, 2020

@danepowell Yes, that did the trick. The upgrade from 10.7 to 11.2 was fairly well automated, but it was missing the travis_wait in .gitignore. I have removed the patches, added to .gitignore, and deployments are passing at least the PR travis test. I like the addition of the simulated_deploy, that really does help identify problems.

@danepowell
Copy link
Contributor

Thanks for the feedback. I added an update hook so that hopefully future upgraders don't encounter the same issue: #4016

@UTCGilligan
Copy link
Contributor Author

Thank you, and I can verify builds and deployments are passing now.

@jamescw
Copy link

jamescw commented Jun 25, 2021

Thank you so much, I found this issue after hitting the same problem and indeed it was due to the missing set of rules in our gitignore

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

Successfully merging a pull request may close this issue.

3 participants