Skip to content

project_authorizations not populated for old users who haven't signed in since upgrade

Summary

Accounts created on to do automatic git pushes from etckeeper fail with:

GitLab: The project you were looking for could not be found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

This appears to be because project_authorizations is only updated when the user logs in to the web interface. It needs to happen on upgrade too, as it being empty locks out the automated push. Or the git permission check needs to do it.

See also https://forum.gitlab.com/t/8-15-broke-all-my-machine-accounts/5632

Note that it happens both on our company's CE instance as well as on GitLab.com.

Steps to reproduce

Create a user on an older version of gitlab. Set up an SSH key. Confirm pushing works. Upgrade. Push now fails.

Expected behavior

Push succeed

Actual behavior

Error, above

Relevant logs and/or screenshots

(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's very hard to read otherwise.)

Output of checks & Results of GitLab environment info

In forum post

Possible fixes

(If you can, link to the line of code that might be responsible for the problem)