microsoft / appcenter-cli

Command-line Interface (CLI) for Visual Studio App Center
https://appcenter.ms/
MIT License
581 stars 234 forks source link

Release upload Failed #1180

Closed selected-pixel-jameson closed 11 months ago

selected-pixel-jameson commented 3 years ago

Since yesterday afternoon I'm no longer able to upload releases. I've been uploading releases for a very long time without a problem.

I'm using the latest version of the appcenter CLI ( 2.7.3 ).

appcenter distribute release --silent --file "......" --release-notes-file "changelist.md" --app "......" --group "Collaborators" --build-number "2"

I get this error.

Release upload failed
| Aborting release upload...(node:86813) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'release_distinct_id' of undefined
    at ReleaseBinaryCommand.<anonymous> (/Users/jamesonparker/.nvm/versions/node/v10.19.0/lib/node_modules/appcenter-cli/dist/commands/distribute/release.js:360:48)
    at Generator.throw (<anonymous>)
    at rejected (/Users/jamesonparker/.nvm/versions/node/v10.19.0/lib/node_modules/appcenter-cli/dist/commands/distribute/release.js:12:65)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:86813) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:86813) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Release upload was aborted
Error: Loading release id failed with error: failed to get release id for upload id: 245f1128-ca3f-4709-9e40-3c6e11579ffa, error: {"succeeded":false,"errorCode":3,"errorMessage":"failed to get release id with HTTP status: 504 - Gateway Time-out"
}
ghost commented 3 years ago

I also experienced the same thing and had to trigger an 'appcenter login', but after this the upload doesn't work using the same token as before.. it just hangs in 'Checking the uploaded file...'. It seems that only the distribute part doesn't work because the file is uploaded in respective app and is visible in appcenter. I tried to distribute it manually from the web interface and it gives an error 'Failed to distribute release...' I tried to use some of the tokens from the 'appcenter tokens list' but doesn't work.. fails with 'unauthorized' I generated a new token and it hangs the same as above in 'Checking the uploaded file...'

Pegolon commented 3 years ago

Same for me: stuck with "Checking the uploaded file..."

webertrlz commented 3 years ago

Same for me:

Release upload failed
| Aborting release upload...(node:16622) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'release_distinct_id' of undefined
    at ReleaseBinaryCommand.<anonymous> (/usr/local/lib/node_modules/appcenter-cli/dist/commands/distribute/release.js:360:48)
    at Generator.throw (<anonymous>)
    at rejected (/usr/local/lib/node_modules/appcenter-cli/dist/commands/distribute/release.js:12:65)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
error: {"succeeded":false,"errorCode":3,"errorMessage":"failed to get release id with HTTP status: 502 - Bad Gateway"}
doodeec commented 3 years ago

Same here. Old REST API stopped working today and the recommended CLI replacement fails, so any CI automation is pretty much blocked :man_shrugging:

MikeDymond-Puregym commented 3 years ago

We seem to be getting the same issue. We just updated the appcenter-cli to the latest version and get this error.

(node:77866) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'release_distinct_id' of undefined December 8th 2020 14:28:58Error at ReleaseBinaryCommand. (/usr/local/lib/node_modules/appcenter-cli/dist/commands/distribute/release.js:360:48) December 8th 2020 14:28:58Error at Generator.throw () December 8th 2020 14:28:58Error at rejected (/usr/local/lib/node_modules/appcenter-cli/dist/commands/distribute/release.js:12:65) December 8th 2020 14:28:58Error at process._tickCallback (internal/process/next_tick.js:68:7) December 8th 2020 14:28:58Error (node:77866) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) December 8th 2020 14:28:58Error (node:77866) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. December 8th 2020 14:29:16Info Response status code: 200 December 8th 2020 14:29:16Info Body: {} December 8th 2020 14:29:16Info Release upload was aborted December 8th 2020 14:29:16Info Error: Loading release id failed with error: failed to get release id for upload id: eaac6f6b-3a58-4792-87d7-28ec94e5d37c, error: {"succeeded":false,"errorCode":3,"errorMessage":"failed to get release id with HTTP status: 504 - Gateway Time-out"}

