Skip to content
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

Can't synchronize GitLab repositories anymore #594

Open
gsusI opened this issue Jun 8, 2022 · 18 comments
Open

Can't synchronize GitLab repositories anymore #594

gsusI opened this issue Jun 8, 2022 · 18 comments

Comments

@gsusI
Copy link

gsusI commented Jun 8, 2022

Can't synchronize GitLab repositories anymore

Steps to reproduce the issue:

  1. Go to Gitlab and open User Settings > Applications
  2. Revoke Repman from the list of Authorized Applications
  3. Unlink GitLab from Repman User settings
  4. Go to https://app.repman.io/organization//package
  5. Click on Add package
  6. Select GitLab
  7. Authenticate with GitLab
  8. Authorize Repman to access your GitLab repositories
  9. Select the repositories to be synchronized
  10. Click Add
  11. In the list of packages, all packages appear with a red message saying "SYNCHRONIZATION ERROR"

SYNCHRONIZATION ERROR

Error: Failed to execute git clone --mirror -- 'https://oauth2:***@gitlab.com/<organization>/<package>.git' '/home/repman/.composer/cache/vcs/git-gitlab.com-<organization>-<package>.git/'

Cloning into bare repository '/home/repman/.composer/cache/vcs/git-gitlab.com-<organization>-<package>.git/'...
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'https://oauth2:***@gitlab.com/<organization>/<package>.git/'

Logs:
Failed to clone the [email protected]:<organization>/<package>.git repository, try running in interactive mode so that you can enter your credentials
@gsusI
Copy link
Author

gsusI commented Jun 9, 2022

A colleague of mine managed to add the packages without any issue following the same steps as me. Unsure why.

Could it be related to this issue?

@Fahl-Design
Copy link
Contributor

looks more like #589

@gsusI
Copy link
Author

gsusI commented Jun 9, 2022

Doesn't feel like. Repman was able to get the list of repositories, suggesting that the tokens were fine.

Also, I didn't get a 500 error, nor a Bad Request.

@Fahl-Design
Copy link
Contributor

hm ok, did you check the token itself?
there is an endpoint for that:

https://gitlab.com/oauth/token/info?access_token=<YOUR_TOKEN>

maybe it is missing a scope

@althaus
Copy link

althaus commented Jun 10, 2022

We also get the same since updating our Gitlab from 14 to 15. It's just happening to existing packages if someone releases a new version.

grafik

@prhost
Copy link

prhost commented Jul 6, 2022

I'm getting this error when downloading the source, only dist is working.

Screen Shot 2022-07-06 at 11 41 20

@shochdoerfer
Copy link
Contributor

Having the same issue with our self-hosted GitLab instance. Sync stopped working after the upgrade to GitLab 15. I had to remove the OAuth application configuration in GitLab and set it up again. After that things seem to work normally again.

@temp
Copy link

temp commented Aug 1, 2022

Same Problem here. Tried to re-register the oauth app in gitlab (self hosted), as stated by @shochdoerfer , but still the same git error as mentioned above. Any hints? We also upgrade from gitlab 14.x to 15.1 on friday, so this seems related.

@shochdoerfer
Copy link
Contributor

@temp I gave the OAuth app in GitLab almost all (read-only permissions) because I was not sure which ones are the correct ones. Maybe you could give this a try as well.

@Fahl-Design
Copy link
Contributor

I still think it's related to #589 with it's root cause of expired refresh tokens.
The refresh token is never updated without #596

@temp
Copy link

temp commented Aug 2, 2022

We applied MR #596 and emptied the user_oauth_token table, after that it worked again.
@shochdoerfer we tried that before, but without success. Now we are back to api and read_users, as stated in the docs.

@temp
Copy link

temp commented Aug 2, 2022

... and now it's not working anymore -_-
Now I'm getting a Bad Request when he tries to fetch a new token from gitlab via /oauth/token.

@f3l1x
Copy link

f3l1x commented Oct 31, 2022

Same error at me.

@shochdoerfer
Copy link
Contributor

Ran into the issue again. After truncating the user_oauth_token db table, deleting and re-creating the GitLab app, it works again.

@pavkatar
Copy link

Found a workaround:

The token expires every day.
Go to the database > user_oauth_token. Delete token for the GitLab.
After that, go to the Admin UI > Packages > Add new package > Select GitLab and wait. This will generate a new token and will work for a day.

@prhost
Copy link

prhost commented Nov 18, 2022

Found a workaround:

The token expires every day. Go to the database > user_oauth_token. Delete token for the GitLab. After that, go to the Admin UI > Packages > Add new package > Select GitLab and wait. This will generate a new token and will work for a day.

I already did that, you don't even need to go to the database to delete, just go to your user in the interface, and unlink Gitlab Account.

@prhost
Copy link

prhost commented Nov 18, 2022

I think that even the only solution will be to create a schedule in the project that does this every day from time to time.

@prhost
Copy link

prhost commented Mar 2, 2023

Now I'm getting this error when selecting repositories from gitlab:

Screenshot 2023-03-02 at 12 06 20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants