bitrise-steplib / steps-ios-auto-provision-appstoreconnect

MIT License
15 stars 16 forks source link

FORBIDDEN_ERROR: This request is forbidden for security reasons: Unable to find a team with the given Content Provider ID #14

Closed christiankm closed 3 years ago

christiankm commented 4 years ago

Hi there,

I was using Bitrise to archive and export my app on build to App Store TestFlight.

After the "recent" change in App Store Connect APIs to fix the 2FA problems, I setup this build step instead, and I THINK it worked in the beginning, but after some time it stopped working, and I could not get past the error below.

Any help is most appreciated. I have tried to recreate certificates and profiles, and they are uploaded to Bitrise. Local builds and exports are running just fine, so im having to use that for now, but obviously this is not ideal.

I have no idea whether its some settings inside App Store Connect, or Bitrise, or perhaps Xcode that I need to fix. I reached out to Apple Developer Support but they would not help, and told to contact Bitrise, or the step developer.

Please help.

Thank you for your work!

+------------------------------------------------------------------------------+

| (3) ios-auto-provision-appstoreconnect@0                                     |
+------------------------------------------------------------------------------+
| id: ios-auto-provision-appstoreconnect                                       |
| version: 0.1.0                                                               |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: go                                                                  |
| time: 2020-07-30T20:15:43Z                                                   |
+------------------------------------------------------------------------------+
|                                                                              |
Config:
- BuildAPIToken: [REDACTED]
- BuildURL: https://app.bitrise.io/build/57487b8a7a92f799
- ProjectPath: Stokki.xcodeproj
- Scheme: Stokki
- Configuration: Release
- Distribution: app-store
- MinProfileDaysValid: 0
- CertificateURLList: [REDACTED]
- CertificatePassphraseList: *****
- KeychainPath: /Users/vagrant/Library/Keychains/login.keychain
- KeychainPassword: *****
- VerboseLog: false
Creating AppstoreConnectAPI client
the client created for https://api.appstoreconnect.apple.com/
Analyzing project
configuration: Release
project team ID: [REDACTED]
bundle IDs:
- xxx.xxxxxx.xxxxxx
platform: iOS
Downloading certificates
2 certificates downloaded:
- Apple Development: Christian Mitteldorf ([REDACTED])
- Apple Distribution: Christian Mitteldorf ([REDACTED])
Certificate (Serial: [REDACTED], Name: Apple Development: Christian Mitteldorf ([REDACTED]), Team: Christian Mitteldorf ([REDACTED]), Expiry: 2021-05-27 22:21:18 +0000 UTC) not found on Developer Portal: failed to fetch certificate ([REDACTED]): GET https://api.appstoreconnect.apple.com/v1/certificates?filter%5BserialNumber%5D= [REDACTED]: 403
- FORBIDDEN_ERROR: This request is forbidden for security reasons: Unable to find a team with the given Content Provider ID 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' to which you belong.  Please contact Apple Developer Program Support. https://developer.apple.com/support
Certificate (Serial: [REDACTED], Name: Apple Distribution: Christian Mitteldorf ([REDACTED]), Team: Christian Mitteldorf ([REDACTED]), Expiry: 2021-06-23 08:26:51 +0000 UTC) not found on Developer Portal: failed to fetch certificate ([REDACTED]): GET https://api.appstoreconnect.apple.com/v1/certificates?filter%5BserialNumber%5D=[REDACTED]: 403
- FORBIDDEN_ERROR: This request is forbidden for security reasons: Unable to find a team with the given Content Provider ID 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' to which you belong.  Please contact Apple Developer Program Support. https://developer.apple.com/support
Failed to get valid certificates: not found any of the following IOS_DISTRIBUTION certificates on Developer Portal:
- Serial: 6319796644512707050, Name: Apple Development: Christian Mitteldorf (XXXXXXXXX), Team: Christian Mitteldorf (XXXXXXXXX), Expiry: 2021-05-27 22:21:18 +0000 UTC
- Serial: 7470238815631393042, Name: Apple Distribution: Christian Mitteldorf (XXXXXXXXX), Team: Christian Mitteldorf (XXXXXXXXX), Expiry: 2021-06-23 08:26:51 +0000 UTC
|                                                                              |
+---+---------------------------------------------------------------+----------+
| x | ios-auto-provision-appstoreconnect@0 (exit code: 1)           | 49.83 sec|
+---+---------------------------------------------------------------+----------+
| Issue tracker: ...se-steplib/steps-ios-auto-provision-appstoreconnect/issues |
| Source: ...thub.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect |
+---+---------------------------------------------------------------+----------+
bitce commented 4 years ago

Hi @christiankm! Sorry to hear about the issue. Have you tried regenerating the API key yet? I've seen a similar situation, where the issue turned out to be that the API key was generated in a bad state, and regenerating the key helped.

christiankm commented 4 years ago

What API key is this exactly, that you refer to? I tried to disconnect, and reconnect my Apple Account in Bitrise settings, and generating a new App Store Connect with Admin right while doing so. But it seems it does not find the Content Provider ID although this IS correct, as far as i can see.

I see two different team id's in the log and i wonder if that has anything to do with this issue.

bitce commented 4 years ago

Hi @christiankm, this API key is what you have to use as the method of connecting your account to use this step. What you are describing sounds like you're referring to the older, deprecated method of session based authentication, but this repo and the log snippet is using a new method available in the same place.

This is blogpost describes it well: https://blog.bitrise.io/app-store-connect-api-on-bitrise

christiankm commented 4 years ago

This blogpost is exactly what I have followed. It’s just not working for me (anymore).

Christian

Den 3. aug. 2020 kl. 12.10 PM skrev Bence Kubik notifications@github.com:

 Hi @christiankm, this API key is what you have to use as the method of connecting your account to use this step. What you are describing sounds like you're referring to the older, deprecated method of session based authentication, but this repo and the log snippet is using a new method available in the same place.

This is blogpost describes it well: https://blog.bitrise.io/app-store-connect-api-on-bitrise

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

bitce commented 4 years ago

I understand, hope this helps clear up the API key in reference. In case this used to work that sounds like it might be different, but we'll need a build URL and Support User access (can be turned on in the Settings of an app) to be able to investigate this.

christiankm commented 4 years ago

I understand, hope this helps clear up the API key in reference. In case this used to work that sounds like it might be different, but we'll need a build URL and Support User access (can be turned on in the Settings of an app) to be able to investigate this.

Sounds great. I have enabled support user access. This is the latest failing build: https://app.bitrise.io/build/57487b8a7a92f799#?tab=log

Thank you!

bitce commented 4 years ago

Sure thing! Can you direct us to a specific build where this was working? I see successful builds in the past but none of them had this step yet. Thanks!

christiankm commented 4 years ago

Yeah you’re right. I see now I never got it working for me with this step. Last thing I had working was manually installing certificates.

Den 3. aug. 2020 kl. 13.22 skrev Bence Kubik notifications@github.com:

Sure thing! Can you direct us to a specific build where this was working? I see successful builds in the past but none of them had this step yet. Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/issues/14#issuecomment-667967606, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA3VI3TR6OYU6QMFRJUZAXLR62MXZANCNFSM4POS4FMQ.

bitce commented 4 years ago

I see! Can you or have you tried to regenerate the API key?

christiankm commented 4 years ago

I am not sure.

However now I have reverted my workflow config to use the older implementation and install certificates outside of automatic management, (like my last successful build).

Now my CI works again. I think I will leave it like this until this method really gets retired, or until some updates have come to the build steps :)

Thanks for your help so far!

Den 4. aug. 2020 kl. 09.09 skrev Bence Kubik notifications@github.com:

I see! Can you or have you tried to regenerate the API key?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/issues/14#issuecomment-668421846, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA3VI3UJC5MQQNC6M55A4G3R66XZTANCNFSM4POS4FMQ.

github-actions[bot] commented 3 years ago

Hello there, I'm a bot. On behalf of the community I thank you for opening this issue.

To help our human contributors focus on the most relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 90 days, so I marked it as stale.

The community would appreciate if you could check if the issue still persists. If it isn't, please close it. If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me".

If no comment left within 21 days, this issue will be closed.

github-actions[bot] commented 3 years ago

I'll close this issue as it doesn't seem to be relevant anymore. We believe an old issue probably has a bunch of context that's no longer relevant, therefore, if the problem still persists, please open a new issue.