When uploading a build via the GameManager, everything works fine. However, we're attempting to upload via web APIs, the build ultimately always fails with the game manager reporting the status as "Invalid build package". I'm looking for help in determining why this is. All the API requests are successful, including the file upload, and the game manager offers no diagnostic information other than those three words of status. What am I doing wrong or omitting? How can I get better information about what's going wrong and why the package is invalid so that I can attempt to fix the problem?
Details
We are attempting to automate the build process, which includes uploading a Unreal Engine 4 dedicated server package as a custom PlayFab server, via python. When reviewing output from the upload scripts, there are no obvious problems: all HTTP requests are successful, and even the initial status returned from the AddServerBuild call shows no errors:
Uploading C:\knl_v\VStagedBuilds\StagedPackages\Test004.zip: 379107325 bytes... POST 'https://54A34.playfabapi.com/Admin/GetServerBuildUploadUrl'... PUT 'https://gamebuild-playfab-live.s3-accelerate.amazonaws.com/54a34/Test004.zip?X-Amz-Expires=3600&x-amz-security-token=IQoJb3JpZ2luX2VjEFMaCXVzLXdlc3QtMiJGMEQCICQoGAD5xf6rXSiEIbNuU2K4GrBA2cBopPW1MpyvrJreAiBmDphWLq22rDO%2Bwxo7XI67w2xukzsvAcSv2pvkxz8ceirbAgis%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F8BEAAaDDM4ODEyODAzOTYzMyIMBgYTSupPKp6W97TkKq8CBXTMH%2BZf7sKjramTZCDdvOPJ4MSFSnLElLFgmAKKS71CgQyPEPm1P9zxGwfeD0hghajhLYSrE4bheyUTNMMCZKp6lABrolp4h0wPPhkWAnDMPfOr2QgV6TftDukMSbNR70g7Rf3JCKRu%2FfJNPPHeKyd46iQZhpza1C1FashSDbg8wXUEWxXv51WXm5zvNHNflFrCbVPJ1%2FsPXlHCJ2KgVTtkM7tUW9LPSRg2GxZryXkiEuFuyzMDGBzhz%2FZe8oaMzDaiqLl620Ujy%2FsCb99XjlweCNqnzfvcHlHNedEq2CjBQ1mgtXtrAoHDRsUoQqf7oPAOaoVWDqxw1NEFsLI6aC%2FI9q62rn87aPI2L3kY9Hhwc93WxqT3h4UDyYomZjrI%2B5pfdzTMHSYAkoZB5ZFkMLP26e8FOs4C4lc7lec6Gd8IwfaL9kIdeZD3IChhik4txlQoPQC2tCm9MElaDWj6ecv9jRPzkdEdNBXv4QdHRSgMdlkO6OJbNdyDPPtA83VoM21deT18D8%2BnUoHwXJ32v5SXd22SvZQUltE07Mt61nnMyB08rUcFYOA7ExatGyOgKjF%2BxQbmTNKzzPWegklLxB1Vzlvs19J%2B64iig7sxZjCvb2f3%2BvCTbamNRNz9A3tjrRGWwDuv9hN02zGoQ4Qr1xJ2V7vdc%2FeITGQGePBc6gTS16r3v7CmIY3K9DLUbEbootG7CuzHW7UHkZclp4V9hhBIn8QnP5OCZERfhSKpLyfgCpqmyrzMHSRKpoTW7eUr5%2FhYOfCkWdAL%2FaQktPUUalIVyXCrWwSo9XHD4Z0Omjphew%2BYf2yoCp96dUM0c43qQQASCKSP9g7ALPueGTnrLKK2lbIPlg%3D%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAVUXR34LIRXIZN6VR/20191218/us-west-2/s3/aws4_request&X-Amz-Date=20191218T201048Z&X-Amz-SignedHeaders=content-type;host;x-amz-security-token&X-Amz-Signature=4379147c2b52cd06d5d94de3b7dd9ef33bc1c5e2577045a901a677771c2884a7'... HTTP Status: OK (200) POST 'https://54A34.playfabapi.com/Admin/AddServerBuild'... HTTP Status: OK (200) { 'code': 200, 'data': { 'ActiveRegions': ['USCentral'], 'BuildId': 'Test004', 'MaxGamesPerHost': 10, 'MinFreeGameSlots': 1, 'Status': 'Validating', 'Timestamp': '2019-12-18T20:10:49.1Z', 'TitleId': '54A34'}, 'status': 'OK'} Uploaded Build: 2019-12-18T20:10:49.1Z Test004 54A34: Validating
However, when subsequently checking the status of the build in the build manager, it says "Invalid build package". The package itself is just a zip file, and I've double checked that it's in the appropriate location and is otherwise a well-formed, boring archive. If I upload the same archive via the game manager, the process works fine and the build status becomes 'Available' after validation, so I don't think it's any problem with the package file itself.
For the upload, I'm simply PUT'ing the file to the pre-authorized URL; this works in the sense that, as seen above, the HTTP request is successful. I'm using the python requests library for the upload, specifically:
response = requests.put(upload_url, headers={'Content-Type' : 'application/x-zip-compressed'}, files={f'{build.build_id}.zip': zip_stream}, )
Where upload_url has the values as seen in the previous log (ie. the AWS URL returned from
GetServerBuildUploadUrl), and zip_stream is a file stream opened for byte reading using the python open(...) method. As seen in the logs, the above call returns status 200.
TL;DR
There's no obvious client-side issue, and the same package archive is valid when I upload via the game manager. Please, any help determining why when using the web API the package status becomes "Invalid build package" would be appreciated, as this is currently a blocker for our build automation.