Hot Reload fails due to Null package

Docker Desktop (Win10) v4.0.1; fresh pull of docker-private.packages.nuxeo.com/nuxeo/nuxeo:2021 yields v2021.8.6; New Studio Trail package registered, CLID provided and -e NUXEO_PACKAGES=“nuxeo-web-ui nuxeo-platform-getting-started” as shown in https://doc.nuxeo.com/nxdoc/setting-up-your-nuxeo-environment/; Dev environment works, I can login. In Studio I add same packages to Application Definition, save; Then via Dev Tool I try to Hot Reload. Spins and fails - log error says Caught error: org.nuxeo.ecm.core.api.NuxeoException: Error while downloading studio snapshot: null, package Id: xxxxxxx-0.0.0-SNAPSHOT

I can manually Download the package and mp-install it, and it works. Any idea why Hot Reload can't get the package?

0 votes

2 answers

1160 views

ANSWER

…just a follow up thought. How does my local Nuxeo server know how to connect to Studio and get my most current project snapshot? How are those permissions managed? To access the maven repository it asks for credentials which are not part of the server config. Is the CLID all that is necessary? If I try (from inside Docker) to download the JAR https://connect.nuxeo.com/nuxeo/site/studio/maven/nuxeo-studio/xxx/xxx--master-SNAPSHOT/xxx--master-SNAPSHOT.jar Using wget or similar, it is blocked requiring authentication. Is this my problem? If so what's the fix?
09/16/2021



If all your changes/commits are saved in the branch you are on then you should be fine. (I just mentioned that because we were transitioning from 2019 to 2021, so if I was on an old branch of 2019 and tried to build the container we would get errors.)

I'm not normally in our master branch when doing development, so I can't say if that has anything to do with your error. You could try making a branch and seeing if you get the same error when on that branch instead? It probably won't matter, but maybe worth a try.

I've also stopped using the Nuxeo Dev Tools extension for hot-reloading, and prefer to call it by api:

POST http://localhost:8080/nuxeo/site/automation/Service.HotReloadStudioSnapshot

Did you install your studio package upon container creation? I see you list:

-e NUXEO_PACKAGES="nuxeo-web-ui nuxeo-platform-getting-started"

But it should be more like the following (pretend my Studio project name is “company” for this example):

-e NUXEO_PACKAGES="nuxeo-web-ui nuxeo-platform-getting-started company-0.0.0-SNAPSHOT"

Also, if you already have package dependencies listed in Studio you don't need to install them when building the container. They should download with your project package since they are dependencies. Such that you would only need to have:

-e NUXEO_PACKAGES="company-0.0.0-SNAPSHOT"

Not sure if any of this will help, but I hope so.

0 votes



Thanks for your input. No I did not list my Studio package in the Docker Run command, I will start from scratch and try that. I can manually download from Studio then mp-install it, so I know it can work!

But, noticing the error is about the studio package being Null, and my 9/16 follow up. I can't use wget or curl to bring the studio package from studio to my Docker VM - I get an authentication error. I'm using SSO to connect to Studio, so I suspect I'd need to do a 2 step, save cookies, etc. But how does Hot Reload do this? Is the CLID all that is necessary for a registered Server to connect to Studio and get that package? Or do I need to set some credentials (beyond the CLID) in the server somewhere? Isn't this what the authentication Token is for? So how do I pass that into my server? I'm going to do some more reading and testing - thanks again.

09/20/2021

I did try the API hot reload, basically the same problem… { "entity-type": "exception", "status": 500, "message": "Failed to invoke operation: Service.HotReloadStudioSnapshot" }
09/20/2021


When creating your Docker container did you set the environment variable to allow hot-reloading (NUXEO_DEV)? When I was using Docker all I needed was the Nuxeo CLID identifier, and access to the private docker registry for 2021.

Once those two requirements were met I could make a container with something like :

docker run --name nuxeo2021 \
-p 8080:8080 \
-e JAVA_OPTS=-XshowSettings:vm \
-e NUXEO_CLID="<Add the CLID identifier from a registered instance>"
-e NUXEO_DEV=true \
-e NUXEO_PACKAGES="nuxeo-web-ui STUDIO-PROJECT-NAME-0.0.0-SNAPSHOT" \
docker-private.packages.nuxeo.com/nuxeo/nuxeo:2021

Whatever dependencies you have listed in studio will also download based off your SNAPSHOT package. Note, that whatever branch your user has checked-out in Studio will be what is downloaded, so make sure you are on the branch you want before creating the container. Hope that helps.

0 votes



Yes, -e NUXEO_DEV=true; yes -e NUXEO_CLID="…"; I was able to successfully access the private image. I listed the same packages in -e NUXEO_PACKAGES="…" and in Studio Application Definition.

In Studio I am in "branch:master". You say "Check Out". other than saving my changes, do I need to take any steps to check out?

09/20/2021