[JIRA] (JENKINS-60171) HTTP 422 uploading Android APK artifact

62 views
Skip to first unread message

jruizmail@gmail.com (JIRA)

unread,
Nov 14, 2019, 7:22:04 AM11/14/19
to jenkinsc...@googlegroups.com
Javier Ruiz created an issue
 
Jenkins / Bug JENKINS-60171
HTTP 422 uploading Android APK artifact
Issue Type: Bug Bug
Assignee: Mez Pahlan
Components: appcenter-plugin
Created: 2019-11-14 12:21
Priority: Minor Minor
Reporter: Javier Ruiz

Hi!

I'm not sure if maybe this is an AppCenter issue or it's related to the plugin. I'm getting an HTTP 422 error uploading .apk artifacts. I'm posting here cause as soon as my job fails due to the 422 error, I can download the apk artifact and manually upload it to AppCenter without any issue, so I believe it's not related to the artifact itself.

Here's the full stack trace I get:


Creating an upload resource.
Create upload resource successful.
Uploading app to resource.
io.jenkins.plugins.appcenter.AppCenterException: Upload app to resource unsuccessful: 
 at io.jenkins.plugins.appcenter.task.internal.UploadAppToResourceTask.lambda$execute$0(UploadAppToResourceTask.java:57)
 at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
 at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
 at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
 at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2159)
 at retrofit2.CompletableFutureCallAdapterFactory$BodyCallAdapter$2.onResponse(CompletableFutureCallAdapterFactory.java:81)
 at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:129)
 at okhttp3.RealCall$AsyncCall.execute(RealCall.java:174)
 at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
 at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
 at java.base/java.lang.Thread.run(Thread.java:835)
Caused by: retrofit2.HttpException: HTTP 422 Unprocessable Entity
 ... 7 more
io.jenkins.plugins.appcenter.AppCenterException: Upload to AppCenter failed.
 at io.jenkins.plugins.appcenter.task.UploadTask.call(UploadTask.java:56)
 at io.jenkins.plugins.appcenter.task.UploadTask.call(UploadTask.java:17)
 at hudson.remoting.UserRequest.perform(UserRequest.java:212)
 at hudson.remoting.UserRequest.perform(UserRequest.java:54)
 at hudson.remoting.Request$2.run(Request.java:369)
 at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
 at java.util.concurrent.FutureTask.run(FutureTask.java:264)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
 at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:93)
 at java.lang.Thread.run(Thread.java:835)
 Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from 192.168.216.128/192.168.216.128:58182
 at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1743)
 at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
 at hudson.remoting.Channel.call(Channel.java:957)
 at hudson.FilePath.act(FilePath.java:1162)
 at io.jenkins.plugins.appcenter.AppCenterRecorder.uploadToAppCenter(AppCenterRecorder.java:142)
 at io.jenkins.plugins.appcenter.AppCenterRecorder.perform(AppCenterRecorder.java:129)
 at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:79)
 at org.jenkins_ci.plugins.flexible_publish.builder.FailFastBuilder.perform(FailFastBuilder.java:102)
 at org.jenkins_ci.plugins.run_condition.BuildStepRunner$2.run(BuildStepRunner.java:110)
 at org.jenkins_ci.plugins.run_condition.BuildStepRunner$Fail.conditionalRun(BuildStepRunner.java:154)
 at org.jenkins_ci.plugins.run_condition.BuildStepRunner.perform(BuildStepRunner.java:105)
 at org.jenkins_ci.plugins.flexible_publish.strategy.FailFastExecutionStrategy.perform(FailFastExecutionStrategy.java:63)
 at org.jenkins_ci.plugins.flexible_publish.ConditionalPublisher.perform(ConditionalPublisher.java:206)
 at org.jenkins_ci.plugins.flexible_publish.FlexiblePublisher.perform(FlexiblePublisher.java:124)
 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
 at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
 at hudson.model.Build$BuildExecution.post2(Build.java:186)
 at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
 at hudson.model.Run.execute(Run.java:1840)
 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
 at hudson.model.ResourceController.execute(ResourceController.java:97)
 at hudson.model.Executor.run(Executor.java:429)
Caused by: java.util.concurrent.ExecutionException: io.jenkins.plugins.appcenter.AppCenterException: Upload app to resource unsuccessful: 
 at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
 at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2070)
 at io.jenkins.plugins.appcenter.task.UploadTask.call(UploadTask.java:54)
 ... 10 more
Caused by: io.jenkins.plugins.appcenter.AppCenterException: Upload app to resource unsuccessful: 
 at io.jenkins.plugins.appcenter.task.internal.UploadAppToResourceTask.lambda$execute$0(UploadAppToResourceTask.java:57)
 at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
 at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
 at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
 at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2159)
 at retrofit2.CompletableFutureCallAdapterFactory$BodyCallAdapter$2.onResponse(CompletableFutureCallAdapterFactory.java:81)
 at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:129)
 at okhttp3.RealCall$AsyncCall.execute(RealCall.java:174)
 at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
 ... 1 more
Caused by: retrofit2.HttpException: HTTP 422 Unprocessable Entity
 ... 7 more

Thanks!

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

mez.pahlan@gmail.com (JIRA)

unread,
Nov 18, 2019, 4:18:03 AM11/18/19
to jenkinsc...@googlegroups.com
Mez Pahlan commented on Bug JENKINS-60171
 
Re: HTTP 422 uploading Android APK artifact

Hi Javier Ruiz thanks for raising this. I can't see the exact cause of this error so I am only guessing at this stage.

  1. What's the name of the file you're trying to upload?
  2. What version of the plugin are you using?

We did fix an issue with non ascii file names in a previous release so if you're on 0.6.2 above I would be interested to know (if not please upgrade and try again).

Maybe also, if you are able to, paste in your configuration for the plugin and I can try to reproduce the issue. Obviously redact anything sensitive.

kljajic.jovan@gmail.com (JIRA)

unread,
Nov 20, 2019, 9:33:04 AM11/20/19
to jenkinsc...@googlegroups.com

Jenkins version: 2.190.1, same behavior on 2.190.2

AppCenter plugin: 0.7.2

As of today, 2019-11-20, we are experiencing the same issue. Note that we were using 2.190.1 and upgrade to 2.190.2 didn't change the issue:

 

Creating an upload resource.
io.jenkins.plugins.appcenter.AppCenterException: Upload to AppCenter failed.
            at io.jenkins.plugins.appcenter.task.UploadTask.call(UploadTask.java:56)
            at io.jenkins.plugins.appcenter.task.UploadTask.call(UploadTask.java:17)
            at hudson.remoting.UserRequest.perform(UserRequest.java:212)
            at hudson.remoting.UserRequest.perform(UserRequest.java:54)
            at hudson.remoting.Request$2.run(Request.java:369)
            at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
            at java.lang.Thread.run(Thread.java:748)
            Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to EC2 (Ava) - android (i-0f83c70aa209598cf)
                        at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1743)
                        at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
                        at hudson.remoting.Channel.call(Channel.java:957)
                        at hudson.FilePath.act(FilePath.java:1162)
                        at io.jenkins.plugins.appcenter.AppCenterRecorder.uploadToAppCenter(AppCenterRecorder.java:142)
                        at io.jenkins.plugins.appcenter.AppCenterRecorder.perform(AppCenterRecorder.java:129)
                        at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)
                        at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
                        at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
                        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
                        ... 4 more
Caused by: java.util.concurrent.ExecutionException: io.jenkins.plugins.appcenter.AppCenterException: Upload app to resource unsuccessful:
            at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
            at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895)
            at io.jenkins.plugins.appcenter.task.UploadTask.call(UploadTask.java:54)
            ... 9 more
Caused by: io.jenkins.plugins.appcenter.AppCenterException: Upload app to resource unsuccessful:
            at io.jenkins.plugins.appcenter.AppCenterLogger.logFailure(AppCenterLogger.java:23)
            at io.jenkins.plugins.appcenter.task.internal.UploadAppToResourceTask.lambda$execute$0(UploadAppToResourceTask.java:66)
            at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:760)
            at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:736)
            at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
            at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1977)
            at retrofit2.CompletableFutureCallAdapterFactory$BodyCallAdapter$2.onResponse(CompletableFutureCallAdapterFactory.java:81)
            at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:129)
            at okhttp3.RealCall$AsyncCall.execute(RealCall.java:174)
            at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
            ... 3 more
Caused by: retrofit2.HttpException: HTTP 422 Unprocessable Entity
            ... 7 more

 

 

Add Comment Add Comment
 

mez.pahlan@gmail.com (JIRA)

unread,
Nov 20, 2019, 9:52:03 AM11/20/19
to jenkinsc...@googlegroups.com

What's the name of the file you're trying to upload?

Maybe also, if you are able to, paste in your configuration for the plugin and I can try to reproduce the issue. Obviously redact anything sensitive.

Add Comment Add Comment
 

kljajic.jovan@gmail.com (JIRA)

unread,
Nov 20, 2019, 10:15:02 AM11/20/19
to jenkinsc...@googlegroups.com

Hi,

File names are:

Previous job:

 

app-debug-androidTest.apk

Latest job:

app-0.1.0-1-20-11-15.04.apk

Downgrade from 0.7.2 to 0.7.1 fixes the issue..

Here is the pipeline snippet:

stage('Upload to App Center'){
  if (config.appCenter) {
    withCredentials([string(credentialsId: 'appcenter-token', variable: 'APPCENTER_API_TOKEN')]) {
      sh "find app -type f -name \"*.apk\" | xargs ls -Art | tail -n 1 > file_to_upload.txt"
      def latestApk = readFile("${WORKSPACE}/file_to_upload.txt").trim()
      println latestApk
      appCenter apiToken: "${APPCENTER_API_TOKEN}", appName: 'Ommited', distributionGroups: 'Ommited', ownerName: 'XYZ', pathToApp: "${latestApk}"
      }
    }
 }

 

mez.pahlan@gmail.com (JIRA)

unread,
Nov 20, 2019, 11:20:03 AM11/20/19
to jenkinsc...@googlegroups.com

Thanks Jovan Kljajic. Between 0.7.1 and 0.7.2 we added support for ANT style patterns in the pathToApp variable. So maybe it is something to do with that. Actually you shouldn't need to find the files using the the find command anymore.

Can you confirm that the following works on a version 0.7.2 or greater.

stage('Upload to App Center'){
  if (config.appCenter) {
    withCredentials([string(credentialsId: 'appcenter-token', variable: 'APPCENTER_API_TOKEN'
)]) {
      // No need to do this anymore
      //sh "find app -type f -name \"*.apk\" | xargs ls -Art | tail -n 1 > file_to_upload.txt"
      //def latestApk = readFile("${WORKSPACE}/file_to_upload.txt").trim()
      //println latestApk

      appCenter apiToken: "${APPCENTER_API_TOKEN}", appName: 'Ommited', distributionGroups: 'Ommited', ownerName: 'XYZ', pathToApp: "app/*.apk"
      }
    }
 }

Also we could improve the error messages within the plugin when AppCenter gives us an error. At the moment we only show the HTTP code but there is actually a lot more rich information that we throw away. I'm investigating how to surface that information. We might need to fix this after JENKINS-60008 gets merged.

mez.pahlan@gmail.com (JIRA)

unread,
Nov 20, 2019, 12:06:03 PM11/20/19
to jenkinsc...@googlegroups.com
Mez Pahlan updated an issue
 
Change By: Mez Pahlan
Priority: Minor Major

kljajic.jovan@gmail.com (JIRA)

unread,
Nov 20, 2019, 3:16:03 PM11/20/19
to jenkinsc...@googlegroups.com
Jovan Kljajic commented on Bug JENKINS-60171
 
Re: HTTP 422 uploading Android APK artifact

Mez Pahlan Thank you for your time. The change you proposed worked well with 0.7.2. Since apk file isn't directly under app directory, I'm using:

appCenter pathToApp: "app/**/*.apk", ...

And it works like a charm! Thank you, much obliged!

mez.pahlan@gmail.com (JIRA)

unread,
Nov 20, 2019, 3:26:03 PM11/20/19
to jenkinsc...@googlegroups.com

Thanks Jovan Kljajic you're very welcome. Glad I could help.

Javier Ruiz is your problem the same? Would a similar fix in your pipeline work?

mez.pahlan@gmail.com (JIRA)

unread,
Nov 26, 2019, 2:14:05 PM11/26/19
to jenkinsc...@googlegroups.com

Hi Javier Ruiz have you had a chance to retest this with the new syntax described above? I'll close this in a week if I don't hear back. Feel free to reopen but can you paste your configuration if you do. Many thanks.

twallace@bossfight.com (JIRA)

unread,
Jan 28, 2020, 1:11:03 PM1/28/20
to jenkinsc...@googlegroups.com

Mez,

 I am running into this same issue with 0.8.0  After build completes I get the following.  I can directly upload the exact .apk produced to the appcenter website and it works just fine.   Note this is with .APK  specifically. The .ipa upload works fine.
File found matching pattern: build/client/Dingo_google_universal_enterprise.apk
Creating an upload resource for app.
Create upload resource for app successful.
Uploading app to resource.


io.jenkins.plugins.appcenter.AppCenterException: Upload to AppCenter failed.
at io.jenkins.plugins.appcenter.task.UploadTask.call(UploadTask.java:56)
at io.jenkins.plugins.appcenter.task.UploadTask.call(UploadTask.java:17)

at hudson.remoting.UserRequest.perform(UserRequest.java:211)


at hudson.remoting.UserRequest.perform(UserRequest.java:54)
at hudson.remoting.Request$2.run(Request.java:369)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to BS-MAC-10952
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)
at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
at hudson.remoting.Channel.call(Channel.java:955)
at hudson.FilePath.act(FilePath.java:1159)
at io.jenkins.plugins.appcenter.AppCenterRecorder.uploadToAppCenter(AppCenterRecorder.java:165)
at io.jenkins.plugins.appcenter.AppCenterRecorder.perform(AppCenterRecorder.java:152)


at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)
at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
... 4 more
Caused by: java.util.concurrent.ExecutionException: io.jenkins.plugins.appcenter.AppCenterException: Upload app to resource unsuccessful:
at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895)
at io.jenkins.plugins.appcenter.task.UploadTask.call(UploadTask.java:54)
... 9 more
Caused by: io.jenkins.plugins.appcenter.AppCenterException: Upload app to resource unsuccessful:
at io.jenkins.plugins.appcenter.AppCenterLogger.logFailure(AppCenterLogger.java:23)

at io.jenkins.plugins.appcenter.task.internal.UploadAppToResourceTask.lambda$uploadApp$0(UploadAppToResourceTask.java:75)


at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:760)
at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:736)
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1977)
at retrofit2.CompletableFutureCallAdapterFactory$BodyCallAdapter$2.onResponse(CompletableFutureCallAdapterFactory.java:81)
at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:129)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:174)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
... 3 more
Caused by: retrofit2.HttpException: HTTP 422 Unprocessable Entity

twallace@bossfight.com (JIRA)

unread,
Jan 28, 2020, 1:12:03 PM1/28/20
to jenkinsc...@googlegroups.com

Let me know what further information I can provide to help with this. Thanks.

Running latest stable Jenkins all updated. (2.204.1)

twallace@bossfight.com (JIRA)

unread,
Jan 28, 2020, 1:18:03 PM1/28/20
to jenkinsc...@googlegroups.com

same function is used to upload both .ipa's and .apk

 def uploadBundleToAppCenter(bundle, appenv) {
def pipeline = new com.companyu.jenkins.PipelineUtils();
withCredentials([string(credentialsId: 'appcenter_token_default', variable: 'APPCENTER_API_TOKEN')]) {
.(p3-p4 are just some string manipulation to provide a single path to file)
appPath = p3[p3.indexOf(p4)+p4.length()+1..-1];
dbgPath = null
if (appPath.indexOf('.ipa')>0)

{ dbgPath = appPath.replaceAll(/\.ipa$/, '.dSYM.zip') }

appCenter apiToken: APPCENTER_API_TOKEN,
appName: 'appname_'+appenv,
distributionGroups: bundle.hockeyapp.teams,
ownerName: '-REAL OWNER NAME--',
notifyTesters: false,
pathToApp: appPath,
pathToDebugSymbols: dbgPath,
releaseNotes: bundle.hockeyapp.releaseNotes;

}
}

 

twallace@bossfight.com (JIRA)

unread,
Jan 29, 2020, 8:43:02 AM1/29/20
to jenkinsc...@googlegroups.com
Terry Wallace updated an issue
 
Change By: Terry Wallace
Priority: Major Critical

mez.pahlan@gmail.com (JIRA)

unread,
Jan 29, 2020, 11:18:03 AM1/29/20
to jenkinsc...@googlegroups.com
Mez Pahlan commented on Bug JENKINS-60171
 
Re: HTTP 422 uploading Android APK artifact

Hi Terry Wallace massive apologies, I've been quite busy at work lately and have neglected this. I'll try and get some this week to investigate. Thanks for raising it.

twallace@bossfight.com (JIRA)

unread,
Jan 31, 2020, 9:27:02 AM1/31/20
to jenkinsc...@googlegroups.com

Thanks for responding, I'll be available whenever you have time to look at it, should you need any more data point.

mez.pahlan@gmail.com (JIRA)

unread,
Feb 2, 2020, 7:18:02 PM2/2/20
to jenkinsc...@googlegroups.com

Hi Terry Wallace, I'm in the process of releasing 0.8.1 of the plugin that will better output the HTTP error when we encounter it. Could you give it another go with that version and let me know the error output. Many thanks.

twallace@bossfight.com (JIRA)

unread,
Feb 3, 2020, 9:30:11 AM2/3/20
to jenkinsc...@googlegroups.com

Mez,
I installed 1.81 and now get a more informational error. It seems to be complaining about the Platform. Which as far as I can see should be automatic depending on the file we upload. And these are definately .apk files. This would also explain why the iOS builds are working just fine. If you are setting a platform type in the background, how are you ascertaining the type ?

Terry.

SCRIPT STEPS:
[Pipeline] withCredentials
Masking supported pattern matches of $APPCENTER_API_TOKEN
[Pipeline] {
[Pipeline] step


File found matching pattern: build/client/Dingo_google_universal_enterprise.apk
Creating an upload resource for app.
Create upload resource for app successful.

RESULT:

io.jenkins.plugins.appcenter.AppCenterException: Upload app to resource unsuccessful: HTTP 422 Unprocessable Entity:

{"status":"error","message":"Platform does not match. Expected value: iOS. Actual value: Android."}

at io.jenkins.plugins.appcenter.AppCenterLogger.logFailure(AppCenterLogger.java:23)
at io.jenkins.plugins.appcenter.AppCenterLogger.logFailure(AppCenterLogger.java:37)
at io.jenkins.plugins.appcenter.task.internal.UploadAppToResourceTask.lambda$uploadApp$0(UploadAppToResourceTask.java:71)
Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to BS-VMAC-02


at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)
at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
at hudson.remoting.Channel.call(Channel.java:955)
at hudson.FilePath.act(FilePath.java:1159)
at io.jenkins.plugins.appcenter.AppCenterRecorder.uploadToAppCenter(AppCenterRecorder.java:165)
at io.jenkins.plugins.appcenter.AppCenterRecorder.perform(AppCenterRecorder.java:152)
at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)
at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)
Caused: java.util.concurrent.CompletionException
at java.util.concurrent.CompletableFuture.encodeRelay(CompletableFuture.java:326)
at java.util.concurrent.CompletableFuture.completeRelay(CompletableFuture.java:338)
at java.util.concurrent.CompletableFuture.uniRelay(CompletableFuture.java:911)
at java.util.concurrent.CompletableFuture$UniRelay.tryFire(CompletableFuture.java:899)


at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1977)

at io.jenkins.plugins.appcenter.task.internal.UploadAppToResourceTask.lambda$uploadApp$0(UploadAppToResourceTask.java:72)


at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:760)
at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:736)
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1977)
at retrofit2.CompletableFutureCallAdapterFactory$BodyCallAdapter$2.onResponse(CompletableFutureCallAdapterFactory.java:81)
at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:129)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:174)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Finished: FAILURE

twallace@bossfight.com (JIRA)

unread,
Feb 3, 2020, 9:32:04 AM2/3/20
to jenkinsc...@googlegroups.com
Terry Wallace edited a comment on Bug JENKINS-60171
Mez,
I installed 1.81 and now get a more informational error. It seems to be complaining about the Platform. Which as far as I can see should be automatic depending on the file we upload.  And these are definately .apk files.  This would also explain why the iOS builds are working just fine. If you are setting a platform type in the background, how are you ascertaining the type ?

Terry.

