Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Issue downloading builds using Cloud Build API from within Unity

Discussion in 'Unity Build Automation' started by Trivium_Dev, Jun 14, 2019.

  1. Trivium_Dev

    Trivium_Dev

    Joined:
    Aug 1, 2017
    Posts:
    78
    I have built an "update manager" for the software that I develop - it pulls a list of builds (that are marked as "favorites") from Unity Cloud Build, downloads the latest one (if it's not already the installed version), deletes the old version of the software, and unzips the newer one into the original file location and restarts the software (it does all this using batch files).

    This has worked really well for the last few months, however recently we have been having computers unable to download the ZIP file from Cloud Build. The URL to the file looks something like this: https://storage.googleapis.com/unitycloud-build-user-A_BUNCH_OF_STUFF.zip

    The error I get from the UnityWebRequest is not helpful - the "error" field just says "Unknown Error". "isNetworkError" is true and the response code is "0". The software will be able to update on some computers and not others.

    I finally narrowed the problem down to a certificate issue. I can resolve the problem in a few ways - I can set the UnityWebRequest.certificateHandler to just always return true. I can also change the URL to the file from "https" to "http". Finally, we can install some certificates that working computers have that the not-working computers don't have, and that fixes it. The certificates that are copied over are a few different "GlobalSign Root CA" certificates.

    The issue has occurred on both Unity 2018.3.6 and 2018.4.1. I was going to try setting up a 2019 build and see if maybe the issue would be fixed in there, but Unity Cloud Build is having problems accessing my repos when I try to setup a new build target (separate thread/issue) so I haven't done so.

    The problem may be on the server side - if you put the URL directly into Chrome, it mentions the connection is not secure. Perhaps the issue is that the URL shouldn't be returned as an HTTPS URL and the issue is on Unity's end - however I feel like both of these are unlikely since the download will work on some computers and not others.

    If anyone has any ideas of why this seems to happen on some computers and not others, and possible solutions, that would be helpful. While manually installing the certificates that fixes the issue (or doing the other two solutions I have that work) could be done, I feel like I'm not "fixing" the underlying issue and just masking the problem and it'll come back to bite me later. Thanks!
     
  2. Trivium_Dev

    Trivium_Dev

    Joined:
    Aug 1, 2017
    Posts:
    78
    Just tested on 2019.1.6f1 and still doesn't work. For now I'm switching the URL from HTTPS to just HTTP if/when the HTTPS attempt fails to get around the issue.