SAP / ui5-tooling

An open and modular toolchain to develop state of the art applications based on the UI5 framework
https://sap.github.io/ui5-tooling
Apache License 2.0
466 stars 69 forks source link

ui5 serve inside devcontainer unreachable from host #972

Closed nocheintobi closed 2 months ago

nocheintobi commented 2 months ago

Expected Behavior

Accessing an app started via ui5 serve should be accessible from outside the devcontainer which properly exposes relevant port(s).

Current Behavior

When running a UI5 app via ui5 serve from within a DevContainer (in VSCode), I can cURL the index.html from inside the devcontainer. But when trying to access it from the host (outside the devcontainer), I do not get any response, all requests are pending like forever.

The container configuration is ok, when serving the app via the npm-module http-server, it is accessible from inside and outside the container as expected, only ui5 servedoes not work from outside.

The project itself is also ok, since when running it outside the devcvontainer, also everything works as expected - and I`m speaking of an "empty" generated example app.

Steps to Reproduce the Issue

Context

Log Output / Stack Trace

Unfortunately, there is no log entry when requesting and no client side error or response.

flovogt commented 2 months ago

Hi @nocheintobi, thanks a lot for sharing this finding. We will analyze your issue/requirement.

RandomByte commented 2 months ago

Please try using ui5 serve --accept-remote-connections

https://sap.github.io/ui5-tooling/v3/pages/CLI/#ui5-serve

nocheintobi commented 2 months ago

I added the flag - and as you can see in the screenshot, it has been accepted - but unfortunately still no access from outside the container.

screenshot
d3xter666 commented 2 months ago

Hi @nocheintobi ,

Did you try to rebuild the container? It seems like the port forwarding didn't work on your side. I just tried this scenario with https://github.com/SAP/openui5-sample-app and it works perfectly fine. Even without the flag @RandomByte proposed above.

You can also check the port bindings of your running containers in running the Docker container

Cheers

nocheintobi commented 2 months ago

Ok, now I'm confused... In fact, I rebuilt the container several times before without any effects. And we had the issue on two completely different hosts independently (a mac and a win machine)... BUT: the sample app @d3xter666 mentioned worked fine (not without the flag mentioned by @RandomByte, but that makes kind of sense). I deleted all related containers and images and retried with our demo app and an additional productive app => now both are working on my host as desired. I'll follow up in case the other computer gives additional information on the cause - thanks a lot for your support!