Travis Builds Failing - Even Previously Passing Builds

As of January 11, 2023 all my travis builds are failing. I tested the builds locally and they are not throwing any errors. I even re-ran a build that passed yesterday afternoon (1/10/2023) and now that build is also failing and throwing the same error as all recent builds from today. My git repo is clean, so this error makes no sense to me and it passes all tests locally. I believe the error is a product of the new deployed changes to Travis CI. The error I’m getting is:

[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.

Raw log: https://api.travis-ci.com/v3/job/593100209/log.txt?log.token=OM6eooiXf9p3YyXs3gU-Tw

Hi @sakibahmed91,

This has to do with your source repo, so nothing you do related to deploys. In your .gitignore file add:

/travis_wait*

Then retry, let me know if that works.

Hi Montana,

I already have that line in my .gitignore file. My builds are still failing and this issue started today.

Is there anything else I can try?

Hey,

I haven’t seen your .travis.yml but I’m assuming you’re using composer-merge-plugin, and I don’t recommend that unless you have a super specific need for it, not because it’s a bad project or anything but just because it can lead to so many unexpected edge cases like this.

Composer wasn’t built to have dependencies “sideloaded”, in turn you get weird outcomes like this. BLT used composer-merge-plugin up to version 10, and then removed it for these reasons. Maybe try downgrading the version of BLT you’re using.

I do see the log, but it’d be easier for me to parse through the original .travis.yml.

I’m using BLT 13.7 (latest version).

Here is my .travis.yml. I had no issues deploying this build yesterday. Nothing has changed on my end.

sudo: true
language: php
dist: xenial

# Adjust the version of PHP to match your production environment.
# Making this version number greater than the production environment can have unintended consequences
# including a non-functional prod environment.
php: "8.1.10"

matrix:
  fast_finish: true

jdk:
  - oraclejdk8

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

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

services:
- mysql
- xvfb

addons:
  ssh_known_hosts:
     - svn-29892.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 --2
  - composer validate --no-check-all --ansi
  - composer install
  # Exit build early if only documentation was changed in a Pull Request.
  - source ${BLT_TRAVIS_DIR}/scripts/exit_early

install:
  - source ${BLT_TRAVIS_DIR}/scripts/setup_environment
  - source ${BLT_TRAVIS_DIR}/scripts/setup_project

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

deploy:
   - provider: script
     script: "${BLT_TRAVIS_DIR}/scripts/deploy_branch"
     skip_cleanup: true
     on:
       branch: master
       php: 8.1.10
   - provider: script
     script: "${BLT_TRAVIS_DIR}/scripts/deploy_tag"
     skip_cleanup: true
     on:
       tags: true
       php: 8.1.10

Just to see if this works can you downgrade BLT to 9.2.4 and then retry?

I cannot downgrade BLT. My project is built on Drupal 9 which requires BLT 12, which is EOL now, and the latest version is BLT 13.

We just started seeing this today as well. In the past its been caused by source ${BLT_TRAVIS_DIR}/scripts/simulate_deploy. Im debugging right now but you can try removing that for now.

Try adding in your .travis.yml file:

composer update drupal/core --with-all-dependencies

Also try in your before_script having this line:

composer self-update 2.0.14

Unfortunately, that did not work.

Im not sure what is adding this yet but this is the problem file:

0.02s$ git status
HEAD detached at 229abe8
Untracked files:
  (use "git add <file>..." to include in what will be committed)
	LICENSE.chromedriver

Try adding - rm LICENSE.chromedriver before the simulate deploy

1 Like

Have you tried running git stash?

This takes the dirty state of your working directory — that is, your modified tracked files and staged changes — and saves it on a stack of unfinished changes that you can reapply at any time (even on a different branch), or try removing the Chromedriver license.

2 Likes

Thanks, this worked!

1 Like

Thanks, I appreciate the help. Removing the file before simulate deploy solved the problem.

Hi @sakibahmed91,

Great to hear!