SCRIPT STEPS:
[Pipeline] withCredentials
Masking supported pattern matches of $APPCENTER_API_TOKEN
[Pipeline] {
[Pipeline] step
File found matching pattern: build/client/Dingo_google_universal_enterprise.apk
Creating an upload resource for app.
Create upload resource for app successful.

RESULT:

io.jenkins.plugins.appcenter.AppCenterException: Upload app to resource unsuccessful: HTTP 422 Unprocessable Entity:


{"status":"error","message":"Platform does not match. Expected value: iOS. Actual value: Android."}

at io.jenkins.plugins.appcenter.AppCenterLogger.logFailure(AppCenterLogger.java:23)
at io.jenkins.plugins.appcenter.AppCenterLogger.logFailure(AppCenterLogger.java:37)
at io.jenkins.plugins.appcenter.task.internal.UploadAppToResourceTask.lambda$uploadApp$0(UploadAppToResourceTask.java:71)
Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to BS MAC - VMAC-02 0872

mez.pahlan@gmail.com (JIRA)

unread,
Feb 3, 2020, 4:48:03 PM2/3/20
to jenkinsc...@googlegroups.com

Hi Terry Wallace thanks so much for that. Can you post your pipeline configuration please. Obviously redact anything sensitive.

> If you are setting a platform type in the background, how are you ascertaining the type ?

We only try and ascertain the platform type for the debug symbols because we need to pass an enum type for the platform to satisfy the API for debug symbols. However if that were failing I would expect the stack trace to have lines referencing "Upload symbols to resource unsuccessful:". Instead it has a reference to "Upload app to resource unsuccessful:". We don't need to specify the platform for the main app upload (as best as I remember).

My initial suspicion is that for some reason the upload URL that was used to successfully upload your IOS app is trying to be used to upload the Android app. Might be clearer when you repost your pipeline configuration in full.

mez.pahlan@gmail.com (JIRA)

unread,
Feb 3, 2020, 4:55:02 PM2/3/20
to jenkinsc...@googlegroups.com

Wait...... hang about does this help: https://github.com/microsoft/fastlane-plugin-appcenter/issues/111

Can you check that when you invoke your script / pipeline configuration to upload your Android app that you're not accidently trying to upload to the IOS version of your project in AppCenter like the user in that Fastlane issue was.

mez.pahlan@gmail.com (JIRA)

unread,
Feb 3, 2020, 4:57:03 PM2/3/20
to jenkinsc...@googlegroups.com

twallace@bossfight.com (JIRA)

unread,
Feb 3, 2020, 5:13:03 PM2/3/20
to jenkinsc...@googlegroups.com

no I'm sure its not the case. Here is the jenkins script

 

def uploadBundleToAppCenter(bundle, appenv) {
def pipeline = new com.company.jenkins.PipelineUtils();


withCredentials([string(credentialsId: 'appcenter_token_default', variable: 'APPCENTER_API_TOKEN')]) {

p1 = bundle.outputPath;
p2 = WORKSPACE;
p3 = p1[p1.indexOf(p2)+p2.length()+1..-1];
p4 = 'client/Assets/Appconfigs/../../../'


appPath = p3[p3.indexOf(p4)+p4.length()+1..-1];
dbgPath = null
if (appPath.indexOf('.ipa')>0)

{ dbgPath = appPath.replaceAll(/\.ipa$/, '.dSYM.zip') }

//Add other tests here if need to add other debug symbols.

appCenter apiToken: APPCENTER_API_TOKEN,
appName: 'name_'+appenv, //currently hardcoded. UNtil rewrite.
distributionGroups: bundle.hockeyapp.teams,
ownerName: '*Actual owner name removed',


notifyTesters: false,
pathToApp: appPath,
pathToDebugSymbols: dbgPath,
releaseNotes: bundle.hockeyapp.releaseNotes;

}
}

 

and the only thing built and passed to this is the name of the .ipa or the .apk

as you can see from my earlier post it says "File found matching pattern: build/client/Dingo_google_universal_enterprise.apk"

and I can browse to that file and upload to appcenter directly and it works.

The P1-P4 strings are just to trim the extra long workspace paths to direct /subdirectory paths below the client.

appPath is build/client/Dingo_google_universal_enterprise.apk"

dbgPath = null.

 

twallace@bossfight.com (JIRA)

unread,
Feb 3, 2020, 5:17:02 PM2/3/20
to jenkinsc...@googlegroups.com
Terry Wallace edited a comment on Bug JENKINS-60171
no I'm sure its not the case. Here is the jenkins script

EDIT:(On reading the second link you sent..I'm not so sure.. that could indeed be the case..   Thats a terrible design on there part to use a single endpoint and change the name of the app behind the scenes on you.  I'll try appending the -1 to the android uploads... makes me wonder if you made a windows universal app first would your ios be -1 and your android -2 ?  )

mez.pahlan@gmail.com (JIRA)

unread,
Feb 4, 2020, 2:16:03 AM2/4/20
to jenkinsc...@googlegroups.com

Terry Wallace yeah I've seen it a lot whilst Googling the error. I'll try and include some more debug information when we receive that type of error to get users to check these parameters.

Let me know the change goes for you so I can update this priority accordingly. Many thanks!

twallace@bossfight.com (JIRA)

unread,
Feb 4, 2020, 9:06:03 AM2/4/20
to jenkinsc...@googlegroups.com
Terry Wallace edited a comment on Bug JENKINS-60171
Yes that fixed it.  I think throwing a not note into the usage instructions would be a good idea.  Just something that calls out the fact when you are looking for the \{owner_name}/\{app_name} on appcenter that Microsoft will append a  '-1' to the app_name for another app with the same name on a different platform.  Probably more an issue for those of us that were migrating from HockeyApp where each app/platform had its own API key for uploading.

The fact that the "-1" name addition only appears in the URL field and not on the actual site anywhere is very misleading on Microsoft's part.

Thanks for all your hard work on the plugin !! In case anyone forgot to tell you how much the hundreds of people who are using it appreciate the work.

 

twallace@bossfight.com (JIRA)

unread,
Feb 4, 2020, 9:06:03 AM2/4/20
to jenkinsc...@googlegroups.com

Yes that fixed it.  I think throwing a not into the usage instructions would be a good idea.  Just something that calls out the fact when you are looking for the {owner_name}/{app_name} on appcenter that Microsoft will append a  '-1' to the app_name for another app with the same name on a different platform.  Probably more an issue for those of us that were migrating from HockeyApp where each app/platform had its own API key for uploading.

The fact that the "-1" name addition only appears in the URL field and not on the actual site anywhere is very misleading on Microsoft's part.

Thanks for all your hard work on the plugin !! In case anyone forgot to tell you how much the hundreds of people who are using it appreciate the work.

 

mez.pahlan@gmail.com (JIRA)

unread,
Feb 4, 2020, 9:18:03 AM2/4/20
to jenkinsc...@googlegroups.com

Thanks mate! Appreciate the kind words.

I'll update the documentation my end to remind people and then consider this closed. Glad it works for you.

mez.pahlan@gmail.com (JIRA)

unread,
Feb 4, 2020, 1:36:04 PM2/4/20
to jenkinsc...@googlegroups.com
Mez Pahlan started work on Bug JENKINS-60171
 
Change By: Mez Pahlan
Status: Reopened In Progress

mez.pahlan@gmail.com (JIRA)

unread,
Feb 4, 2020, 1:36:04 PM2/4/20
to jenkinsc...@googlegroups.com
Change By: Mez Pahlan
Resolution: Fixed
Status: Fixed but Unreleased Reopened

mez.pahlan@gmail.com (JIRA)

unread,
Feb 4, 2020, 1:36:04 PM2/4/20
to jenkinsc...@googlegroups.com
Change By: Mez Pahlan
Status: Open Fixed but Unreleased
Resolution: Fixed

mez.pahlan@gmail.com (JIRA)

unread,
Feb 4, 2020, 2:24:02 PM2/4/20
to jenkinsc...@googlegroups.com

mez.pahlan@gmail.com (JIRA)

unread,
Feb 4, 2020, 2:25:03 PM2/4/20
to jenkinsc...@googlegroups.com
Change By: Mez Pahlan
Status: In Review Fixed but Unreleased
Resolution: Fixed

mez.pahlan@gmail.com (JIRA)

unread,
Mar 4, 2020, 4:03:03 PM3/4/20
to jenkinsc...@googlegroups.com
Change By: Mez Pahlan
Status: Fixed but Unreleased Resolved
Released As: 0.8.2
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages