Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Package not showing up from scoped registry server

Discussion in 'Package Manager' started by chayanvinayak, Jun 25, 2019.

  1. chayanvinayak

    chayanvinayak

    Joined:
    Jul 11, 2012
    Posts:
    24
    I am trying to access Unity packages from a scoped registry server that I am running locally using Verdaccio.

    What I have done so far:
    I am running a scoped registry server using Verdaccio and I have successfully published a package on the server which I can verify by going on webpage hosted on the server.


    Screen Shot 2019-06-24 at 4.19.14 PM.png

    In unity, I have modified manifest.json to include "scopedRegisteries"

    Screen Shot 2019-06-24 at 4.23.06 PM.png

    and the package.json inside the package looks like :

    Screen Shot 2019-06-24 at 4.26.50 PM.png

    What I expect:
    After going through above mentioned steps, I expect Unity package to show up in Package Manger's list.

    What is the problem:
    Package name is not showing up in package manager and there is no error shown in Unity.

    What I also tried:
    1. Adding "registry" in project manifest gives error.

    Screen Shot 2019-06-24 at 4.52.40 PM.png

    2. I have tried adding and removing "/registry" from url of scoped registry:

    "url": "http://localhost:4873",
    or
    "url": "http://localhost:4873/registry",
     

    Attached Files:

    Last edited: Jun 25, 2019
    one_one and amarcolina like this.
  2. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    583
    Hi @chayanvinayak ,

    Have you tried to manually add a package from your scoped registry into the project manifest? If not, can you try? Does the package gets added to your project?

    Regards,

    Pascal
     
  3. chayanvinayak

    chayanvinayak

    Joined:
    Jul 11, 2012
    Posts:
    24
    Hey Pascal(@okcompute_unity ),

    Thanks for getting back!
    yes, I tried loading the same package from disk which worked fine and I could see a new folder loaded in the "Packages" folder in Unity project.

    Thanks,
    Chayan
     
    Last edited: Jun 26, 2019
  4. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    583
    So you added the name of the package in
    Packages/manifest.json
    and it works now?

    Pascal
     
  5. chayanvinayak

    chayanvinayak

    Joined:
    Jul 11, 2012
    Posts:
    24
    Just to clarify, when I load the package from disk following this method: https://docs.unity3d.com/Manual/upm-ui-local.html (which modifies manifest.json), the package appears in the project but when I try loading it through scoped registry server (using the method I posted above), it does not appear.

    There is one more thing that I noticed.
    When I start Verdaccio and then load Unity project with manifest file updated, I see following log in Verdaccio.

    Log:
    chayan-mbp:~ chayan$ verdaccio
    warn --- config file - /Users/chayan/.config/verdaccio/config.yaml
    warn --- Plugin successfully loaded: verdaccio-htpasswd
    warn --- Plugin successfully loaded: verdaccio-audit
    warn --- http address - http://0.0.0.0:4873/ - verdaccio/4.0.4
    http --> 304, req: 'GET https://registry.npmjs.org/registry' (streaming)
    http --> 304, req: 'GET https://registry.npmjs.org/registry', bytes: 0/0
    http <-- 404, user: null(127.0.0.1), req: 'GET /registry/-/all', error: no such file available

    it looks like Unity is trying to get : 'GET /registry/-/all'
    which fails
     
    Last edited: Jun 28, 2019
  6. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    583
    Hi, @chayanvinayak,

    Package Manager uses the
    /-/all
    route to fetch the list of packages to be shown in the UI. We have an implementation in the work to fetch the list from the npm's V1 API instead (the
    /-/all
    route is deprecated). That said, I've looked at Verdaccio code base and it looks like they still support the
    /all
    path. Maybe your instance is misconfigured? Can you ask the Vedaccio maintainers why this route is not available on your instance? If you do, please let us know!

    Regards,

    Pascal
     
    Last edited: Jun 28, 2019
  7. Adrian

    Adrian

    Joined:
    Apr 5, 2008
    Posts:
    366
    I can confirm packages show up using Verdaccio when the registry is added using scopedRegistries. Just checked with Unity 2018.4 and 2019.3a and this worked with Verdaccio 3 and still works with Verdaccio 4.
     
    okcompute_unity likes this.
  8. chayanvinayak

    chayanvinayak

    Joined:
    Jul 11, 2012
    Posts:
    24
    @okcompute_unity : I uninstalled and reinstalled Verdaccio4. Now /-/all error is gone but for some reason I still don't see the package name in Package manager or the folder in the Unity project.

    @Adrian: Can you please post your example package that shows up?

    Thank you guys!
     
  9. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    583
    @chayanvinayak If you look in the *editor.log* file, do you see the package listed after this line?:

    [Package Manager] Registering XX packages:
     
  10. chayanvinayak

    chayanvinayak

    Joined:
    Jul 11, 2012
    Posts:
    24
    @okcompute_unity : I see [Package Manager] Registering 38 Packages line but don't see the signature of packages coming from Verdaccio.
     
  11. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    583
    That is weird. You should have, at least, errors if the Package Manager cannot add scoped packages in your project! Can you share your project manifest?
     
  12. chayanvinayak

    chayanvinayak

    Joined:
    Jul 11, 2012
    Posts:
    24
    @okcompute_unity
    I am attaching :
    1. manifest file
    2. a screenshot of Verdaccio to show a package with the signature is available (through Verdaccio server)
    3. a screenshot of package manager in Unity showing packages available
    4. a screenshot of verdaccio output
     

    Attached Files:

  13. chayanvinayak

    chayanvinayak

    Joined:
    Jul 11, 2012
    Posts:
    24
    @okcompute_unity Hey Pascal, just wanted to check if you had a chance to investigate?
     
  14. Adrian

    Adrian

    Joined:
    Apr 5, 2008
    Posts:
    366
    @chayanvinayak Here's a package I've uploaded to my registry and which then appears in the package manager window:
    https://github.com/sttz/trimmer

    Note that custom packages are never "verified" packages and therefore always considered "preview". You need to have "Advanced" > "Show preview packages" checked for your packages to show up.
     
    chayanvinayak likes this.
  15. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    583
    @chayanvinayak I've set up a scoped registry on my end and everything works fine. Have you selected the `Advanced => Show preview packages` option like @Adrian suggested?

    If you want to try another *scoped registry*, I was playing with this one today: https://github.com/xoofx/UnityNuGet and it worked for me.

    Regards,

    Pascal
     
    chayanvinayak likes this.
  16. chayanvinayak

    chayanvinayak

    Joined:
    Jul 11, 2012
    Posts:
    24
    okcompute_unity likes this.
  17. chayanvinayak

    chayanvinayak

    Joined:
    Jul 11, 2012
    Posts:
    24
    @okcompute_unity,
    - is there any way to add dependency of a package coming from scoped registry?
    - sometimes even when "manifest.json" is reset Unity keeps showing older list of packages coming scoped registry (and doesn't update package manager based on changes). Is there any folder which is needed to be cleaned to reset. (I tried cleaning "PackageCache" folder but didn't help)?
     
  18. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    583
    Do you mean transitive dependency? If yes, as long as the name of the package matches the scoped registry, the Package Manager will fetch the dependency in the scoped registry. Transitive or root dependency.

    This looks like a bug. Does this issue persist if you close the editor and restart? I'm wondering if this would be an issue with the UI holding on an invalid state by mistake.
     
  19. chayanvinayak

    chayanvinayak

    Joined:
    Jul 11, 2012
    Posts:
    24
    @okcompute_unity


    Transitive dependency is defined in the package.json of the package itself?

    Yes, this persists even if editor is closed and restarted. Any modification in manifest.json also doesn't change list of packages in Package manager. Is there any way I can reset the UI?
     
  20. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    583
    Yes, this is correct.

    Root or direct dependencies are set in the project manifest (
    /Packages/manifest.json

    Transitive or indirect dependencies are set in package manifest (
    package.json
    )

    Ok, then this is not a UI issue. Can you share what the project manifest look like after and before? (you can DM the files if you want).
     
  21. chayanvinayak

    chayanvinayak

    Joined:
    Jul 11, 2012
    Posts:
    24
    @okcompute_unity : I just installed a newer version of Unity (2019.1.11f1) and updated scope registry configuration in manifest.json and all the packages started showing up.
    It appears that my older Unity version is stuck to a certain list of packages.
    I can still send you manifest.json but it looks like it has something to do with Unity
     
  22. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    583
    ok! Which version did you previously had installed?
     
  23. chayanvinayak

    chayanvinayak

    Joined:
    Jul 11, 2012
    Posts:
    24
    2019.1.4f1
    One more thing that I observed that when you click on "Close Tab" of package manager and re-open it, package manager gets correct set of packages from manifest.json.
    Apparently, "close tab" calls something which should be called whenever there is any change in manifest.json file
     
  24. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    583
    I notified the UI team and they did not fix any issue similar to this after 2019..1.f41. ‍¯\_(ツ)_/¯

    Are you ok using 2019.1.11f1 from now on?
     
  25. chayanvinayak

    chayanvinayak

    Joined:
    Jul 11, 2012
    Posts:
    24
    Yeah, that will be fine. "Close tab" button is my friend :) - thank you!
     
  26. chayanvinayak

    chayanvinayak

    Joined:
    Jul 11, 2012
    Posts:
    24
    Hey @okcompute_unity,

    Another issue that I started seeing as the list of packages is growing (it is still under 10 though) - Some of the packages do not appear in package manager, even after having same scope signature eg:

    if two packages have scope signature
    Package1 : com.company.tool.one
    Package2 : com.company.tool.two

    Package1 appears in package manager and Package2 does not. (when manifest.json includes scope : com.company.tool )

    I made sure that "Show Preview Packages" is checked and I also tried closing package manager window using "Close Tab" button.

    Thanks!
     
    Last edited: Aug 28, 2019
  27. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    583