Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid endpoint error, causing due to failed openssl command. #261

Closed
nikhilkinkar opened this issue Feb 8, 2021 · 3 comments
Closed
Labels

Comments

@nikhilkinkar
Copy link

we have few test devices on which node-red application is running, on one of those devices we are constantly getting the error

invalid endpoint opc.tcp://OPCUA_SERVER_IP:4840 Error: Command failed: "openssl" req -new -sha256 -text -extensions v3_selfsigned -config "/home/edge/.config/node-opcua-default-nodejs/PKI/own/openssl.cnf.tmp" -key "/home/edge/.config/node-opcua-default-nodejs/PKI/own/private/private_key.pem" -out "/home/edge/.node-red/node_modules/node-opcua-client/certificates/client_selfsigned_cert_2048.pem.csr" -subj "/C=FR/L=Orleans/O=Sterfive/CN=NodeOPCUA-Client@epc1522/DC=epc1522"
Can't open /home/edge/.node-red/node_modules/node-opcua-client/certificates/client_selfsigned_cert_2048.pem.csr for writing, No such file or directory
139981074134272:error:02001002:system library:fopen:No such file or directory:../openssl-1.1.1g/crypto/bio/bss_file.c:69:fopen('/home/edge/.node-red/node_modules/node-opcua-client/certificates/client_selfsigned_cert_2048.pem.csr','w')
139981074134272:error:2006D080:BIO routines:BIO_new_file:no such file:../openssl-1.1.1g/crypto/bio/bss_file.c:76:

this is visible under the opcua client node,
image

I have checked the path /home/edge/.node-red/node_modules/node-opcua-client/ but the folder structure seems to be different in this case, inside the given path I can see

$ ls
LICENSE README.md dist node_modules package.json source test_helpers tsconfig.json typedoc.js

the certificates directory (as mentioned in error) is not present here. Same build is working on another device smoothly. Just to check the folder structure I checked it with older build with node-red-contrib-opcua version 0.2.89 there the /home/edge/.node-red/node_modules/node-opcua-client/ contains the certificates folder, that build is also working. I am not sure what is causing this error. Is it device specific issue or some config is going wrong, could anybody please suggest how to get rid of this issue.

@mikakaraila
Copy link
Owner

Do you have internet connection? At least you have when you install node-opcua and other npm packages.

Node-opcua tries to download and install openssl first. It is missing or it is wrong version. It causes next step fails as
it tries to generate certificate files.

openssl" req -new -sha256 -text -extensions v3_selfsigned -config "/home/edge/.config/node-opcua-default-nodejs/PKI/own/openssl.cnf.tmp" -key "/home/edge/.config/node-opcua-default-nodejs/PKI/own/private/private_key.pem" -out "/home/edge/.node-red/node_modules/node-opcua-client/certificates/client_selfsigned_cert_2048.pem.csr" -subj "/C=FR/L=Orleans/O=Sterfive/CN=NodeOPCUA-Client@epc1522/DC=epc1522"

@mikakaraila
Copy link
Owner

Another case can be access rights, which user is running node-red vs. installation done by admin/root?

@nikhilkinkar
Copy link
Author

nikhilkinkar commented Feb 10, 2021

@mikakaraila Thanks for you inputs. I found that after restarting the device, the issue was gone, is there any caching mechanism running behind (either from nodejs, openssl or linux side) that may have kept the path "/home/edge/.node-red/node_modules/node-opcua-client/certificates/client_selfsigned_cert_2048.pem.csr", because we had initially node-red-contrib-opcua v0.2.89 running on this system, later we changed to v0.2.100, then it started giving error. Now the device was restarted it is working for latest version as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants