Hello! For our game, we have a PostProcess method, that we call from Unity Cloud Build, that does the following:
1. Gets a list of AssetBundles previously built by UCB to upload to playfab
2. For each one of those, it gets the content upload url
foreach(string bundle inthingsToUpload) { string path= "AssetBundles/" + Utility.GetPlatformName() + "/"+bundle; var assetPath = Path.Combine(Directory.GetCurrentDirectory(),path); GetContentUploadURL(bundle,assetPath); }
static void GetContentUploadURL(string key, string path) { Debug.Log("FetchingContentURL.."); GetContentUploadUrlRequest request = new GetContentUploadUrlRequest(); request.Key = GetVersion() + "/" + Utility.GetPlatformName() + "/" +key;
request.ContentType = mimeType; PlayFabAdminAPI.GetContentUploadUrl(request,(GetContentUploadUrlResult result)=>{ Debug.Log("GOTURL.."+result.URL); byte[] fileContents = File.ReadAllBytes(path); PutFile(result. URL, fileContents); },OnPlayFabError); } static void OnPlayFabError(PlayFabError error) { Debug.Log(string.Format("UPLOAD BUNDLE ERROR: [{0}] -- {1}", error.Error, error.ErrorMessage)); }
Now this works I would say 75% of the time. There are times when nothing gets uploaded. When I go look at the logs for UCB, I see the following:
UPLOAD BUNDLE ERROR: [ServiceUnavailable] -- 409 Conflict
Any idea why this sometimes does not work ? Anything I can do to fix this issue?