oliviergauthier / gradle-appcenter-plugin

This gradle plugin allow you to upload each build variant of your android application to separate AppCenter Apps.
MIT License
85 stars 45 forks source link

Uploading task returns 500 #60

Closed giangpham96 closed 3 years ago

giangpham96 commented 3 years ago

I got this error when uploading the apk

com.betomorrow.gradle.appcenter.infra.AppCenterUploaderException: Can't prepare release upload, code=500, reason={"code":"internal_server_error","message":"internal error (Support ID: 50d95910-9f21-4c79-8562-6ae9909cd7ee)"}

After checking AppCenter website, I found out that since Dec 8th 2020 (the day I face the error), Theappcenter distribute releasecommand in App Center CLI versions prior to v2.7.0 has stopped functioning. They also mention that if you are using custom scripts with our swagger API, please adjust your script based off the implementation of App Center CLI.

I think it affects the plugin and should be fixed.

hwdavr commented 3 years ago

Have the same issue here. Please help to fix it.

brudaswen commented 3 years ago

Seems the AppCenter API changed. I started working on the issue, but it may take a little to fix everything.

darrenferreira commented 3 years ago

Also experiencing the issue. Thanks @brudaswen !

StaehliJ commented 3 years ago

Same here ;)

peterbrandtbornholdtlee commented 3 years ago

We are depending on the plugin, a fix would be very appreciated!

giangpham96 commented 3 years ago

guys, please be patient 😄 I'm having the same issue, but it takes time for contributors to fix and test before making a new release. In the mean time, we can manually upload the apk or use appcenter cli instead.

Ynnck123 commented 3 years ago

I am also experiencing this error, would also really appreciate a fix! @brudaswen thank you for picking this issue up

jakubvimn commented 3 years ago

I've contacted the AppCenter support. It looks that returning error 500 is according to them "deprecating endpoints". They "don't have any information" why the API documentation (https://openapi.appcenter.ms/#/) doesn't mention anything about it. There's no new API: "you will need to migrate to a CLI based solution unfortunately".

tasomaniac commented 3 years ago

Not sure about the last point. It looks like there is a new API. Also consistent with @brudaswen 's changes. More info: https://github.com/microsoft/appcenter/issues/2069

Any feedback from @oliviergauthier ? Is it possible to deploy this fix soon?

jakubvimn commented 3 years ago

@tasomaniac You're right. There are new endpoints. It looks that not all the guys from support are aware of that. Here you can see how the Fastlane plugin was migrated: https://github.com/microsoft/fastlane-plugin-appcenter/commit/e35509d0c326578655cf0870806e770cede30fb7

taylors1512 commented 3 years ago

image

brudaswen commented 3 years ago

Seems that uploads are currently not working at all. Even the WebUI is not working. Will call it a day and continue tomorrow. I might have a first working solution, but can't test it...

ouchadam commented 3 years ago

here's a quickly hacked up bash implementation of the fastlane implementation https://gist.github.com/ouchadam/c74fa26c639a50d68bc35ee5749f868c

mikejonesguy commented 3 years ago

Seems that uploads are currently not working at all. Even the WebUI is not working. Will call it a day and continue tomorrow. I might have a first working solution, but can't test it...

Looks like the upload outage (affecting ALL uploads -- not just this plugin) has been resolved. https://status.appcenter.ms/incidents/jvl3rs5tmdlx

Hopefully you can test your fix now that the outage is resolved.

brudaswen commented 3 years ago

Good news. I was able to fix the apk uploads of my CI pipeline, so I hope the fix works for you as well. (I did not touch the symbols upload, so this might still be broken in case you make use of that feature.)

Be advised that it is all WIP and just a quick-fix without extensive testing.

You can use the jitpack version until I have an PR ready and this plugin is updated:

buildscript {
    repositories {
        maven { url 'https://jitpack.io' }
    }

    dependencies {
        classpath 'com.github.brudaswen:gradle-appcenter-plugin:issue~60-SNAPSHOT'
    }
}
mikejonesguy commented 3 years ago

You can use the jitpack version until I have an PR ready and this plugin is updated:

Can confirm that this fix has resolved my upload issues! Thanks for the great response time.

jtietema commented 3 years ago

Maybe slightly off-topic, but did you guys receive any comms in advance from AppCenter about this change? I couldn't find any in my inbox. This caught us completely off guard...

tasomaniac commented 3 years ago

Maybe slightly off-topic, but did you guys receive any comms in advance from AppCenter about this change? I couldn't find any in my inbox. This caught us completely off guard...

Support's reply was that they sent communication. Unfortunately I cannot find that either. 🤷‍♂️

bvschaik commented 3 years ago

I can also confirm the changes work. The only thing I noticed is that it reports "AppCenter release url is null" instead of a proper URL.

Maybe slightly off-topic, but did you guys receive any comms in advance from AppCenter about this change? I couldn't find any in my inbox. This caught us completely off guard...

I did receive an email on November 3rd stating:

We are writing to let you know that the distribution command in App Center CLI v2.6.7 and versions prior to it is now deprecated and will stop working on November 12, 2020. Please update your CLI to the latest version (v2.7.0 or above) to continue using the distribution command.

How does this affect me? The distribution command in App Center CLI v2.6.7 and versions prior to it will stop functioning after November 12, 2020.

What actions should I take? To continue using App Center distribution capability from the CLI, please upgrade your CLI to the latest versions (v2.7.0 or above). You can upgrade Appcenter CLI by running the following command in your terminal/command prompt: npm i -g appcenter-cli.

I chucked it in the bin because we're not using App Center CLI... It doesn't mention anything about API changes that might affect other distribution uploads as well.

brudaswen commented 3 years ago

Thanks for the "AppCenter release url is null". Will check this as well.

In case you experience timeout during the upload (com.betomorrow.gradle.appcenter.infra.AppCenterUploaderException: Fetching release id: Tried 60 times.), please let me know. I saw this once in my pipeline and would be interested to know if a one minute timeout is maybe not enough...

dtchepak commented 3 years ago

Just saw AppCenter is temporarily restoring the old APIs until Feb 2021.

https://status.appcenter.ms/incidents/7930rkfgtg1y

paulinabls commented 3 years ago

@brudaswen I'm experiencing some issues today with metadata file of the recent snapshot version Could not GET 'https://www.jitpack.io/com/github/brudaswen/gradle-appcenter-plugin/issue~60-SNAPSHOT/maven-metadata.xml' And if I tried two other versions: issue~60-6e56b338a6-1 or issue~60-da5edf2dde-1, I get :

Could not resolve com.github.brudaswen:gradle-appcenter-plugin:issue~60-da5edf2dde-1.
--
  | > inconsistent module metadata found. Descriptor: com.github.brudaswen:gradle-appcenter-plugin:issue~60-SNAPSHOT 
  Errors: bad version: expected='issue~60-da5edf2dde-1' found='issue~60-SNAPSHOT'
kyhule commented 3 years ago

Thanks for the "AppCenter release url is null". Will check this as well.

In case you experience timeout during the upload (com.betomorrow.gradle.appcenter.infra.AppCenterUploaderException: Fetching release id: Tried 60 times.), please let me know. I saw this once in my pipeline and would be interested to know if a one minute timeout is maybe not enough...

I just experienced this using your snapshot. Rolling back to 1.2.1 version since the apis have been temporarily restored.

jasonschroeder-sfdc commented 3 years ago

Be advised that it is all WIP and just a quick-fix without extensive testing.

Hi @brudaswen , are you still planning on opening a PR to get your changes upstreamed?

tasomaniac commented 3 years ago

That's not that hard. I wonder if @oliviergauthier is here to merge and deploy

brudaswen commented 3 years ago

I cleaned up the code but still have some issues to get the tests to work. Will nevertheless create a PR and ignore the tests.

I hope @oliviergauthier is available to create a release!?

