fastlane-plugin-appcenter: Cannot upload ios via appcenter_upload using 1.9.0
I am using the following command:
appcenter_upload(
api_token: ENV["APPCENTER_API_TOKEN"],
owner_name: ENV["APPCENTER_OWNER_NAME"],
app_name: ENV["APPCENTER_APP_NAME"],
file: "PATH-To-IPA",
release_notes: "RELEASE-NOTES"
)
and it is giving the following error:
Client error: 400: {"error"=>{"code"=>400, "message"=>"The request contains invalid content."}}
It is working fine with the 1.8.1 version though.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 54
- Comments: 32 (2 by maintainers)
I believe this issue was introduced by a change in fastlane 2.161.0. Previously fastlane was preventing the default Content-Type header in some cases, even those in plugins. The change made it specific to
apple.com
since that was the original intent, however this plugin appears to have been unintentionally depending on that behavior. I’m able to fix the upload locally by adding theContent-Type
header to the chunk upload request. I’ll open a PR once I do a bit more checking. In the mean time, the change below fixes the failure for me:I just released
v1.10.0
. Can someone please confirm if it fixes their issue?Thanks @rimarsh and @joshdholtz for the help with the fix 🥳
For those using Fastlane via a Bundler, that is, with a
Gemfile
, you can lock it to version 2.160.0 like this:Fastlane version 2.161.0 with appcenter_plugin 1.9.0 throws Client error: 400: {“error”=>{“code”=>400, “message”=>“The request contains invalid content.”}}
Reverting to fastlane version 2.160.0 works. Try using the below commands to reinstall fastlane of specific version
Fastlane version 2.160.0 with appcenter_plugin 1.9.0 works fine
It’s clearly a backend issue with the new upload endpoint. Hopefully, someone from Microsoft gets to fixing this issue soon. Until then, we need to use those older versions.
https://github.com/microsoft/fastlane-plugin-appcenter/commit/e35509d0c326578655cf0870806e770cede30fb7#diff-af4cae5a145a0689c65242cefbb3da5bR65
v1.10.0
works fine!!! Thanks!!@lumaxis It fixed the issue I was running into with uploads on
1.9.0
. Thanks!I commented this in the PR but this was a side effect of a monkey patch that we had in fastlane that would default content type of all requests to
application/json
if not set. We removed this because we shouldn’t have been relying on this in this PR - https://github.com/fastlane/fastlane/pull/17218Sorry for any issues this may have caused! PR #248 is the correct solution 👍
How do I revert back?
this is added to my PluginFile but 1.9.0 is the used version
Can confirm from our side: fastlane
2.160.0
works with the latest appcenter plugin, but2.162.0
throws the error above. Rolling back to appcenter1.8.1
also solves the problem and works with2.162.0
.+1
downgrading fastlane version from
2.161.0
to2.158.0
solved the upload problem