I have a gitlab ci job that keeps failing with a “fatal: reference is not a tree” error. Google and IRC have turned up nothing.
My .gitlab-ci.yml file:
stages: - build - test - deploy job_deploy_master: stage: deploy only: - master script: - bash scripts/deploy_master tags: - tagname
My scripts/deploy_master file:
localuser is the user that owns the directory the project lives in.
#!/bin/bash ssh -t -t -o 'StrictHostKeyChecking no' -o 'PasswordAuthentication no' -o 'PubkeyAuthentication yes' -i '/home/gitlab-runner/.ssh/localuser.key' localuser@localhost <<EOF cd /home/localuser/path/to/project git fetch origin git reset --hard origin/master git submodule update --init exit EOF
My runner is a shell runner running on the server I’m deploying code to.
The output I get:
gitlab-ci-multi-runner 0.6.0 (4c26bc5) Using Shell executor... Running on hostname... Fetching changes... Checking out dbed0c03 as master... fatal: reference is not a tree: <ssha hash> ERROR: Build failed with: exit status 1
All my google searches for “fatal: reference is not a tree” come up with articles saying I haven’t pushed the referenced commit to the submodules project. Which is not the case here. Plus, the reference in the error is the reference of the projects commit, not the submodules.
Note that if I run the commands in the deploy script manually, everything works fine.
My gitlab server is using the Omnibus package. 8.0.3. OS is Ubuntu 14.04 64bit.
The server the runner is on, and I’m trying to deploy code to, is running Ubuntu 12.04, and the runner is installed from the repository via apt.