13 Feb 2023 05:54 PM - last edited on 02 May 2023 02:55 PM by educampver
Hey
We are running into an issue with starting the development server. The node/npm dependencies etc all install fine, but when running the first app, it seems like it is stuck at "Reloading Browser"
Important Context: We are running this from a Linux VM (no UI) environment. We plan on simply port forwarding the dev server to our host machine and use the host machine browser to launch. However, the process seems to be stuck at "Reloading Browser". (see screenshot)
Any pointers on how I can access the dev server and the apps UI?
Thanks
Solved! Go to Solution.
13 Feb 2023 06:27 PM - last edited on 19 Apr 2023 09:21 AM by educampver
Hi there,
thank you for reaching out to us in the Dynatrace developer forum.
Can you maybe share first some infos with us regarding your enviroment:
With WSL I already did the same, run the server within the VM and forwarded the traffic to the host machine.
Best,
Sini
13 Feb 2023 07:02 PM - last edited on 19 Apr 2023 09:22 AM by educampver
14 Feb 2023 11:45 AM
Thx for the infos. The issue is related to running the dev server in a console-only Linux in VirtualBox. After startup, the dev server would trigger the opening of a web browser and ask you to authenticate. I am checking with the team about what we can do here.
Can you maybe give us more insights why you want to run the dev server within VirtualBox environment?
Best,
Sini
14 Feb 2023 02:10 PM
Mainly because my development takes place in a Linux environment, and since we have Windows workstations, we use Virtual Box. I am fine with authenticating via a browser, so long as the server is able to start up at the backend. Following which, I can port forward the necessary ports and authenticate on my host machine browser...
16 Feb 2023 10:51 AM - edited 16 Feb 2023 10:52 AM
When running the Dev Server your environment URL opens up and embeds your localhost app within Dynatrace. For convention and security reasons, we can only allow localhost do be embedded in dev mode. I assume that if you run in a virtual environment using port forwarding, you won't access your VirtualBox via localhost? Try running the dev server with the `--no-open` flag, e.g. `npm start -- --no-open` to detach it from your environment, and open the URL with your forwarded port directly.
16 Feb 2023 02:49 PM
Thanks Stefan we will wait for the response from the customer. Much appreciated.
16 Feb 2023 05:53 PM
The flags do not help, the browser loading is not the issue. The CLI here just waits for SSO authentication to be completed, which never happens. We could reproduce the issue by creating a similar setup. Usually what happens is that the CLI will open a browser window where the SSO authentication will take place, but that does not work when starting the CLI over SSH.
We will provide a fix for this use case by printing the SSO URL in the terminal, which the user can then copy into their browser. This will complete the SSO authentication.
16 Feb 2023 06:34 PM
Can confirm, the flags dont really help here. But i think Wolfi you are correct. Once the SSO URL is provided in the terminal, we can figure out the networking aspect and open the URL on the host machine browser.
Thanks!
16 Feb 2023 07:47 PM - last edited on 19 Apr 2023 08:30 AM by educampver
It is actually possible already, though it requires some work. You can start the CLI with --no-open and telling it to bind to 0.0.0.0, so you can actually open the app from outside the VM.
npm start -- --no-open --host 0.0.0.0
When you then hit the issue that the SSO does not complete, you can open up a second ssh connection, go into your app folder and open up the [app]/.dt-app/logs folder where you'll find the SSO url. Copy this url into the hosts browser, which will again redirect you to localhost. This redirect will work after our fix, but right now you have to copy the new url and do a curl to it inside of the VM, like:
curl 'http://localhost:5343/auth/login?state=xy&code=cv'
After all of that, the CLI is authenticated and will start the app!
16 Feb 2023 09:54 PM
So the SSO URL we see in the logs is: https://{environmentid}.apps.dynatrace.com/platform/oauth2/authorization/dynatrace-sso
When i goto this URL in my host machine browser, it redirects me into the Dynatrace Apps UI (not localhost as suggested by you). I dont see a redirect to localhost happening. The URL i end up in automatically is: https://{environmentid}.apps.dynatrace.com/ui
17 Feb 2023 12:38 AM
The url you are looking for should be at the very end of the logs and start like https://sso.dynatrace.com/oauth2/authorize?client_id=....
13 Feb 2023 07:39 PM
also they installed Chromium on the Ubuntu server. That was a suggestion I had made.
Mike