Unable to start manager of CP, port wrong?

Hi,
I have been trying to launch the custom project manager for days, at first everything seems to go well but at the end I get a blank page. I have seen a similar post but my error is different.
I also followed the steps to set up the IDE, I compiled it with the installDist command and I’m using the Custom Deployment run configuration.
In fact, the problem seems to be related to keycloak, in the console I see that it does not find a file on localhost:8080, but I can see it on 8081. This is not normal, isn’t it? I mean, I haven’t changed the ports anywhere and I use the default settings. How can I fix it? I attach a screenshot, I hope you can see it.
Thanks in advance

Hi!

First of all, welcome to the forum! :partying_face:

Looks like you’ve done the correct steps regarding the setup, so nothing wrong there.
Along with that, you probably did docker-compose -f profile/dev-testing.yml up -d,
which should not bring any issues in regards to local development.

However, it seems you’re not running the manager. (our backend software)
On the wiki we ‘assume’ that you run it yourself through your preferred IDE.
Like this;

image

.
If you do not want (or not able) to run the backend software, you can run it on docker instead.
Simply replace dev-testing in that command mentioned earlier to dev-ui.

Hope this helps! :wink:

Hi Martin
thanks for your reply, unfortunately it has not helped me to run OR.
Effectively, I used `docker-compose -f profile/dev-testing.yml up -d

Then, in theory, I run your manager following the wiki instructions, with the command:


From this image I understand that the manager is running successfully. In fact, the site http://localhost:9000/manager/ is loaded and I can see the logo and the OpenRemote Demo message in the tab, but the page is blank.
It is when I look at the console that I see messages like the following:
Loading failed for the with source “http://localhost:8080/auth/js/keycloak.min.js”.

And indeed, it is impossible for it to find that file because keycloak works on port 8081, as indicated in dev-testing.yml

Finally, I also tried running dev-ui.yml, and in this case the manager is in a permanently restarting state.

Any other clues?

The npm run serve command runs the frontend UI of the OpenRemote Manager,
it still needs a backend service up and running; either through your IDE or the dev-ui profile as I explained earlier.

.

Yes keycloak is exposed on docker through port 8081,
but in our backend service we internally redirect localhost:8080/auth to Keycloak as well.
The error above shows the redirect :wink:

.

Please share the logs of these.

Be aware that you shouldn’t run the backend software from your UI when using dev-ui.
You can also try cleaning up existing volumes and images, and pulling fresh versions of them.

Hi Martin,
it is almost working, I just started the whole process, from a new folder, cloning your repositories again, so I don’t know what was going on before.
However, Openremote now fails in some specific cases. For example, when trying to create an Electricity consumer asset the web browser shows errors, but this does not happen when creating a MQTT asset.


I wonder if it’s because the openremote manager is still “building”, although it’s been like that for almost 2 hours.

Thanks a lot for your replies!

1 Like

Yes we’re aware that a “language tag: undefined” error pops up now and then. We noted the issue.
Selecting a language manually in the top right menu fixes this.

.

It’s normal; this is the runtime process of the backend Manager software. :wink:
Technically it’s “running” not building anymore.

Martin, I’m sorry to bother you again, we’re following the steps one by one until we have a personalised project. The next step was to run the backend manager through dev-ui, and it worked. However, we’ve wanted to test it by creating an MQTTasset, and if the manager is the one running in docker the asset is shown as WAITING. On the other hand, if we stop this manager and run it from the IDE, it is shown as CONNECTED.
The logs in docker show this periodically:

2024-02-16 17:21:03 2024-02-16 17:21:03.111 INFO [com.hivemq.client.mqtt-2-1 ] ocol.mqtt.AbstractMQTT_IOClient.PROTOCOL : Connection failed ‘mqtt://localhost:3883/?clientId=napomqtt’: initiator=CLIENT
2024-02-16 17:21:03 com.hivemq.client.mqtt.exceptions.ConnectionFailedException: io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(…) failed: Connection refused: localhost/127.0.0.1:3883
2024-02-16 17:21:03 Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(…) failed: Connection refused: localhost/127.0.0.1:3883
2024-02-16 17:21:03 Caused by: java.net.ConnectException: finishConnect(…) failed: Connection refused
2024-02-16 17:21:03 at io.netty.channel.unix.Errors.newConnectException0(Errors.java:166)
2024-02-16 17:21:03 at io.netty.channel.unix.Errors.handleConnectErrno(Errors.java:131)
2024-02-16 17:21:03 at io.netty.channel.unix.Socket.finishConnect(Socket.java:359)
2024-02-16 17:21:03 at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.doFinishConnect(AbstractEpollChannel.java:710)
2024-02-16 17:21:03 at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.finishConnect(AbstractEpollChannel.java:687)
2024-02-16 17:21:03 at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.epollOutReady(AbstractEpollChannel.java:567)
2024-02-16 17:21:03 at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:499)
2024-02-16 17:21:03 at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:407)
2024-02-16 17:21:03 at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
2024-02-16 17:21:03 at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
2024-02-16 17:21:03 at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
2024-02-16 17:21:03 at java.base/java.lang.Thread.run(Thread.java:840)
2024-02-16 17:21:03 2024-02-16 17:21:03.111 INFO [Scheduled task-4 ] ocol.mqtt.AbstractMQTT_IOClient.PROTOCOL : Client ‘mqtt://localhost:3881/?clientId=napomqtt’ connection status changed: WAITING

We don’t know why is refused the connection in this case.
Maybe the steps to get the manager fully working with docker are detailed somewhere in the wiki and I haven’t seen it? Not to bother too much :wink:
Many thanks

Hello, I’m not 100% sure but it seems that you are using “localhost” to connect to the MQTT broker on localhost:3883. Localhost, when you are using the manager on Docker, means that it is using the container’s localhost, not your bare metal localhost. You could try using the IP of the computer on the network, I think that could work, but you can read up on why and how you should do that, in forums like here: How to reach localhost on host from docker container? - Compose - Docker Community Forums

When you are running the manager on your IDE, hence bare-metal, then localhost does refer to your host machine’s localhost, hence it would work.

1 Like

Yep, you’re absolutely right, thank you very much.

1 Like

host.docker.internal is what you want I believe, we use it in our dev-proxy.yml compose profile for running a proxy in docker but manager within an IDE outside of docker.