Skip to content

GitLab VCS token expired and not renewed #2083

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jiin995 opened this issue Apr 29, 2025 · 3 comments
Open

GitLab VCS token expired and not renewed #2083

jiin995 opened this issue Apr 29, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@jiin995
Copy link
Contributor

jiin995 commented Apr 29, 2025

Bug description 🐞

Hi team,
I noticed that the GitLab OAuth tokens were not refreshed as expected. The tokens had expired while my cluster was undergoing maintenance, and no automatic refresh was triggered afterwards.
When i made plan on workspace connected to VCS i have plan without commitID and investigating we found problem with expire of GitLab access Token.
Image

To resolve the issue, I had to manually update the status of the tokens to PENDING directly in the database. After that, the reconnection worked without needing to change the access or secret tokens.

It seems like the system didn't retry the refresh once the cluster came back online.
Would it be possible to implement a retry mechanism or a check for expired tokens after downtime?

Let me know if you need any additional logs or details.

Thanks!

Image

Steps to reproduce

Configure GitLab as VCS and try to change expire in database.

Expected behavior

When use vps if token it's expired refresh it, or allow to disconnect and reconnect to vpc from Web-UI

Example repository

No response

Anything else?

No response

@jiin995 jiin995 added the bug Something isn't working label Apr 29, 2025
@alfespa17
Copy link
Member

Hello @jiin995

Gitlab token expires after 2 hours

there is a internal job that updates the token every 1 hour

// Refresh token every hour, GitLab Token expire after 2 hours (7200 seconds)

Not really sure why the token was not refresh after the job was executed

@jiin995
Copy link
Contributor Author

jiin995 commented Apr 30, 2025

I find the same problem in all organizations, perhaps it's related to shutdown of k8s cluster?
It's possible to add check before job start that eventually refresh gitlab token?

@alfespa17
Copy link
Member

I find the same problem in all organizations, perhaps it's related to shutdown of k8s cluster? It's possible to add check before job start that eventually refresh gitlab token?

Yes, I guess is related to the cluster shutdown because the schedule job did not run to renew the gitlab token but the job to renew it is scheduled every hour so it should have run once you started the cluster again in the next 60 minutes, so I am not really sure what happen there.

I will have to think what could be the best approach in this case to manage token refresh if the cluster is shutdown in some moment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants