Open thinkernel opened 7 years ago
Anonymous Coward
Username that this displayed in the Gerrit WebUI and in e-mail notifications if the full name of the user is not set.
Did you set the full name?
How do you run this scripts? Via nohup, or one after another? Sounds like race condition
Yes, it's a nohup. I use the gerrit-init.nohup to add the jenkins user with full name provided.
After the restart, the full name of the Jenkins user can be showed correctly.
Could you try to do this without nohup, but with awaiting in place. Just one after another, to exclude any race conditions.
Also it might be great idea to put scripts with leading numbers like:
Also problem could be in the location of the scripts execution. I've slightly modified my copy of entrypoint.sh
...
echo
for f in /docker-post-init.d/*; do
case "$f" in
*.sh) echo "$0: running $f"; source "$f" ;;
*.nohup) echo "$0: running $f"; nohup "$f" & ;;
*) echo "$0: ignoring $f" ;;
esac
echo
done
fi
exec "$@"
\EOF
And Dockerfile
...
RUN mkdir /docker-entrypoint-init.d
RUN mkdir /docker-post-init.d
...
This way I'm convinced that some of the scripts had run before, and other part are after Gerrit startup.
To add a leading number is a good idea. I will give it a try tomorrow. All the user adding functions goes through the REST API of gerrit. I really can't figure out how can the race conditions happen. Btw, I need more details about the /docker-post-init.d. How can you make these scripts under this directory executed after gerrit-start.sh?
Logs show that user jenkins are added successfully but the exists check after that failed.
Login to the Gerrit as the admin and check the users in the Non-Interactive Group shows an Anonymous Coward instead of a jenkins user has alread been added in the group.
Exec a command like below in the container echoes a 404 as the return code.
curl --output /dev/null --silent --write-out "%{http_code}" "http://localhost:8080/gerrit/accounts/jenkins"
Try to reindex the accounts by using the command below gives an exception shows a write lock.
su-exec ${GERRIT_USER} java ${JAVA_OPTIONS} ${JAVA_MEM_OPTIONS} -jar "${GERRIT_WAR}" reindex --verbose --index accounts -d "${GERRIT_SITE}"
This issue only happens in 2.14.x. The 2.13.x looks good.