jasonschroeder-sfdc commented 3 years ago

@brudaswen : I volunteer to help with the tests, if you can get a PR opened (or point me at your branch I can look at)

brudaswen commented 3 years ago

I created a PR such that @oliviergauthier can hopefully release a new version before AppCenter deprecates the API again.

I published a new version via Jitpack in the meanwhile:

buildscript {
    repositories {
        maven { url 'https://jitpack.io' }
    }

    dependencies {
        classpath 'com.github.brudaswen:gradle-appcenter-plugin:1.2.2'
    }
}
Paradoxia commented 3 years ago

Good news. I was able to fix the apk uploads of my CI pipeline, so I hope the fix works for you as well. (I did not touch the symbols upload, so this might still be broken in case you make use of that feature.)

Be advised that it is all WIP and just a quick-fix without extensive testing.

You can use the jitpack version until I have an PR ready and this plugin is updated:

buildscript {
    repositories {
        maven { url 'https://jitpack.io' }
    }

    dependencies {
        classpath 'com.github.brudaswen:gradle-appcenter-plugin:issue~60-SNAPSHOT'
    }
}

Today our entire CI production stopped. For some reason this snapshot is now published as com.github.brudaswen:gradle-appcenter-plugin:-SNAPSHOT. Please don't revert this :/

bvschaik commented 3 years ago

In case you experience timeout during the upload (com.betomorrow.gradle.appcenter.infra.AppCenterUploaderException: Fetching release id: Tried 60 times.), please let me know. I saw this once in my pipeline and would be interested to know if a one minute timeout is maybe not enough...

We're seeing this quite often since last Friday. We've been using your version of the plugin since the beginning without issues.

Paradoxia commented 3 years ago

In case you experience timeout during the upload (com.betomorrow.gradle.appcenter.infra.AppCenterUploaderException: Fetching release id: Tried 60 times.), please let me know. I saw this once in my pipeline and would be interested to know if a one minute timeout is maybe not enough...

We're seeing this quite often since last Friday. We've been using your version of the plugin since the beginning without issues.

Same problem here :(

hwdavr commented 3 years ago

I am getting this error from last Friday.

com.betomorrow.gradle.appcenter.infra.AppCenterUploaderException: Can't prepare release upload, code=404, reason={"message":"Not found. Correlation ID: ddccd73c-7623-4438-9b0e-ede1ee5df5c6","statusCode":404,"code":"Not Found"}
Paradoxia commented 3 years ago

I am getting this error from last Friday.

com.betomorrow.gradle.appcenter.infra.AppCenterUploaderException: Can't prepare release upload, code=404, reason={"message":"Not found. Correlation ID: ddccd73c-7623-4438-9b0e-ede1ee5df5c6","statusCode":404,"code":"Not Found"}

After implementing the repo authors suggestion things worked again.

buildscript {
    repositories {
        maven { url 'https://jitpack.io' }
    }

    dependencies {
        classpath 'com.github.brudaswen:gradle-appcenter-plugin:1.2.2'
    }
}
perwyl commented 3 years ago

I am getting this error from last Friday.

com.betomorrow.gradle.appcenter.infra.AppCenterUploaderException: Can't prepare release upload, code=404, reason={"message":"Not found. Correlation ID: ddccd73c-7623-4438-9b0e-ede1ee5df5c6","statusCode":404,"code":"Not Found"}

After implementing the repo authors suggestion things worked again.

buildscript {
    repositories {
        maven { url 'https://jitpack.io' }
    }

    dependencies {
        classpath 'com.github.brudaswen:gradle-appcenter-plugin:1.2.2'
    }
}

@Paradoxia it works for you on the new path com.github.brudaswen:gradle-appcenter-plugin:1.2.2 ? It's not working for me though

mikejonesguy commented 3 years ago

Will there be a new release published with this fix? I'm still using com.github.brudaswen:gradle-appcenter-plugin:1.2.2, but I assumed that was a temporary measure and that a v1.2.2 was still forthcoming from this repo.