jameslavery-zz commented 3 years ago

Same for us. All CI is borked by this and we're at a standstill. We need an urgent resolution.

gcu-gwangho commented 3 years ago

I have the same problem in CI but manually run is a success. I don't know what's the problem.

aurimasengagecraft commented 3 years ago

Same here. I'm using appcenter-cli v2.7.3.
This morning I was able run "appcenter distribute release ...." successfully on my notebook once. But the script failed with ETIMEOUT on bitrise ci.

Now I'm trying to run it with DEBUG="appcenter-cli:commands:*" locally and after some time I get this: `- Checking the uploaded file... appcenter-cli:commands:distribute:release Loading release id... +221ms

jameslavery-zz commented 3 years ago

Downgrading to v2.7.0 doesn't fix it.

We're getting 502 - Bad Gateway - errors. Is the back end down?

Pegolon commented 3 years ago

Now I got "Release upload failed" | Aborting release upload.../usr/local/lib/node_modules/appcenter-cli/dist/commands/distribute/release.js:360 const releaseId = response.release_distinct_id; ^

TypeError: Cannot read property 'release_distinct_id' of undefined at ReleaseBinaryCommand. (/usr/local/lib/node_modules/appcenter-cli/dist/commands/distribute/release.js:360:48) at Generator.throw () at rejected (/usr/local/lib/node_modules/appcenter-cli/dist/commands/distribute/release.js:12:65) at runMicrotasks () at processTicksAndRejections (node:internal/process/task_queues:93:5)

Also using appcenter version 2.7.3

ghost commented 3 years ago

I have the same problem in CI but manually run is a success. I don't know what's the problem.

for me it doesn't work even to upload manually from the webpage.. it just hangs in upload and cannot click on next

Anastassi commented 3 years ago

The same happens with our project

Release upload failed
/usr/local/lib/node_modules/appcenter-cli/dist/commands/distribute/release.js:360
                    const releaseId = response.release_distinct_id;
                                               ^

TypeError: Cannot read property 'release_distinct_id' of undefined
    at ReleaseBinaryCommand.<anonymous> (/usr/local/lib/node_modules/appcenter-cli/dist/commands/distribute/release.js:360:48)
    at Generator.throw (<anonymous>)
    at rejected (/usr/local/lib/node_modules/appcenter-cli/dist/commands/distribute/release.js:12:65)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:93:5)
jameslavery-zz commented 3 years ago

Going on to AppCenter, the build in question appears to have been uploaded, but has not been distributed. So it looks like the upload is succeeding, but a subsequent step in the distribute process is failing.

aurimasengagecraft commented 3 years ago

Yes, upload works fien for me. "Checking the uploaded file..." step fails after some time. It looks like the script is trying to fetch updated status info every second or two. And then fails.

rbanker commented 3 years ago

Posting this because our error is slightly different than the OP. We are seeing "502 - Bad Gateway" versus "504 - Gateway Time-out"

This is the full text of the failure we're seeing after running the following CLI command:

appcenter distribute release --app xxx/xxx --file ./xxx.ipa --group "Collab" --token xxxxxxxxxxxxxxxxxxxxxxxxxxxx

The upload appears to succeed, but then fails after a long wait during "Checking the uploaded file...". Using CLI version 2.7.3.

Release upload failed
| Aborting release upload...(node:20421) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'release_distinct_id' of undefined
    at ReleaseBinaryCommand.<anonymous> (/Users/xxx/.nvm/versions/node/v12.14.1/lib/node_modules/appcenter-cli/dist/commands/distribute/release.js:360:48)
    at Generator.throw (<anonymous>)
    at rejected (/Users/xxx/.nvm/versions/node/v12.14.1/lib/node_modules/appcenter-cli/dist/commands/distribute/release.js:12:65)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:94:5)
(node:20421) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:20421) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Release upload was aborted
Error: Loading release id failed with error: failed to get release id for upload id: a5f15b7d-1fee-4fe5-8edf-***************, error: {"succeeded":false,"errorCode":3,"errorMessage":"failed to get release id with HTTP status: 502 - Bad Gateway"}
joakimkemeny commented 3 years ago

This is now reflected on the status page as a Major Outage for Distribute. https://status.appcenter.ms

selected-pixel-jameson commented 3 years ago

@joakimkemeny lol. Well that sure is helpful 20 hours after the fact.

kawazoe commented 3 years ago

I just wanted to chip in for Azure DevOps users. Here's what I am seeing in the App Center distribute task logs with system.debug enabled:

[debug]-- Getting release id.
[debug]---- url: https://api.appcenter.ms/v0.1/apps/FOO_BAR/BIZ_BUZZ/uploads/releases/SOME_ID
[debug]---- "{\"id\":\"SOME_ID\",\"upload_status\":\"uploadFinished\"}"
[debug]---- http call status code: 200

It will simply loop over these logs over and over for 15+ minutes.

Eventually, the task will succeed but the release will not appear in App Center.

Brantone commented 3 years ago

Status page (https://status.appcenter.ms/) is saying it's resolved ... but even trying it out through swapper (https://openapi.appcenter.ms/#/distribute/releaseUploads_create) throws a 500 error. 🤔

kawazoe commented 3 years ago

I'm getting this error in DevOps now:

2020-12-08T21:09:31.6967223Z ##[debug]-- Mark package available.
2020-12-08T21:09:31.6967976Z ##[debug]---- url: https://api.appcenter.ms/v0.1/apps/FOO_BAR/BIZ_BUZZ/releases/121/groups
2020-12-08T21:09:31.9328216Z ##[debug]---- {"code":"dependent_service_error","message":"Error: {\"error\":{\"code\":\"DatabaseError\",\"message\":\"Conversion failed when converting from a character string to uniqueidentifier.\"}}"}
2020-12-08T21:09:31.9329359Z ##[debug]---- http call status code: 500
rpendleton commented 3 years ago

@Brantone You're probably running into this one: https://status.appcenter.ms/incidents/4nbhlm0lxsvt

I'm not sure when, but the incident page says that there was prior communication about the old distribute APIs being shut down, and that everyone needs to move to appcenter-cli v2.7.0 or newer. They also mention moving away from the Swagger APIs that you linked. It seems those APIs were officially shut down yesterday:

The appcenter distribute release command in App Center CLI versions prior to v2.7.0 has stopped functioning as per our earlier communications (related to the HockeyApp SDK shutdown communicated earlier, as the old API depends on a HockeyApp proxy). To continue using the App Center distribution capability from the CLI, please upgrade your CLI to the latest version (v2.7.0 or above). You can upgrade the Appcenter CLI by running the following command in your terminal/command prompt: npm i -g appcenter-cli.

Also, if you are using custom scripts with our swagger API, please adjust your script based off the implementation of App Center CLI.

As for the new APIs, I can't find any documentation on them. I ran mitmproxy and the upload seems more complex now (it's doing chunked uploads), so my team decided to just install Node.js on our build agents and switch to using appcenter-cli for uploads, rather than making the distribute release API calls ourselves.

RomanPoschl commented 3 years ago

Hello I think I runned into similar problem. We have Azure DevOps Server 2019 version 17.143.28621.4

I am using this task:

2020-12-08T23:08:53.5435620Z Task : App Center Distribute 2020-12-08T23:08:53.5435680Z Description : Distribute app builds to testers and users via App Center 2020-12-08T23:08:53.5435750Z Version : 1.139.2 2020-12-08T23:08:53.5435810Z Author : Microsoft Corporation

I am getting error about "This API is deprecated. Please use the latest version of the App Center CLI" But how can I update App Center CLI on Azure Devops Server. Should I install some DevOps update package? I am writing here because I think it's similar issue. If not I will start new.

Many thanks.

kawazoe commented 3 years ago

@Symorp You should update the task. The latest version is 3.173.0.

Brantone commented 3 years ago

@rpendleton Part of the confusion is the lack of consistency .. for example: the status mentions Swagger API, but has not been consistent today. Ex: aforementioned 500, half way through today it moved to 410, and yet it still lists as available despite others which are officially deprecated are struck-out with mention of being deprecated. Fwiw , I know it's not "you", just posting as road-marker if others hitting similar confusion.

wangghon commented 3 years ago

I get the release uploaded after I created a new api token and used it in our pipeline. Previously I got the 410 response with deprecated API error messge

pcohensc commented 3 years ago

To best assist the App Center team, I've created a mockup for them for https://openapi.appcenter.ms, which they may use freely:

Screen Shot 2020-12-08 at 10 48 07 PM

jameslavery-zz commented 3 years ago

We're using Octopus for our uploads/deploys, with an agent on one of our own bare metal Macs.

We've upgraded appcenter-cli to 2.7.3 on the Mac and have not changed anything else in our scripts (including the token).

Deploys are now working again for us.

For clarity, the command line we're using is:

appcenter distribute release -g "QA Testing" -f "$UpdatedAppPath" -a $AppId --token $ApiToken -r "$Notes - $UserContact"

RomanPoschl commented 3 years ago

@kawazoe Thanks for the hint, I updated my Azure DevOps instance. To version 17.153.29522.3, patch 6. But my AppCenter task is still low 3.154.1 and I am still getting the error, Is there a way how to update only the task? Also, I found a discussion on azure-pipelines-tasks on Github so I think, I will continue there

Edgaras91 commented 3 years ago

I have same issue as @Symorp How to update the task? I am running 3.154.1. The task only gives these settings and cant manually replace the star with a specific version: image

Edit: There is a separate issue for this here: https://github.com/microsoft/azure-pipelines-tasks/issues/14047

donnib commented 3 years ago

Something is still not right. I upgraded to 2.7.3 and if i do appcenter help distribute release it says "Command distribute release is invalid" which indicates there are more problem. Can anybody confirm that you can issue distribute in the new cli version 2.7.3 ?

IoannisFMG commented 3 years ago

it's appcenter distribute release --help

donnib commented 3 years ago

it's appcenter distribute release --help

Still doesn't work for me : I get Command distribute release --help is invalid

IoannisFMG commented 3 years ago
jenkins@mac-mini ~ % appcenter --version
appcenter version 2.7.3
jenkins@mac-mini ~ % appcenter distribute release --help

Upload release binary and trigger distribution, at least one of --store or --group must be specified

Usage: appcenter distribute release -f|--file <arg> [--mandatory] [--silent]
         [-R|--release-notes-file <arg>] [-r|--release-notes <arg>]
         [-s|--store <arg>] [-g|--group <arg>] [-n|--build-number <arg>]
         [-b|--build-version <arg>] [-a|--app <arg>]

Options:
    -f|--file <arg>                           Path to binary file             
       --mandatory                            Make the release mandatory for  
                                              the testers (default is false)  
       --silent                               Do not notify testers of this   
                                              release                         
    -R|--release-notes-file <arg>             Path to release notes file      
    -r|--release-notes <arg>                  Release notes text              
    -s|--store <arg>                          Store name                      
    -g|--group <arg>                          Distribution group name         
    -n|--build-number <arg>                   Build number parameter required 
                                              for macOS .pkg and .dmg files   
    -b|--build-version <arg>                  Build version parameter required
                                              for .zip, .msi, .pkg and .dmg   
                                              files                           
    -a|--app <arg>                            Specify app in the              
                                              <ownerName>/<appName> format    

Common Options (works on all commands):
       --disable-telemetry             Disable telemetry for this command     
    -v|--version                       Display appcenter version              
       --quiet                         Auto-confirm any prompts without       
                                       waiting for input                      
    -h|--help                          Display help for current command       
       --env <arg>                     Environment when using API token       
       --token <arg>                   API token                              
       --output <arg>                  Output format: json                    
       --debug                         Display extra output for debugging     

Works fine here check your version, maybe?

donnib commented 3 years ago

@IoannisFMG weird, i do run 2.7.3 and tried on two mac mini machines and same result. if i do appcenter distribute release i get Command distribute release is invalid.

donnib commented 3 years ago

Maybe there is something missing somewhere ?

jameslavery-zz commented 3 years ago

@donnib - can you post your command line here?

donnib commented 3 years ago
➜  ~ appcenter distribute release
Error: Command distribute release is invalid
➜  ~ appcenter --version
appcenter version 2.7.3
➜  ~ appcenter distribute release --help
Error: Command distribute release --help is invalid
➜  ~
narciszait commented 3 years ago

hi everyone. i tried looking through the code to figure out the new api call that replaces /v0.1/apps/{owerner}/{app_name}/release_uploads but i cannot figure it out. any ideas? we are using a powershell script that does the upload. it does more or less the same thing as the app-center-cli, but at the moment is failing with "deprecated API" and refers to this repo.

airxnoor commented 3 years ago

For us who don't use the appcenter tool, what's network commands to push a distribution?

POST here-and-there PATCH another-url-and-params

that would be awesome.

Help, @pcohensc?

jameslavery-zz commented 3 years ago

@donnib What node version are you running? This issue and this one indicate you need node 10.

Not running node 10 gives a 'command xxx is invalid' error it seems.

gaurav-jayasawal commented 3 years ago

Still running into this on Android after updating the distribute version to 4.0.0 as suggested here. https://docs.microsoft.com/en-us/appcenter/sdk/distribute/android

{"code":"gone","message":"This API is deprecated. Please use the latest version of the App Center CLI: https://github.com/microsoft/appcenter-cli, or if you need a custom script please use the CLI as the basis for your implementation. ..}

gaurav-jayasawal commented 3 years ago

@airthings-noordawod https://openapi.appcenter.ms/#/build/builds_distribute Did you look at the apis here?

pcohensc commented 3 years ago

@airthings-noordawod I was not able to figure out their new uploads API without just giving up and using their CLI.

It looks much more complicated than the old one: https://github.com/microsoft/appcenter-cli/blob/master/appcenter-file-upload-client-node/src/ac-fus-uploader.ts

airxnoor commented 3 years ago

Well duhh. Hence my question... Why not just have a simple 1, 2, 3 steps so others can use what they want to publish an artifact? curl anyone?

airxnoor commented 3 years ago

Ok, if anyone is interested to using a simple mechanism to publish an asset to appcenter, instead of deploying nodejs (duhh) to all nodes, here's a 1, 2, 3 steps to do it:

https://github.com/microsoft/appcenter/issues/2069#issuecomment-740654621

Microsoft: when you make a change that affects thousands, will you WRITE IT IN BIG LETTERS and well ahead of time, please? Thank you.

airxnoor commented 3 years ago

Also, here's a link to a bash script that someone concucted that implements the new API: https://gist.github.com/ouchadam/c74fa26c639a50d68bc35ee5749f868c

rpendleton commented 3 years ago

Looks like Microsoft is going to be re-enabling the disabled endpoints until Feb 1st, 2021 to help with the transition. They also mentioned that they'll create documentation for these new endpoints for those unable to use appcenter-cli:

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

donnib commented 3 years ago

@jameslavery thank you that solved my problem.

russelarms commented 3 years ago

Here are the updated API steps: https://docs.microsoft.com/en-us/appcenter/distribution/uploading#upload-new-release

PGHM commented 2 years ago

Here are the updated API steps: https://docs.microsoft.com/en-us/appcenter/distribution/uploading#upload-new-release

The person who made those steps never really tried to use them... better to use https://github.com/microsoft/appcenter-Xamarin.UITest-Demo/blob/main/ac-distribute.sh this as a guide