OPC UA Connection Problem
I have a problem establishing a connection to the OPCUA server in the Node-RED app I've developed. I'm using the EPC1522 gateway. I'm encountering this issue:
I can establish a connection when I manually start the Docker image I used for developing the app (using 'docker run'). This leads me to suspect that the error only occurs when I build an app from this image using 'Podman'.
Hier ist the Conf Node.
I would greatly appreciate your assistance with this.
BR,
Hadi Saeidi
Comments
The OPC UA server is running on the EPC 1522, is that correct?
What device is the Node Red application running on - is it also on the EPC 1522?
The Node Red application is running in an OCI container, is that correct?
What command did you use to run the OCI image using Docker? Is that command executed as root user, or as a "normal" user?
What command did you use to run the OCI image using Podman? Is that command executed as root user, or as a "normal" user?
If you're trying to run an OCI image on a PLCnext Control device using Podman, please be aware that this is not currently supported. Podman is only included on PLCnext Control devices for PLCnext Store apps (I know this is not clear in the documentation).
Yes, the OPC UA server is running on the EPC 1522. Otherwise, we wouldn't have been able to establish a connection with the server. (I have attached an image in the previous discussion.)
The device, as I mentioned in the previous discussion, is the EPC 1522.
Yes, my Node-Red app is running in an OCI container at the URL http://192.168.2.10:1881/.
I have created an image from my custom Node-Red. This image can be started on the host by executing the simple command "Docker run image-name." This way, I can establish a connection with the OPC UA server on the Edge Gateway. The gateway is connected to my host via a LAN cable.
From the image, I have developed an application that can be launched through the 'Web Based Management' interface, similar to the official Node-Red application in the PLCnext App Store. However, it does not establish a connection to the OPC UA server, even though a connection is established on my host.
Does the same problem happen if you install Docker on the EPC 1522, and start the OCI container using Docker from the command line, just like on the host machine?
It works if i install Docker on the EPC 1522 and start the OCI container using Docker from the command line.
But i need an App from my Image that can be launched through the 'Web Based Management'
So to summarise the problem:
Is all that correct?
I am wondering if this is related to the permissions that Podman uses, compared with Docker. If the above summary is correct then I will see if our PLCnext Store experts can explain this behaviour - they may have seen this type of behaviour in other container-based PLCnext Store apps.
The first thing is right, but I'm not sure about your reference to "Podman"
I made an "Container App" from my image using a template and it seems like this template uses "Podman" I can start the app on Port 1881 through the Web-Based Management (WBM) without having to type any commands manually to run it from the OCI container. I just click to start my app in WBM.
Here is the structure of the template I'm using:
Podman is a container engine that is installed on PLCnext Control devices, for use by PLCnext Store apps.
If you're able to start a container using docker on the command line, then you should be able to use exactly the same command to start a container using podman on the command line - just replace the "docker" command with "podman". You might need to execute the podman command with sudo. If you start the container using podman on the command line, with the same parameters as you used with docker, is the Node Red application in the container able to connect to the OPC UA Server?
using podman:
root@epc1522:/opt/plcnext/# sudo podman run -it -p 1880:1880 -v node_red_data:/data --name nodered localhost/tresmonodereddocker
Error: OCI runtime error: runc: container_linux.go:349: starting container process caused "error adding seccomp filter rule for syscall bdflush: requested action matches default action of filter"
Using firmware 2023.0, I added "docker.io" to the
unqualified-search-registries
in/etc/containers/registries.conf
, and then:... then I was able to access Node-Red from a browser on port 1880.
So it looks like podman is working OK in this firmware version. If the same command works for you, then I don't understand how docker can start a container from your image, but podman cannot. I wonder if docker installed an older version of runc, which might be messing with podman? If that's the case, then maybe you can try clearing the EPC (using a Type 1 reset) and then try the podman command again.
After clearing the EPC (using a Type 1 reset), i was able to access my Node-Red using command line and connect to OPC UA server. I'll create an app from the OCI Container and let you know if it works.