Migration Error: Invalid OAuth client credentials

I was trying to to complete the last step of migration drone/migrate update-repos And I have this error
time=“2019-06-13T23:56:14Z” level=error msg=“failed to get remote repository” error=“Get https://api.bitbucket.org/2.0/repositories//: Invalid OAuth client credentials” owner=user repo=
Looks like docker container do not see my BB client id/secret. How I can debug and check which env vars migration docker is using?

I see owner=user which I am guessing has been masked … but this generally tells me that the user that “owns” the repository either revoked their access to Drone, or had their access to the repository revoked by the repository admin or organization admin. If this is the case, the repository probably no longer works in 0.8 anyway, in which case you can disable in 0.8 and then re-run your migration.

But should not it has access to repos no matter who is owner is. Cause I’m using BitBucket AccessToken for our organization, not user?
I provided env var to docker container
but I have same failed to get remote repository error even if I do not provide them. So my guess container do not use them, I have no idea how to debug it.

When I use clientId and Client secret via cUrl I was able to get meta info for repo

Drone does not use the client_id or client_secret for this purpose. It uses the oauth2 token that is attached to the user that activated the repository. The client_id and secret are used to refresh the oauth2 token if expired.

While it may be possible for client_id and secret to access a resource, this is not how the migration utility works. Based on the error you described, revoked token or access is the most likely root case based on the limited information I have available.

Yeah, you are absolutely right. I’ve reactivated repos and after I was able to successfully migrate report meta data.
But I did not have access to couple repos, is it safe for me to delete it in repos table?

Yes, you should have two options:

  1. delete these repositories from the 1.0 database and finish the migration
  2. disable these repositories in drone 0.8 and re-run the migration
1 Like