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

Failed to publish AAB with error #188

Open
1 task
hivenet-sathishgadde-osi opened this issue Sep 13, 2023 · 44 comments
Open
1 task

Failed to publish AAB with error #188

hivenet-sathishgadde-osi opened this issue Sep 13, 2023 · 44 comments
Assignees
Labels
invalid This doesn't seem right

Comments

@hivenet-sathishgadde-osi

Describe the bug
Am randomly facing the below error:
image

Workflow Step Configuration
``

      - name: Publish AAB to Google Play
        uses: r0adkll/upload-google-play@v1
        with:
          serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
          packageName: com.android.demo.preprod
          releaseFiles: ./apps/***/build/outputs/bundle/preprod/***-preprod.aab
          track: ${{ env.RELEASE_TRACK }}
          releaseName: ${{ env.VERSION_CODE }} (${{ env.VERSION_NAME }})
          inAppUpdatePriority: ${{ env.IN_APP_UPDATE_PRIORITY }}

Step Debugging

At the moment, I don't have the debug logs. I'll share them with you once I've collected this information from the workflow.

@hivenet-sathishgadde-osi hivenet-sathishgadde-osi added the bug Something isn't working label Sep 13, 2023
@hivenet-sathishgadde-osi hivenet-sathishgadde-osi changed the title Public AAB failed with error Failed to publish AAB with error Sep 13, 2023
@Nek-12
Copy link

Nek-12 commented Sep 13, 2023

Experiencing this issue too

@hexlogic
Copy link

hexlogic commented Sep 15, 2023

Same here

1 similar comment
@joao-albach
Copy link

Same here

@boswelja
Copy link
Collaborator

By "randomly", do you mean it sometimes fails and sometimes succeeds?

@aabiryukov
Copy link

It's looks like the issue is on Google side. The same error occurs when publishing via fastlane: fastlane/fastlane#21507

@willhou
Copy link

willhou commented Sep 16, 2023

@r0adkll From the issue shared by @aabiryukov, it seems the fix is to update the android publisher url to "https://androidpublisher.googleapis.com/" in this file:
https://github.com/r0adkll/upload-google-play/blob/master/src/edits.ts#L52

@boswelja
Copy link
Collaborator

Interesting, we can give that a go

@boswelja
Copy link
Collaborator

@r0adkll From the issue shared by @aabiryukov, it seems the fix is to update the android publisher url to "https://androidpublisher.googleapis.com/" in this file: https://github.com/r0adkll/upload-google-play/blob/master/src/edits.ts#L52

It's worth mentioning Fastlane developers confirmed the URL is not an issue, and all they could do was optimize network calls so it had less chances to happen

@boswelja
Copy link
Collaborator

If anyone is interested in testing this, please try using the branch for #190 in your action. Note that this error is random, and a one-shot run is not enough to say whether this has helped

@boswelja boswelja assigned boswelja and unassigned r0adkll Sep 17, 2023
@msgivaldo
Copy link

Changing to attempt-fix-for-random-google-issue I got an error

image

@boswelja
Copy link
Collaborator

Changing to attempt-fix-for-random-google-issue I got an error

image

Thanks for trying it! Does it consistently give that error? If so, we can probably discard the change

@menssen
Copy link

menssen commented Sep 18, 2023

Same "Invalid Credentials" error from the attempt-fix... branch, if you want one more data point.

@omar-alshyokh
Copy link

I have the same error just when I'm trying to use whatsNewDirectory, and it works properly when i removed it.

      - name: Publish To Store
        uses: r0adkll/[email protected]
        with:
          serviceAccountJson: android/service_account.json
          packageName: '....'
          releaseFiles: build/app/outputs/bundle/release/app-release.aab
          track: production
          whatsNewDirectory: whatsnew

@msgivaldo
Copy link

msgivaldo commented Sep 18, 2023

I've tried v1 tag without whatsNewDirectory and works as expected too

- name: Deploy to Play Store
  id: deploy
  uses: r0adkll/upload-google-play@v1
  with:
    serviceAccountJson: service_account.json
    packageName: dev.givaldo.carspecs
    releaseFiles: android/app/build/outputs/bundle/release/app-release.aab
    mappingFile: android/app/build/outputs/mapping/release/mapping.txt
    track: beta
image

@Miiite
Copy link

Miiite commented Sep 18, 2023

I don't think the whatsNewDirectory really affects anything. This is my task

 - name: upload PROD package to Google Play
        uses: r0adkll/upload-google-play@v1
        with:
          serviceAccountJsonPlainText: ${{ secrets.PLAY_CONSOLE_SERVICE_ACCOUNT_JSON }}
          packageName: io.thering.app
          releaseFiles: app-release.aab
          releaseName: ${{ inputs.tag }}
          track: internal
          status: inProgress

And I end up having the same issue everyone is describing (which has occured every time I launched a build from this morning)

@Fudal
Copy link

Fudal commented Sep 18, 2023

I've tried v1 tag without whatsNewDirectory and works as expected too

- name: Deploy to Play Store
  id: deploy
  uses: r0adkll/upload-google-play@v1
  with:
    serviceAccountJson: service_account.json
    packageName: dev.givaldo.carspecs
    releaseFiles: android/app/build/outputs/bundle/release/app-release.aab
    mappingFile: android/app/build/outputs/mapping/release/mapping.txt
    track: beta
image

It helped me too.

@Nek-12
Copy link

Nek-12 commented Sep 18, 2023

I'm not using the whatsNew property and still experiencing this issue. I'm using 1.1.1 though

@armanso
Copy link

armanso commented Sep 18, 2023

      - name: upload artifact to playstore
        uses: r0adkll/upload-google-play@v1
        with:
          serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
          packageName: com.a*******e.${{ matrix.flavors }}_app

          releaseFiles: build/app/outputs/bundle/${{ matrix.flavors }}Release/app-${{ matrix.flavors }}-release.aab
          status: draft
          mappingFile: build/app/outputs/mapping/${{ matrix.flavors }}Release/mapping.txt
          debugSymbols: build/app/intermediates/merged_native_libs/${{ matrix.flavors }}Release/out/lib

We do face the same issue.

@valeriyo
Copy link

valeriyo commented Sep 18, 2023

Same issue with 1.1.1, started happening today! --- and then, after several failures, it worked.

@wasnotrice
Copy link

I've seen this maybe every other run for a week or so, but it feels more frequent today.

@boswelja
Copy link
Collaborator

I have just published a release that bumps all versions - including androidpublisher. Let me know if you see a change in the status of this.

For now, I will mark this as invalid since it seems to be on Google's side

@boswelja boswelja added invalid This doesn't seem right and removed bug Something isn't working labels Sep 19, 2023
@BashirTowdiee
Copy link

BashirTowdiee commented Sep 19, 2023

@boswelja
I have tested v1.1.2
I can confirm it has fixed the issue on my end.

Will monitor to see if the issue shows up again.
Thank you!

@miduch
Copy link

miduch commented Sep 19, 2023

v1.1.2 didn't help us

@armanso
Copy link

armanso commented Sep 19, 2023

Alright, version 1.1.2 worked for us, but not on the first try. It took 5-6 attempts to successfully upload the file to the Play Store.

Is it possible to implement a retry option? This way, it could automatically retry the file submission to the Play Store if it fails, with an adjustable amount of time between each retry.

This is the solution that Fastlane has come up with. cc @boswelja

StylianosGakis added a commit to HedvigInsurance/android that referenced this issue Sep 19, 2023
@gustavomaedo
Copy link

For me, this problem started last week. I've been using it for months and never had any problems. Something has definitely changed on Google's side. In my case it always works on the second try.

@Geka000
Copy link

Geka000 commented Sep 20, 2023

I've faced the same issue today, updated to 1.1.2 and it doesn't work. I've tried to re-run the failed upload job 8 times.

    - name: Upload to AlphaTrack
      uses: r0adkll/[email protected]
      with:
        serviceAccountJsonPlainText: ${{ secrets.GP_SERVICE_ACCOUNT_JSON }}
        packageName: com.*************
        releaseFiles: "${{ needs.build.outputs.archiveName }}"
        releaseName: "${{ needs.build.outputs.versionCode }}(${{ needs.build.outputs.versionName }})"
        track: alpha
        status: completed
        inAppUpdatePriority: 5
        whatsNewDirectory: distribution/whatsnew
        mappingFile: mapping.txt
        debugSymbols: debug_symbols/```

@Abushawish
Copy link

Abushawish commented Sep 20, 2023

Looks like fastlane "solved" this issue by introducing a retry mechanism with a max_retries parameter. Maybe this will need to do the same workaround?

@boswelja
Copy link
Collaborator

I'm not sure how to feel about that solution. Is Google aware of this issue? Does GitHub Actions have a retry mechanism for jobs/workflows already?

@Abushawish
Copy link

@boswelja Sorry, I just saw your response. I'm not sure if Google is aware of the issue or not, but as everything Google I'm sure they will move at a glacial pace to fix it after ignoring it for a while. Github Actions doesn't offer a retry mechanism besides running a custom run command, which gets very messy and complex.

I put up a PR for a try mechanism if you're interested! No hard feelings at all if you don't feel comfortable with the solution. I would test it locally, but I'm not sure how so I'd recommend keeping that in mind.

@MahnoorShafique
Copy link

@r0adkll any update on this issue ,i am getting "Error: Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project."
below are my configs:
- name: Deploy to Internal
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJson: service_account.json
packageName: com.packagename
releaseFiles: path/to/aab/file/app-production-release.aab
track: internal

@boswelja
Copy link
Collaborator

@r0adkll any update on this issue ,i am getting "Error: Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project."
below are my configs:
- name: Deploy to Internal
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJson: service_account.json
packageName: com.packagename
releaseFiles: path/to/aab/file/app-production-release.aab
track: internal

It is a problem on Google's side, as per the discussion above.

@stevenspiel
Copy link

Lots of folks over here having success with:

upload_to_play_store(
    root_url: "https://androidpublisher.googleapis.com/",
    ...
)

Is that a possibility here?

@boswelja
Copy link
Collaborator

Lots of folks over here having success with:

upload_to_play_store(
    root_url: "https://androidpublisher.googleapis.com/",
    ...
)

Is that a possibility here?

As per the conversation above, it did not help. In fact, it outright broke some functionality.

@2p31-1
Copy link

2p31-1 commented Sep 21, 2023

image
Same error here

@2p31-1
Copy link

2p31-1 commented Sep 21, 2023

image
I'm not using what's new directory, and it worked once after I changed service account json file to new, and then, it fails to deploy

@juliuscanute
Copy link

It worked for me after I created a new service account key.

@dominicmh
Copy link

@juliuscanute
It worked for me after I created a new service account key.

As the failure doesn't occur consistently: Did your upload with the new service account key succeed multiple times?

@dominicmh
Copy link

dominicmh commented Sep 21, 2023

After formatting the serviceAccountJsonPlainText argument from multi-line to single-line string (in GitHub Actions Secret), the issue was resolved for me.
The upload was successful 12/12 times since then (before that, it failed 8/11 times).

Can someone confirm or debunk this observation?

@Geka000
Copy link

Geka000 commented Sep 21, 2023

I've tested the code locally(with real credentials and aab) and the successful upload is completely random. At first, I thought that the problem was passing authentication parameters to the Androidpublisher library, but this is not the case. In all tests auth object passed to Androidpublisher has been the same(it does not depend on how you pass it to the action, if you pass plain text it has been saved to the temp file and it's path is passed to the environment variable). I've tried the Gradle plugin gradle-play-publisher it utilizes the same API, and it works without issues. So I think the problem is in google-api-nodejs-client or with less probability on the Google server side.

@akimaleo
Copy link

Hey fellow developers!
Did you consider it to be Google related issue?
Lots of services have this problem.
Our custome CI fails as well. Fastlane has it too

@Geka000
Copy link

Geka000 commented Sep 21, 2023

I didn't see any potential problems related to authentication in this code. I agree with @boswelja, it's definitely a Google related problem(maybe API library, maybe backend). Anyway, this issue broke my pipeline, I don't want to return to the stone age and publish apps by hand. I can suggest wrapping the upload action with retry-action, I don’t know what consequences this can lead to. Depending on the step where it fails, it can create a new release on every retry for example. In my tests, it fails on uploadReleaseFiles. If it always the case, then, my opinion, this retry mechanism will not lead to any problems.

@randytang2021
Copy link

Thanks for the recommendation. Just give me a chance to use the retry-action.

I wrapped up the upload-google-play with retry-action with a max of 10 times retry and tested it out. It's working as expected.

@armanso
Copy link

armanso commented Sep 22, 2023

@randytang2021, can you please share your script here with us?

@randytang2021
Copy link

randytang2021 commented Sep 22, 2023

old code:

`

  - name: "LLL -> Google Play --> 2: Upload to Google Play Console"
    if: ${{ env.BUILD_ENV_AAB_PACKAGE_TYPE == 'true' }}
    id: upload_to_google_play_console
    uses: r0adkll/[email protected]
    with:
      releaseFiles: "${{env.ARTIFACT_AAB_PATH}}"
      serviceAccountJson: "./${{env.GOOGLE_SERVICE_ACCOUNT_JSON}}"
      packageName: "${{env.APP_PACKAGE_NAME}}"
      track: "${{env.BUILD_ENV_GOOGLE_PLAY_TRACK}}"
      whatsNewDirectory: "${{env.OUTPUT_WHATSNEW_EN_US}}"
      releaseName: "${{env.BUILD_ENV_VERSION_NAME}}"
      status: completed
      mappingFile: "./${{env.CURRENT_REPO}}/app/build/outputs/mapping/${{env.BUILD_ENV_BUILD_TYPE_LOWER_CASE}}Release/mapping.txt"

`

code with retry:

`

  - name: "LLL -> Google Play --> 3: Upload to Google Play Console, max retry 10 times"
    uses: Wandalen/[email protected]
    if: ${{ env.BUILD_ENV_AAB_PACKAGE_TYPE == 'true' }}
    id: upload_to_google_play_console
    with:
      action: r0adkll/[email protected]
      with: |
        releaseFiles: "${{env.ARTIFACT_AAB_PATH}}"
        serviceAccountJson: "./${{env.GOOGLE_SERVICE_ACCOUNT_JSON}}"
        packageName: "${{env.APP_PACKAGE_NAME}}"
        track: "${{env.BUILD_ENV_GOOGLE_PLAY_TRACK}}"
        whatsNewDirectory: "${{env.OUTPUT_WHATSNEW_EN_US}}"
        releaseName: "${{env.BUILD_ENV_VERSION_NAME}}"
        status: completed
        mappingFile: "./${{env.CURRENT_REPO}}/app/build/outputs/mapping/${{env.BUILD_ENV_BUILD_TYPE_LOWER_CASE}}Release/mapping.txt"
      attempt_limit: 10
      attempt_delay: 3000

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests