I don't know how necessarily say this correctly, as I simply am not sure what is happening.

I've got a website that is being updated using gitlab ci. When attempting to push new code today I received an error. It was terribly non-descriptive and related to the site itself. It was a Drupal site and I was trying to install a custom module.

The module CustomModule cannot be installed because it's missing a dependency module

It provided a fully blank file name for a module.

After digging I managed to find the problem. Somehow, the server has received files from two different points in commit history. I had not previously pushed this branch to the server. On the server some files were from the latest commit and others were from what looked like the first commit from that branch.

This sounds really wacky and I agree. I noticed that the site was telling me my module that I was pushing was missing a dependency, when I looked at what it was missing it listed a dependency that I had NOT listed (it was entirely wrong, no question).

After looking at the new files I realised, some were from an earlier commit. It wasn't just grabbing an earlier version of all files because some files were from the latest commit. I checked the jobs and it listed all the files in the call to rsync.

The rsync call looks like :
rsync -av --no-perms --no-owner --no-group --exclude-from '.gitlabci-rsync-exclude.txt' --exclude '.git' --delete ./ $RSYNC_DESTINATION

What makes this even stranger is that minutes before this happened, the exact same job ran to merge some updates and that went off without a hitch. Then this one made the jobs fail.

I don't know what more info I can give as I am not terribly sure what is happening. Any ideas or more info you would need?

  • "It was terribly non-descriptive and related to the site itself" - can you share this error with us? It would be useful to get some insight into what went wrong... feel free to obscure sensetive information if necessary.
    – Attie
    May 27 '20 at 9:30
  • "the server has received files from two different points in commit history" - please clarify this statement... e.g: are you building files that result in different names based on their content to avoid cache issues, and the wrong one is being referenced? (like webpack and friends might do)...
    – Attie
    May 27 '20 at 9:32
  • Can you confirm that your repository's HEAD (or what was HEAD when you saw the issue) is actually valid and deploys correctly using the same commands to a clean local / staging infrastructure?
    – Attie
    May 27 '20 at 9:33
  • I've updated the question to include some info for the first two. On my local the head of the repo works perfectly fine. This is using Docker setup.
    – Derek C.
    May 27 '20 at 15:55
  • If you're using docker, then why are you using rsync? The container / image should contain all of the necessary files, and you should really be trying to use docker push / docker pull to update the service, and avoiding rsync...
    – Attie
    May 27 '20 at 17:14

Rsync may have some weird side effects .

You will probably have some more luck by creating (and archiving) tar files, then transferring those versioned files, then untar them.

In your .ci file, tar and archive an date/time/commit-id tar with the same exclusions, then rsync it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.