Search Unity

UCB with Submodules, "Unadvertised" Error

Discussion in 'Unity Build Automation' started by lasercannon, Feb 7, 2018.

  1. lasercannon

    lasercannon

    Joined:
    Nov 29, 2012
    Posts:
    80
    Hey all!

    I have a Cloud Build project with a submodule that doesn't seem to be updated correctly on the cloud. I have the UCB SSH key plugged in for our bitbucket organization, and the commit in question (e3dc4f3f31e27313c9fa70499fef553b8299d7f8) has been pushed. What does the error mean the commit is "unadvertised?"

    Some poking around found me the solution of running "git submodule sync," but obviously I don't have access to running that on the cloud server.

    I'm using Unity 2017.3.0f3. The full log is as follows:

    Code (csharp):
    1. 1: Running Prebuild steps
    2. 2: In quiet period, build will start momentarily...
    3. 3: Agent pid 2155
    4. 4: All identities removed.
    5. 5: Removing bvr
    6. 6: Successfully uninstalled bvr-1.8.2
    7. 7: done.
    8. 8: bvr 1.8.2
    9. 9: bvr-api 0.3.5
    10. 10: prebuildstatus finished successfully.
    11. 11: All identities removed.
    12. 12: Agent pid 2562
    13. 13: BVR: SCM Checkout
    14. 14: GIT: Checkout project...
    15. 15: GIT: Checking out git@bitbucket.org:nightschoolstudio/bar.git/master
    16. 16: [13:45:48] error: Server does not allow request for unadvertised object e3dc4f3f31e27313c9fa70499fef553b8299d7f8
    17. 17: [13:45:48] Fetched in submodule path 'Assets/NightTools', but it did not contain e3dc4f3f31e27313c9fa70499fef553b8299d7f8. Direct fetching of that commit failed.
    18. 18: [13:45:48] Error(s) during clone:
    19. 19: [13:45:48] git clone failed: exit status 1
    20. 20: GIT: Error during clone: git  lfs clone '--branch' 'master' '--recursive' '--' 'git@bitbucket.org:nightschoolstudio/bar.git' '/BUILD_PATH/night-school-studio.bar.win-64-plain-dev'  2>&1:
    21. 21: ! checkout failed. git  lfs clone '--branch' 'master' '--recursive' '--' 'git@bitbucket.org:nightschoolstudio/bar.git' '/BUILD_PATH/night-school-studio.bar.win-64-plain-dev'  2>&1:
    22. 22: Build step 'Execute shell' marked build as failure
    23. 23: postbuildstatus finished successfully.
    24. 24: Finished: FAILURE
    Thanks!
     
  2. lasercannon

    lasercannon

    Joined:
    Nov 29, 2012
    Posts:
    80
    Welp, this was a really silly mistake after all. The submodule was pointing to the wrong place! xD
     
  3. Hosnkobf

    Hosnkobf

    Joined:
    Aug 23, 2016
    Posts:
    1,096
    could you share the code for the pre-build method?

    EDIT: fixed it myself. There is no need for a post processing script.
    Here is what I did:
    • switched from OAuth to SSH key (added to my GitHub personal settings) - probably unnecessary
    • checked the submodules and changed the addresses from
      https://github.com/
      to
      git@github.com:
      (take care of the colon instead of the slash)
    • Realized that one of my submodules had a detached head which was not (could not be) pushed to origin. Fixed it by changing back to the branch at origin, "Show lost commits (reflog)" in my git tool (Fork), cherry picked the lost commit and pushed it.
    Now it builds.
     
    Last edited: May 7, 2019
    victorw likes this.