I have configured post build action to upload .dmg to appcenter and i am getting the following error. I am using the latest plugin with the changes made for build version for windows upload. It works fine for windows, apk and ipa. 

       


      ERROR: Build step failed with exception
      io.jenkins.plugins.appcenter.AppCenterException: Upload app to resource unsuccessful: HTTP 400 Bad Request: {"error":"Error: Missing required params from body: build_version, version, Service id: "}

          [JENKINS-63075] Upload to AppCenter DMG upload failing

          srilakshmi Malla created issue -
          srilakshmi Malla made changes -
          Description Original: I have configured post build action to upload .dmg to appcenter and i am getting the following error. 

           

          !image-2020-07-15-13-55-05-422.png!
          ERROR: Build step failed with exception
          io.jenkins.plugins.appcenter.AppCenterException: Upload app to resource unsuccessful: HTTP 400 Bad Request: \{"error":"Error: Missing required params from body: build_version, version, Service id: "}
          New: I have configured post build action to upload .dmg to appcenter and i am getting the following error. I am using the latest plugin with the changes made for build version for windows upload. It works fine for windows, apk and ipa. 

           

          !image-2020-07-15-13-55-05-422.png|width=643,height=342!
           ERROR: Build step failed with exception
           io.jenkins.plugins.appcenter.AppCenterException: Upload app to resource unsuccessful: HTTP 400 Bad Request: \{"error":"Error: Missing required params from body: build_version, version, Service id: "}

          Mez Pahlan added a comment -

          Thanks srilakshmi can you also post the rest of the stack trace along with the error message you've already posted? There should be a better clue as to what endpoint this is coming from. Cheers.

          Mez Pahlan added a comment - Thanks srilakshmi can you also post the rest of the stack trace along with the error message you've already posted? There should be a better clue as to what endpoint this is coming from. Cheers.

          Hi Mez Pahlan

           

          Please find below the full stack trace.

           

          ERROR: Build step failed with exception io.jenkins.plugins.appcenter.AppCenterException: Upload app to resource unsuccessful: HTTP 400 Bad Request: {"error":"Error: Missing required params from body: build_version, Service id: ddde6496-c46e-4016-8280-70f186270925"} 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 JNLP4-connect connection from 10.0.0.11/10.0.0.11:57031 at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1788) at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356) at hudson.remoting.Channel.call(Channel.java:998) at hudson.FilePath.act(FilePath.java:1159) at io.jenkins.plugins.appcenter.AppCenterRecorder.uploadToAppCenter(AppCenterRecorder.java:193) at io.jenkins.plugins.appcenter.AppCenterRecorder.perform(AppCenterRecorder.java:180) at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78) at org.jenkinsci.plugins.conditionalbuildstep.BuilderChain.perform(BuilderChain.java:71) at org.jenkins_ci.plugins.run_condition.BuildStepRunner$2.run(BuildStepRunner.java:112) at org.jenkins_ci.plugins.run_condition.BuildStepRunner$Fail.conditionalRun(BuildStepRunner.java:156) at org.jenkins_ci.plugins.run_condition.BuildStepRunner.perform(BuildStepRunner.java:107) at org.jenkinsci.plugins.conditionalbuildstep.ConditionalBuilder.perform(ConditionalBuilder.java:134) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741) at hudson.model.Build$BuildExecution.build(Build.java:206) at hudson.model.Build$BuildExecution.doRun(Build.java:163) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504) at hudson.model.Run.execute(Run.java:1880) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:428) Caused: java.util.concurrent.CompletionException at java.util.concurrent.CompletableFuture.encodeRelay(Unknown Source) at java.util.concurrent.CompletableFuture.completeRelay(Unknown Source) at java.util.concurrent.CompletableFuture.uniRelay(Unknown Source) at java.util.concurrent.CompletableFuture$UniRelay.tryFire(Unknown Source) at java.util.concurrent.CompletableFuture.postComplete(Unknown Source) at java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source) at io.jenkins.plugins.appcenter.task.internal.UploadAppToResourceTask.lambda$uploadApp$0(UploadAppToResourceTask.java:72) at java.util.concurrent.CompletableFuture.uniWhenComplete(Unknown Source) at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(Unknown Source) at java.util.concurrent.CompletableFuture.postComplete(Unknown Source) at java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source) 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(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

          srilakshmi Malla added a comment - Hi Mez Pahlan   Please find below the full stack trace.   ERROR: Build step failed with exception io.jenkins.plugins.appcenter.AppCenterException: Upload app to resource unsuccessful: HTTP 400 Bad Request: {"error":"Error: Missing required params from body: build_version, Service id: ddde6496-c46e-4016-8280-70f186270925"} 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 JNLP4-connect connection from 10.0.0.11/10.0.0.11:57031 at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1788) at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356) at hudson.remoting.Channel.call(Channel.java:998) at hudson.FilePath.act(FilePath.java:1159) at io.jenkins.plugins.appcenter.AppCenterRecorder.uploadToAppCenter(AppCenterRecorder.java:193) at io.jenkins.plugins.appcenter.AppCenterRecorder.perform(AppCenterRecorder.java:180) at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78) at org.jenkinsci.plugins.conditionalbuildstep.BuilderChain.perform(BuilderChain.java:71) at org.jenkins_ci.plugins.run_condition.BuildStepRunner$2.run(BuildStepRunner.java:112) at org.jenkins_ci.plugins.run_condition.BuildStepRunner$Fail.conditionalRun(BuildStepRunner.java:156) at org.jenkins_ci.plugins.run_condition.BuildStepRunner.perform(BuildStepRunner.java:107) at org.jenkinsci.plugins.conditionalbuildstep.ConditionalBuilder.perform(ConditionalBuilder.java:134) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741) at hudson.model.Build$BuildExecution.build(Build.java:206) at hudson.model.Build$BuildExecution.doRun(Build.java:163) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504) at hudson.model.Run.execute(Run.java:1880) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:428) Caused: java.util.concurrent.CompletionException at java.util.concurrent.CompletableFuture.encodeRelay(Unknown Source) at java.util.concurrent.CompletableFuture.completeRelay(Unknown Source) at java.util.concurrent.CompletableFuture.uniRelay(Unknown Source) at java.util.concurrent.CompletableFuture$UniRelay.tryFire(Unknown Source) at java.util.concurrent.CompletableFuture.postComplete(Unknown Source) at java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source) at io.jenkins.plugins.appcenter.task.internal.UploadAppToResourceTask.lambda$uploadApp$0(UploadAppToResourceTask.java:72) at java.util.concurrent.CompletableFuture.uniWhenComplete(Unknown Source) at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(Unknown Source) at java.util.concurrent.CompletableFuture.postComplete(Unknown Source) at java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source) 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(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

          Mez Pahlan added a comment -

          Sorry to have to ask you this srilakshmi but can you post the full build log for this please. I can't see anything obviously wrong but maybe the build log has more information.

          Obviously redact anything sensitive / personal before you paste it here. I'm interested in mostly the output that this plugin outputs in particular the statements that describe whether it has found a file to upload on the file system.

          Mez Pahlan added a comment - Sorry to have to ask you this srilakshmi but can you post the full build log for this please. I can't see anything obviously wrong but maybe the build log has more information. Obviously redact anything sensitive / personal before you paste it here. I'm interested in mostly the output that this plugin outputs in particular the statements that describe whether it has found a file to upload on the file system.

          Hi

          I hope the below log helps.

          c:\Jenkins_s3\workspace\AppCenter_Upload_Project_Standalone>exit 0
          File found matching pattern:
          Creating an upload resource for app.
          Create upload resource for app successful.
          Uploading app to resource.
          ERROR: Build step failed with exception
          io.jenkins.plugins.appcenter.AppCenterException: Upload app to resource unsuccessful: HTTP 400 Bad Request: {"error":"Error: Missing required params from body: build_version, version, Service id: 8bb52ec6-7418-487a-a198-15e2131c0b33"}
          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 JNLP4-connect connection from
          at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1788)
          at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
          at hudson.remoting.Channel.call(Channel.java:998)
          at hudson.FilePath.act(FilePath.java:1159)
          at io.jenkins.plugins.appcenter.AppCenterRecorder.uploadToAppCenter(AppCenterRecorder.java:193)
          at io.jenkins.plugins.appcenter.AppCenterRecorder.perform(AppCenterRecorder.java:180)
          at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
          at org.jenkinsci.plugins.conditionalbuildstep.BuilderChain.perform(BuilderChain.java:71)
          at org.jenkins_ci.plugins.run_condition.BuildStepRunner$2.run(BuildStepRunner.java:112)
          at org.jenkins_ci.plugins.run_condition.BuildStepRunner$Fail.conditionalRun(BuildStepRunner.java:156)
          at org.jenkins_ci.plugins.run_condition.BuildStepRunner.perform(BuildStepRunner.java:107)
          at org.jenkinsci.plugins.conditionalbuildstep.ConditionalBuilder.perform(ConditionalBuilder.java:134)
          at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
          at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
          at hudson.model.Build$BuildExecution.build(Build.java:206)
          at hudson.model.Build$BuildExecution.doRun(Build.java:163)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
          at hudson.model.Run.execute(Run.java:1880)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:97)
          at hudson.model.Executor.run(Executor.java:428)
          Caused: java.util.concurrent.CompletionException
          at java.util.concurrent.CompletableFuture.encodeRelay(Unknown Source)
          at java.util.concurrent.CompletableFuture.completeRelay(Unknown Source)
          at java.util.concurrent.CompletableFuture.uniRelay(Unknown Source)
          at java.util.concurrent.CompletableFuture$UniRelay.tryFire(Unknown Source)
          at java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
          at java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source)
          at io.jenkins.plugins.appcenter.task.internal.UploadAppToResourceTask.lambda$uploadApp$0(UploadAppToResourceTask.java:72)
          at java.util.concurrent.CompletableFuture.uniWhenComplete(Unknown Source)
          at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(Unknown Source)
          at java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
          at java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source)
          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(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
          at java.lang.Thread.run(Unknown Source)
          Build step 'Conditional steps (multiple)' marked build as failure
          [WS-CLEANUP] Deleting project workspace...
          [WS-CLEANUP] Deferred wipeout is used...
          [WS-CLEANUP] done
          Finished: FAILURE

          srilakshmi Malla added a comment - Hi I hope the below log helps. c:\Jenkins_s3\workspace\AppCenter_Upload_Project_Standalone>exit 0 File found matching pattern: Creating an upload resource for app. Create upload resource for app successful. Uploading app to resource. ERROR: Build step failed with exception io.jenkins.plugins.appcenter.AppCenterException: Upload app to resource unsuccessful: HTTP 400 Bad Request: {"error":"Error: Missing required params from body: build_version, version, Service id: 8bb52ec6-7418-487a-a198-15e2131c0b33"} 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 JNLP4-connect connection from at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1788) at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356) at hudson.remoting.Channel.call(Channel.java:998) at hudson.FilePath.act(FilePath.java:1159) at io.jenkins.plugins.appcenter.AppCenterRecorder.uploadToAppCenter(AppCenterRecorder.java:193) at io.jenkins.plugins.appcenter.AppCenterRecorder.perform(AppCenterRecorder.java:180) at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78) at org.jenkinsci.plugins.conditionalbuildstep.BuilderChain.perform(BuilderChain.java:71) at org.jenkins_ci.plugins.run_condition.BuildStepRunner$2.run(BuildStepRunner.java:112) at org.jenkins_ci.plugins.run_condition.BuildStepRunner$Fail.conditionalRun(BuildStepRunner.java:156) at org.jenkins_ci.plugins.run_condition.BuildStepRunner.perform(BuildStepRunner.java:107) at org.jenkinsci.plugins.conditionalbuildstep.ConditionalBuilder.perform(ConditionalBuilder.java:134) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741) at hudson.model.Build$BuildExecution.build(Build.java:206) at hudson.model.Build$BuildExecution.doRun(Build.java:163) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504) at hudson.model.Run.execute(Run.java:1880) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:428) Caused: java.util.concurrent.CompletionException at java.util.concurrent.CompletableFuture.encodeRelay(Unknown Source) at java.util.concurrent.CompletableFuture.completeRelay(Unknown Source) at java.util.concurrent.CompletableFuture.uniRelay(Unknown Source) at java.util.concurrent.CompletableFuture$UniRelay.tryFire(Unknown Source) at java.util.concurrent.CompletableFuture.postComplete(Unknown Source) at java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source) at io.jenkins.plugins.appcenter.task.internal.UploadAppToResourceTask.lambda$uploadApp$0(UploadAppToResourceTask.java:72) at java.util.concurrent.CompletableFuture.uniWhenComplete(Unknown Source) at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(Unknown Source) at java.util.concurrent.CompletableFuture.postComplete(Unknown Source) at java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source) 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(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Build step 'Conditional steps (multiple)' marked build as failure [WS-CLEANUP] Deleting project workspace... [WS-CLEANUP] Deferred wipeout is used... [WS-CLEANUP] done Finished: FAILURE

          Mez Pahlan added a comment -

          Thanks srilakshmi. Hmmm...... sorry to say, I'm still a bit unsure on this .

          The line that starts File found matching pattern: did you redact something there? No need to tell me what the exact file name is if it is sensitive. But I'm expecting that to output the path to the file to be uploaded rather than nothing. For example in my builds it outputs this:

          File found matching pattern: app/build/outputs/apk/qa/debug/*.apk

          That's where I thought about starting to investigate on your issue but then the error message below that is confusing me:

           {"error":"Error: Missing required params from body: build_version, version, Service id: 8bb52ec6-7418-487a-a198-15e2131c0b33"}
          

          I've never seen that before .

          Mez Pahlan added a comment - Thanks srilakshmi . Hmmm...... sorry to say, I'm still a bit unsure on this . The line that starts File found matching pattern: did you redact something there? No need to tell me what the exact file name is if it is sensitive. But I'm expecting that to output the path to the file to be uploaded rather than nothing. For example in my builds it outputs this: File found matching pattern: app/build/outputs/apk/qa/debug/*.apk That's where I thought about starting to investigate on your issue but then the error message below that is confusing me: { "error" : "Error: Missing required params from body: build_version, version, Service id: 8bb52ec6-7418-487a-a198-15e2131c0b33" } I've never seen that before .

          Mez Pahlan added a comment -

          Sadly AppCenter have also removed a bunch of documentation but there is this PR that suggests we need to set buildVersion and version for DMG files. I can't yet find where this is documented in the API though.

          https://github.com/microsoft/appcenter-cli/pull/683/files

          I can try and have a go at fixing this assuming that the PR I linked is valid but it would be nice to confirm this in documentation form from AppCenter.

          Mez Pahlan added a comment - Sadly AppCenter have also removed a bunch of documentation but there is this PR that suggests we need to set buildVersion and version for DMG files. I can't yet find where this is documented in the API though. https://github.com/microsoft/appcenter-cli/pull/683/files I can try and have a go at fixing this assuming that the PR I linked is valid but it would be nice to confirm this in documentation form from AppCenter.

          srilakshmi Malla added a comment - - edited

          Hi Mez Pahlan

           

          I have not edited the file name. It is not showing the file name in my Jenkins output. 

          DMG upload requires both build version and build number when i did a manual upload from app center portal

          Are people able to upload .dmg files with out issue with the plugin? I am not sure if i am missing any thing in my parameters. I added version for build version.

           

          Thanks Srilakshmi

          srilakshmi Malla added a comment - - edited Hi Mez Pahlan   I have not edited the file name. It is not showing the file name in my Jenkins output.  DMG upload requires both build version and build number when i did a manual upload from app center portal Are people able to upload .dmg files with out issue with the plugin? I am not sure if i am missing any thing in my parameters. I added version for build version.   Thanks Srilakshmi

          Hi mezpahlan

          Any update?

          Thanks for your help

          Srilakshmi

          srilakshmi Malla added a comment - Hi mezpahlan Any update? Thanks for your help Srilakshmi

            Unassigned Unassigned
            srilakshmi srilakshmi Malla
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: