Search Unity

GetWorkSpaceFromPath nullreferenceException version control plastic scm

Discussion in 'Unity Version Control' started by sineadzara, Sep 15, 2021.

  1. sineadzara

    sineadzara

    Unity Technologies

    Joined:
    Sep 7, 2021
    Posts:
    3
    I am getting the following null reference each time after opening a unity workspace. Any ideas of how to fix it or if it is a bug that does not have a fix yet in the latest version?

    Unity version - 2021.1.20f1
    Version Control - 1.9.0

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. Codice.Client.BaseCommands.BaseCommandsImpl.GetWorkspaceFromPath (System.String path, System.Boolean doPlatformGetPath) (at <4d34e3df724146edacbda57a9d62370d>:0)
    3. Codice.Client.BaseCommands.BaseCommandsImpl.GetWorkspaceFromPath (System.String path) (at <4d34e3df724146edacbda57a9d62370d>:0)
    4. PlasticGui.PlasticAPI.GetWorkspaceFromPath (System.String wkPath) (at <4d34e3df724146edacbda57a9d62370d>:0)
    5. Unity.PlasticSCM.Editor.FindWorkspace.InfoForApplicationPath (System.String path, PlasticGui.IPlasticAPI plasticApi) (at Library/PackageCache/com.unity.collab-proxy@1.9.0/Editor/PlasticSCM/FindWorkspace.cs:32)
    6. Unity.PlasticSCM.Editor.AssetMenu.AssetMenuItems.Enable () (at Library/PackageCache/com.unity.collab-proxy@1.9.0/Editor/PlasticSCM/AssetMenu/AssetMenuItems.cs:40)
    7. Unity.PlasticSCM.Editor.AssetMenu.AssetMenuItems.BackgroundWorker_CompletedWork (System.Object sender, System.ComponentModel.RunWorkerCompletedEventArgs e) (at Library/PackageCache/com.unity.collab-proxy@1.9.0/Editor/PlasticSCM/AssetMenu/AssetMenuItems.cs:32)
    8. System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted (System.ComponentModel.RunWorkerCompletedEventArgs e) (at <b5226d7672da4aeaa36d32bf1166a63b>:0)
    9. System.ComponentModel.BackgroundWorker.AsyncOperationCompleted (System.Object arg) (at <b5226d7672da4aeaa36d32bf1166a63b>:0)
    10. UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at <fd88a7f744c8413fa794c8fc6e0439f6>:0)
    11. UnityEngine.UnitySynchronizationContext:ExecuteTasks()
    12.  
     
    Last edited: Sep 15, 2021
  2. Ryan-Unity

    Ryan-Unity

    Joined:
    Mar 23, 2016
    Posts:
    1,993
    Hi @sineadzara, I'm sorry you're running into this issue. We have gotten a few reports of this error but have been having difficulty reproducing it on our end so that we can debug and fix it. From what we can tell, the error shouldn't prevent you from using any of the package's features and is cleared from the Console without returning. If any of that is not the case for you then please let us know.

    Does this error pop up every time you open your project? Does it happen with empty workspaces? Which OS are you running on?
     
  3. charris456

    charris456

    Joined:
    Nov 25, 2012
    Posts:
    29
    I had the same issue, which would pop up every time the project was opened.

    I fixed it my new project by:
    • Removing the Version Control Package in the package manager.
    • Deleted the Library folder.
    • Checked in the initial Unity Project files with the Plastic SCM client from their website
    • Re-opened Unity.
    So far, everything has been working without the error popping up. I am wondering if something got messed up because I created the repo in the Plastic SCM client, then created the new Unity project while Plastic SCM client was open. I also setup the Plastic SCM plugin in unity while the client was open too.
     
    Last edited: Sep 17, 2021
    Nefisto likes this.
  4. sineadzara

    sineadzara

    Unity Technologies

    Joined:
    Sep 7, 2021
    Posts:
    3
    Yes every time open project and when run the editor. I have not tried with empty workspace yet. I am on Windows 10.
     
  5. sineadzara

    sineadzara

    Unity Technologies

    Joined:
    Sep 7, 2021
    Posts:
    3
    I did some debugging and the error seems to go away if the Plastic SCM window in unity is open
     
  6. DrSkipper7

    DrSkipper7

    Joined:
    Apr 18, 2017
    Posts:
    13
    Hey just wanna chime in and say our team was having this issue both locally and in Cloud Build (we get a null reference logged for every cloud build even though the build succeeds). sineadzara's suggesstion has fixed the error locally (though it's a bit annoying to have to leave that window open all the time to avoid it), however I don't think there's a way to prevent it within Cloud Build because to my knowledge there's no way to tell Cloud Build to open the project with specific windows already open in Unity. Would love to see a fix for this, we're on version 2021.1.20f, and Windows 10. We recently switched from using SVN to Plastic.
     
  7. DeidreReay

    DeidreReay

    Joined:
    Oct 28, 2019
    Posts:
    50
    Have same issues happening here on 2020.3.18f1 LTS (bult in). We have used plastic before Unity and Plastic joined forces.. It just recently happened and seemed to appear (to just one of us) out of nowhere. Any ideas on a logical fix for us?
     
  8. Ryan-Unity

    Ryan-Unity

    Joined:
    Mar 23, 2016
    Posts:
    1,993
    We're very sorry for the inconvenience. We have identified a fix for this bug and will roll it out to all Editor versions within the next month. This should also resolve the issue with the error popping up in Cloud Build once those Editor versions with the fix are published.

    In the meantime, you can try the following workaround that @charris456 suggested to remove this warning in the Console for local builds:
    - Remove the Version Control Package in the package manager.
    - Delete the Library folder.
    - Check-in the initial Unity Project files with the Plastic SCM client from Plasticscm.com.
    - Re-open Unity.
     
  9. KingfisherWyvernStudio

    KingfisherWyvernStudio

    Joined:
    Oct 5, 2011
    Posts:
    324
    I know this thread is from over a year ago, but.... the problem seems to have reared its head again:
    Windows 11
    Unity2021.3.14f1
    Version Control package: Version 1.17.7 - November 10, 2022 (the version from October 10 gave the exact same problem)

    New empty 3D HDRP project with empty HDRP Outdoor scene
    Not registered with Plastic SCM
     
  10. carlosalba1985

    carlosalba1985

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    1,076
    Hi @KingfisherWyvernStudio, could you attach the logs?

    C:\Users\xxx\AppData\Local\plastic4\logs

    Regards,
    Carlos.
     
  11. KingfisherWyvernStudio

    KingfisherWyvernStudio

    Joined:
    Oct 5, 2011
    Posts:
    324
    Hi Carlos,

    here are the most recent logs from today.
     

    Attached Files:

  12. carlosalba1985

    carlosalba1985

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    1,076
    Hi @KingfisherWyvernStudio, I can't find any error in the logs.
    Did you have the null error today? Can you let us know the estimated time so we can find it in the logs?

    Also, please a screenshot of the error in Unity.

    Regards,
    Carlos.
     
  13. UNSH

    UNSH

    Joined:
    Jul 2, 2012
    Posts:
    51
    The solution above did not work here but just installing and using the new Unity DevOps app via your link did (I was still on the PlasticSCM.app)
     
  14. paulmac

    paulmac

    Joined:
    Feb 17, 2011
    Posts:
    10
    I updated all my packages to the latest versions and the problem is resolved. So packages such as Timeline, jetbrains, version Control etc, just upgrade the lot in package manager.