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

an exception appears with httpStatusCode=401, apiError=null, apiErrorMessage='null' #96

Open
hakusai22 opened this issue May 4, 2024 · 4 comments

Comments

@hakusai22
Copy link
Contributor

hakusai22 commented May 4, 2024

When calling the getAllSubscriptionStatuses(String transactionId, Status[] status) method in a production environment, an exception occasionally occurs, httpStatusCode=401, apiError=null, apiErrorMessage='null'. All my configurations are unified. When I create the AppStoreServerAPIClient, this exception will occasionally occur. I don't understand the triggering scenario of this accidental exception.

https://developer.apple.com/documentation/appstoreserverapi/get_all_subscription_statuses
image

image
2024-05-04,02:05:40,233 ERROR a73a88cd [TID: N/A] cn.lollypop.www.xxxx.utils.RpcExceptionHandler: fail
cn.lollypop.common.base.exception.LollypopServerException: APIException{httpStatusCode=401, apiError=null, apiErrorMessage='null'}
@hakusai22
Copy link
Contributor Author

hakusai22 commented May 13, 2024

    public String generateToken() {
        return JWT.create()
                .withAudience(APP_STORE_CONNECT_AUDIENCE)
                .withExpiresAt(Instant.now().plus(ChronoUnit.MINUTES.getDuration().multipliedBy(5)))
                .withIssuer(issuerId)
                .withKeyId(keyId)
                .withPayload(Map.of(BUNDLE_ID_KEY, bundleId))
                .sign(Algorithm.ECDSA256(signingKey));
    }

I see that the code for generating tokens is one-time and newly generated. Why does 401 appear?

@hakusai22
Copy link
Contributor Author

hakusai22 commented May 22, 2024

@alexanderjordanbaker hello ,If you have time, can you help me analyze this problem? Thank you. There have been a lot of 401 in the production environment recently.

@pkgonan
Copy link

pkgonan commented May 31, 2024

Oh my god.

I've been experiencing this problem recently as well. And it's still happening today.

I was searching google over and over again and found the same problem here now.

I keep getting the 401 error from time to time. This seems like a bug from Apple.

@hakusai22
Copy link
Contributor Author

Oh my god.

I've been experiencing this problem recently as well. And it's still happening today.

I was searching google over and over again and found the same problem here now.

I keep getting the 401 error from time to time. This seems like a bug from Apple.

Most requests are successful, but some requests result in 401?

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

2 participants