-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Authentication credentials are missing or invalid. - Provide a properly configured and signed bearer token, and make sure that it has not expired #19072
Comments
It seems like you have not included the output of |
I should probably mention the key is created with role |
Hi @khoogheem Can you try |
Same issue with Admin |
@crazymanish I think there is an issue regardless.. I tested by putting everything into a json so I could just run |
this is interesting...reopening |
same issue (without duration) |
We are having the same issue using the key with the admin role:
|
Okay, cool! I am not sure why this is causing this suddenly, don't have an AppStoreConnectAPI key to debug this issue. 🤪 |
We are seeing the same issue suddenly with a key that was working fine. It does look like an issue with Apple's API, given that I am unable to create a new token in the App Store Connect, seeing bunch of 500 errors in the developer console. |
Seems like AppStore Connect has some problems atm? I get an error message and can't see any apps when logging in via Safari. |
Same issue, AppStore Connect website shows error message instead of apps. |
Seems to be fixed. |
Not sure if the AppStore Connect issue was related though, as for us the initial problem with the Auth is there since Friday evening. |
Right.. My issues started on my Thursday/Friday builds.. Sure it might still be an Apple Issue.. but what made no sense was the default durations just stopped working.. and I could only get it to work with a duration of 500 |
Totally! I can confirm that duration of 500 also does the trick for us. |
Adding 500 seconds duration sounds crazy workaround, but I don't surprise with Apple 🍏🍎 anymore 😇😂 |
Doesn't work for us, even with duration set to 500. |
It does work for me
|
We didn't change anything (like duration), but it started to work again. |
Can confirm that setting the duration to 500 fixes the issue. |
Adding 500 seconds duration works for us too. |
Hi all, btw, In my team, we don't use any duration and everything seems to work so far... 😉 |
this work for us | paring with @fernandaaraujo |
Hi all, I'm facing the same issue here. Does anyone know how to change the token session duration on the Azure DevOps extension for the Apple App Store? Would it be possible via additional fastlane arguments on the task or using an environment variable? Thanks in advance! |
Works for me too with duration 500 🥇 |
My team was experiencing this issue when we had the duration set to Do we know what might be the root cause of this issue? Modifying the duration is a flaky solution, especially when deploying app versions via CI/CD. |
Also encountered this; not exactly relevant since I'm using GitHub actions but it seems like the same underlying issue. For me a retrigger of the GitHub Actions workflow always works; wondering if it's something to do with a rate limit on Apple's side that returns an unhelpful error message. |
I'm facing this issue again since 5days...
I think that there maybe an issue on apple with generation such keys, and then it produces one with default values. |
Apple seems to be revoking tokens before their expiration dates. Several users reporting problems on issue [fastlane#19072][1] were likely affected by it. Sometimes changing the token duration will work around the problem, as the tokens are likely being revoked later in the future and allowing the wait to complete. This can be seen in practice by adding a `@token.refresh!` couple of extra log messages to [api_client.rb][2] right at the point where we get an `UnauthorizedAccessError`: ``` INFO [2021-10-19 18:38:31.74]: Successfully uploaded the new binary to App Store Connect INFO [2021-10-19 18:38:31.74]: If you want to skip waiting for the processing to be finished, use the `skip_waiting_for_build_processing` option INFO [2021-10-19 18:38:31.74]: Note that if `skip_waiting_for_build_processing` is used but a `changelog` is supplied, this process will wait for the build to appear on AppStoreConnect, update the changelog and then skip the remaining of the processing steps. DEBUG [2021-10-19 18:38:31.82]: App Platform (ios) INFO [2021-10-19 18:38:31.92]: Waiting for processing on... app_id: 1370986669, app_version: 2.23.2, build_version: 262025, platform: IOS WARN [2021-10-19 18:38:32.26]: Read more information on why this build isn't showing up yet - fastlane#14997 INFO [2021-10-19 18:38:32.26]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:39:02.70]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) token expired?: false - expiration: 2021-10-19 18:45:04 -0400 Token has expired, has been revoked, or is invalid! Trying to refresh INFO [2021-10-19 18:39:33.26]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:40:03.69]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:40:34.33]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:41:04.76]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:41:35.21]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:42:05.67]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) token expired?: false - expiration: 2021-10-19 18:47:52 -0400 Token has expired, has been revoked, or is invalid! Trying to refresh INFO [2021-10-19 18:42:36.34]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:43:06.80]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:43:37.23]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) ``` The logs above show that, even though the current token is not expired, the appconnect API responds with a 401 and the process would otherwise fail. This ignores the `UnauthorizedAccessError` exception and instead refreshes the token right before raising a `RetryError`. [1]: fastlane#19072 [2]: https://github.com/fastlane/fastlane/blob/62af236780a9eace9d0487d0767f50d1a17a1c6c/spaceship/lib/spaceship/connect_api/api_client.rb#L172-L175
Apple seems to be revoking tokens before their expiration dates. Several users reporting problems on issue [fastlane#19072][1] were likely affected by it. Sometimes changing the token duration will work around the problem, as the tokens are likely being revoked later in the future and allowing the wait to complete. This can be seen in practice by adding a `@token.refresh!` couple of extra log messages to [api_client.rb][2] right at the point where we get an `UnauthorizedAccessError`: ``` INFO [2021-10-19 18:38:31.74]: Successfully uploaded the new binary to App Store Connect INFO [2021-10-19 18:38:31.74]: If you want to skip waiting for the processing to be finished, use the `skip_waiting_for_build_processing` option INFO [2021-10-19 18:38:31.74]: Note that if `skip_waiting_for_build_processing` is used but a `changelog` is supplied, this process will wait for the build to appear on AppStoreConnect, update the changelog and then skip the remaining of the processing steps. DEBUG [2021-10-19 18:38:31.82]: App Platform (ios) INFO [2021-10-19 18:38:31.92]: Waiting for processing on... app_id: 1370986669, app_version: 2.23.2, build_version: 262025, platform: IOS WARN [2021-10-19 18:38:32.26]: Read more information on why this build isn't showing up yet - fastlane#14997 INFO [2021-10-19 18:38:32.26]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:39:02.70]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) token expired?: false - expiration: 2021-10-19 18:45:04 -0400 Token has expired, has been revoked, or is invalid! Trying to refresh INFO [2021-10-19 18:39:33.26]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:40:03.69]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:40:34.33]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:41:04.76]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:41:35.21]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:42:05.67]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) token expired?: false - expiration: 2021-10-19 18:47:52 -0400 Token has expired, has been revoked, or is invalid! Trying to refresh INFO [2021-10-19 18:42:36.34]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:43:06.80]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:43:37.23]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) ``` The logs above show that, even though the current token is not expired, the appconnect API responds with a 401 and the process would otherwise fail. This ignores the `UnauthorizedAccessError` exception and instead refreshes the token right before raising a `RetryError`. [1]: fastlane#19072 [2]: https://github.com/fastlane/fastlane/blob/62af236780a9eace9d0487d0767f50d1a17a1c6c/spaceship/lib/spaceship/connect_api/api_client.rb#L172-L175
@khoogheem Hi I am facing the same issue , but I don't understand where I can add this duration in fastfile and I don't understand the Json file solution
|
Apple seems to be revoking tokens before their expiration dates. Several users reporting problems on issue [fastlane#19072][1] were likely affected by it. Sometimes changing the token duration will work around the problem, as the tokens are likely being revoked later in the future and allowing the wait to complete. This can be seen in practice by adding a `@token.refresh!` couple of extra log messages to [api_client.rb][2] right at the point where we get an `UnauthorizedAccessError`: ``` INFO [2021-10-19 18:38:31.74]: Successfully uploaded the new binary to App Store Connect INFO [2021-10-19 18:38:31.74]: If you want to skip waiting for the processing to be finished, use the `skip_waiting_for_build_processing` option INFO [2021-10-19 18:38:31.74]: Note that if `skip_waiting_for_build_processing` is used but a `changelog` is supplied, this process will wait for the build to appear on AppStoreConnect, update the changelog and then skip the remaining of the processing steps. DEBUG [2021-10-19 18:38:31.82]: App Platform (ios) INFO [2021-10-19 18:38:31.92]: Waiting for processing on... app_id: 1370986669, app_version: 2.23.2, build_version: 262025, platform: IOS WARN [2021-10-19 18:38:32.26]: Read more information on why this build isn't showing up yet - fastlane#14997 INFO [2021-10-19 18:38:32.26]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:39:02.70]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) token expired?: false - expiration: 2021-10-19 18:45:04 -0400 Token has expired, has been revoked, or is invalid! Trying to refresh INFO [2021-10-19 18:39:33.26]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:40:03.69]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:40:34.33]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:41:04.76]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:41:35.21]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:42:05.67]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) token expired?: false - expiration: 2021-10-19 18:47:52 -0400 Token has expired, has been revoked, or is invalid! Trying to refresh INFO [2021-10-19 18:42:36.34]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:43:06.80]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:43:37.23]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) ``` The logs above show that, even though the current token is not expired, the appconnect API responds with a 401 and the process would otherwise fail. This refreshes the token and adds retries to `UnauthorizedAccessError` before ultimately raising the error if it still continues to fail. [1]: fastlane#19072 [2]: https://github.com/fastlane/fastlane/blob/62af236780a9eace9d0487d0767f50d1a17a1c6c/spaceship/lib/spaceship/connect_api/api_client.rb#L172-L175
Apple seems to be revoking tokens before their expiration dates. Several users reporting problems on issue [fastlane#19072][1] were likely affected by it. Sometimes changing the token duration will work around the problem, as the tokens are likely being revoked later in the future and allowing the wait to complete. This can be seen in practice by adding a `@token.refresh!` couple of extra log messages to [api_client.rb][2] right at the point where we get an `UnauthorizedAccessError`: ``` INFO [2021-10-19 18:38:31.74]: Successfully uploaded the new binary to App Store Connect INFO [2021-10-19 18:38:31.74]: If you want to skip waiting for the processing to be finished, use the `skip_waiting_for_build_processing` option INFO [2021-10-19 18:38:31.74]: Note that if `skip_waiting_for_build_processing` is used but a `changelog` is supplied, this process will wait for the build to appear on AppStoreConnect, update the changelog and then skip the remaining of the processing steps. DEBUG [2021-10-19 18:38:31.82]: App Platform (ios) INFO [2021-10-19 18:38:31.92]: Waiting for processing on... app_id: 1370986669, app_version: 2.23.2, build_version: 262025, platform: IOS WARN [2021-10-19 18:38:32.26]: Read more information on why this build isn't showing up yet - fastlane#14997 INFO [2021-10-19 18:38:32.26]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:39:02.70]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) token expired?: false - expiration: 2021-10-19 18:45:04 -0400 Token has expired, has been revoked, or is invalid! Trying to refresh INFO [2021-10-19 18:39:33.26]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:40:03.69]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:40:34.33]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:41:04.76]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:41:35.21]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:42:05.67]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) token expired?: false - expiration: 2021-10-19 18:47:52 -0400 Token has expired, has been revoked, or is invalid! Trying to refresh INFO [2021-10-19 18:42:36.34]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:43:06.80]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:43:37.23]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) ``` The logs above show that, even though the current token is not expired, the appconnect API responds with a 401 and the process would otherwise fail. This refreshes the token and adds retries to `UnauthorizedAccessError` before ultimately raising the error if it still continues to fail. [1]: fastlane#19072 [2]: https://github.com/fastlane/fastlane/blob/62af236780a9eace9d0487d0767f50d1a17a1c6c/spaceship/lib/spaceship/connect_api/api_client.rb#L172-L175
How to fundamentally solve this problem?This problem started to appear around app_store_connect_api_key(
key_id: key_id,
issuer_id: issuer_id,
key_content: key_content,
duration: 500, # maximum 1200
in_house: false # optional but may be required if using match/sigh
) |
@wangdetong Take a look on @andersonvom #19502 |
Thank you, I will try |
Apple seems to be revoking tokens before their expiration dates. Several users reporting problems on issue [fastlane#19072][1] were likely affected by it. Sometimes changing the token duration will work around the problem, as the tokens are likely being revoked later in the future and allowing the wait to complete. This can be seen in practice by adding a `@token.refresh!` couple of extra log messages to [api_client.rb][2] right at the point where we get an `UnauthorizedAccessError`: ``` INFO [2021-10-19 18:38:31.74]: Successfully uploaded the new binary to App Store Connect INFO [2021-10-19 18:38:31.74]: If you want to skip waiting for the processing to be finished, use the `skip_waiting_for_build_processing` option INFO [2021-10-19 18:38:31.74]: Note that if `skip_waiting_for_build_processing` is used but a `changelog` is supplied, this process will wait for the build to appear on AppStoreConnect, update the changelog and then skip the remaining of the processing steps. DEBUG [2021-10-19 18:38:31.82]: App Platform (ios) INFO [2021-10-19 18:38:31.92]: Waiting for processing on... app_id: 1370986669, app_version: 2.23.2, build_version: 262025, platform: IOS WARN [2021-10-19 18:38:32.26]: Read more information on why this build isn't showing up yet - fastlane#14997 INFO [2021-10-19 18:38:32.26]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:39:02.70]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) token expired?: false - expiration: 2021-10-19 18:45:04 -0400 Token has expired, has been revoked, or is invalid! Trying to refresh INFO [2021-10-19 18:39:33.26]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:40:03.69]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:40:34.33]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:41:04.76]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:41:35.21]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:42:05.67]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) token expired?: false - expiration: 2021-10-19 18:47:52 -0400 Token has expired, has been revoked, or is invalid! Trying to refresh INFO [2021-10-19 18:42:36.34]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:43:06.80]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:43:37.23]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) ``` The logs above show that, even though the current token is not expired, the appconnect API responds with a 401 and the process would otherwise fail. This refreshes the token and adds retries to `UnauthorizedAccessError` before ultimately raising the error if it still continues to fail. [1]: fastlane#19072 [2]: https://github.com/fastlane/fastlane/blob/62af236780a9eace9d0487d0767f50d1a17a1c6c/spaceship/lib/spaceship/connect_api/api_client.rb#L172-L175
Apple seems to be revoking tokens before their expiration dates. Several users reporting problems on issue [fastlane#19072][1] were likely affected by it. Sometimes changing the token duration will work around the problem, as the tokens are likely being revoked later in the future and allowing the wait to complete. This can be seen in practice by adding a `@token.refresh!` couple of extra log messages to [api_client.rb][2] right at the point where we get an `UnauthorizedAccessError`: ``` INFO [2021-10-19 18:38:31.74]: Successfully uploaded the new binary to App Store Connect INFO [2021-10-19 18:38:31.74]: If you want to skip waiting for the processing to be finished, use the `skip_waiting_for_build_processing` option INFO [2021-10-19 18:38:31.74]: Note that if `skip_waiting_for_build_processing` is used but a `changelog` is supplied, this process will wait for the build to appear on AppStoreConnect, update the changelog and then skip the remaining of the processing steps. DEBUG [2021-10-19 18:38:31.82]: App Platform (ios) INFO [2021-10-19 18:38:31.92]: Waiting for processing on... app_id: 1370986669, app_version: 2.23.2, build_version: 262025, platform: IOS WARN [2021-10-19 18:38:32.26]: Read more information on why this build isn't showing up yet - fastlane#14997 INFO [2021-10-19 18:38:32.26]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:39:02.70]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) token expired?: false - expiration: 2021-10-19 18:45:04 -0400 Token has expired, has been revoked, or is invalid! Trying to refresh INFO [2021-10-19 18:39:33.26]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:40:03.69]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:40:34.33]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:41:04.76]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:41:35.21]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:42:05.67]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) token expired?: false - expiration: 2021-10-19 18:47:52 -0400 Token has expired, has been revoked, or is invalid! Trying to refresh INFO [2021-10-19 18:42:36.34]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:43:06.80]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) INFO [2021-10-19 18:43:37.23]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) ``` The logs above show that, even though the current token is not expired, the appconnect API responds with a 401 and the process would otherwise fail. This refreshes the token and adds retries to `UnauthorizedAccessError` before ultimately raising the error if it still continues to fail. [1]: fastlane#19072 [2]: https://github.com/fastlane/fastlane/blob/62af236780a9eace9d0487d0767f50d1a17a1c6c/spaceship/lib/spaceship/connect_api/api_client.rb#L172-L175
New Issue Checklist
Issue Description
Started receiving the
Authentication credentials are missing or invalid. - Provide a properly configured and signed bearer token, and make sure that it has not expired
message..We had not changed anything in our Fastlane and the API Keys have not been revoked.
I have even tested by creating a new API Key on the itunesConnect.
Command executed
I have also tied to just use CI env var which no change.
Complete output when running fastlane, including the stack trace and command used
Authentication credentials are missing or invalid. - Provide a properly configured and signed bearer token, and make sure that it has not expired. Learn more about Generating Tokens for API Requests https://developer.apple.com/go/?id=api-generating-tokens
The text was updated successfully, but these errors were encountered: