cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unable to start dev server. Stuck at browser reload

abcd
Frequent Guest

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

 

image.png

12 REPLIES 12

sinisa_zubic
Dynatrace Champion
Dynatrace Champion

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:

  • what kind of node version is installed (output of node --version)
  • what kind of npm version is installed (output of npm --version)
  • on which OS is the dev server running (output of  cat /etc/os-release)
  • which cli version do you have installed (execute following command in your repository: npx dtp-cli version )
  • what kind of virtualization do you use (WSL, VMware, VirtualBox, etc.)?

With WSL I already did the same, run the server within the VM and forwarded the traffic to the host machine.

Best,

Sini

 

sinisa_zubic
Dynatrace Champion
Dynatrace Champion

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

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...

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.

Thanks Stefan we will wait for the response from the customer. Much appreciated.

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.

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!

Wolfi-Stefan
Dynatrace Participant
Dynatrace Participant

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!

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

Wolfi-Stefan
Dynatrace Participant
Dynatrace Participant

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=....

michael_taylor
Dynatrace Advisor
Dynatrace Advisor

also they installed Chromium on the Ubuntu server. That was a suggestion I had made. 

Mike

Featured Posts