runners can't repeat a successful build
I find I can't repeat a successful build:
gitlab-ci-multi-runner 0.4.2 (1e86428)
Using Shell executor...
bash: line 5: builds/c08e060a/0/libsys/CI-test.sh: cannot overwrite existing file
Build failed with exit status 1
For some reason a shell runner can't overwrite a shell script that it created.
ll
total 8
drwxr-xr-x 4 root root 4096 Jun 24 13:36 CI-test
-rw-r--r-- 1 root root 996 Jun 24 13:36 CI-test.sh
I can remove to builds directory manually and then it will re-pull and run, but it isn't a viable workaround to remove the builds dir everytime.
Designs
- Show closed items
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Maintainer
On what system does it happen? Can you post some details?
- Author
Redhat 6. Using the repo install, not from source. Setup runner and am able to have it run a job fine, but if I run another or retry a job it gives the error.
- Maintainer
The file should be overwritten without any problems.
However it's interesting why the files are made by
root
?Can you post:
cat /etc/init.d/gitlab-ci-multi-runner
ps auxf | grep gitlab-ci-multi-runner
- Author
Here you go...
$ cat /etc/init.d/gitlab-ci-multi-runner #!/bin/sh # For RedHat and cousins: # chkconfig: - 99 01 # description: GitLab Runner # processname: /usr/bin/gitlab-ci-multi-runner # Source function library. . /etc/rc.d/init.d/functions name="gitlab-ci-multi-runner" desc="GitLab Runner" user="root" cmd=/usr/bin/gitlab-ci-multi-runner args=" "run" "--config" "config.toml"" log_file="/var/log/$name.log" lockfile=/var/lock/subsys/$name # Source networking configuration. [ -r /etc/sysconfig/$name ] && . /etc/sysconfig/$name start() { echo -n $"Starting $desc: " daemon --user=$user bash --login -c "'exec $cmd $args 1>&3 2>&3 &'" 3>> $log_file retval=$? [ $retval -eq 0 ] && touch $lockfile echo return $retval } stop() { echo -n $"Stopping $desc: " killproc $cmd -TERM retval=$? [ $retval -eq 0 ] && rm -f $lockfile echo return $retval } restart() { stop start } reload() { echo -n $"Reloading $desc: " killproc $cmd -HUP RETVAL=$? echo } force_reload() { restart } rh_status() { status $cmd } rh_status_q() { rh_status >/dev/null 2>&1 } case "$1" in start) rh_status_q && exit 0 $1 ;; stop) rh_status_q || exit 0 $1 ;; restart) $1 ;; reload) rh_status_q || exit 7 $1 ;; force-reload) force_reload ;; status) rh_status ;; condrestart|try-restart) rh_status_q || exit 0 ;; *) echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" exit 2 esac
$ ps auxf | grep gitlab-ci-multi-runner root 22567 0.1 0.5 477700 9924 ? Sl Jun24 1:42 /usr/bin/gitlab-ci-multi-runner run --config config.toml
From your response I surmise that the
/usr/bin/gitlab-ci-multi-runner
should be running as the ci runner account? - Maintainer
Did you do hand installation?
- Maintainer
There was a problem with not properly updated init.d script. Can you uninstall and install it once again (it will preserve all configuration)?
- Author
No joy on uninstall, reinstall.
Still get same error.
Also, it looks like the
gitlab-ci-multi-runner
command doesn't work right. I didsudo -u gitlab_ci_multi_runner -H gitlab-ci-multi-runner stop
and it killed the gitlab-ci-runner process but didn't kill it nicely:sudo /etc/init.d/gitlab-ci-multi-runner status gitlab-ci-multi-runner dead but subsys locked
- Author
I had one more thought. In our setup we use a NFS mount for home directory for users.
I had to customize the /etc/passwd to get it to work.
gitlab_ci_multi_runner:x:2669:2669:GitLab Runner:/usr/local/home/gitlab_ci_multi_runner:/bin/bash
Perhaps the path
/home/gitlab_ci_multi_runner
is hard coded somewhere? - Author
still doesn't work with 7.12.2
- Kamil Trzcińśki Milestone changed to v0.6.0
Milestone changed to v0.6.0
- Maintainer
Do you have noclobber enabled in your shell?
- Author
yes.
- Maintainer
Ok. That's the problem.
- username-removed-1923 Status changed to closed
Status changed to closed