Z
Zerops4w ago
vavo

Gitlab integration: expired token

Hello, We are experiencing an issue with the GitLab integration for deploying our project on Zerops. Every time we push to the connected branch, the integration fails. Zerops triggers the pipeline, but the loaded zerops.yml file is empty, the log output is empty, and the only relevant information we receive is via email: Pipeline couldn't start because: Gitlab authorisation is invalid or expired { "gitlab-response": [ "{error: invalid_token}, {error_description: Token is expired. You can either do re-authorization or token refresh.}" ] } I removed the connected app from GitLab along with the webhooks and then reconnected the GitLab integration. This resolved the issue temporarily: the pipeline was triggered and successfully finished. However, after a few hours, the next push failed again with the same error.
5 Replies
Michal Saloň
Michal Saloň4w ago
Hello, yes we are aware of that, GitLab changed how the tokens work, and it flew under our radar as most people use GitHub or our zCLI. Currently the token expires every 2 hours :catSad:
vavo
vavoOP4w ago
Hello, Michal. Thank you for your reply. I'm guessing you don't plan on fixing it anytime soon, right?
Michal Saloň
Michal Saloň4w ago
Hi, we would like to, but it's not a simple fix, and GitLab isn't used by that many people, it's a bit lower in our priorities, but it's definitely still there. For now I would probably recommend trying to use GitLab CI/CD with our zCLI to push from GitLab. Here is a simple config which should give you 2 jobs deploy:dev (on branches) and deploy:prod (on tags) which pushes the code Zerops via zCLI. You just need to change XYZ for correct PROJECT and SERVICE IDs and also create a variable ZEROPS_ACCESS_TOKEN in you GitLab settings for that project, so zCLI can login and it should work. If it doesn't let me know, i will try to help you make it work. Access token can be generated on this page: https://app.zerops.io/settings/token-management
Aleš
Aleš4w ago
push doesn't even need projectId anymore
vavo
vavoOP3w ago
Hello, thank you. I will try the config file! 😉

Did you find this page helpful?