mindsphere / node-red-contrib-mindconnect

Node-RED Agent for the MindConnect API (community driven project)
https://opensource.mindsphere.io/docs/node-red-contrib-mindconnect/index.html
MIT License
48 stars 1 forks source link

ETIMEDOUT when trying to upload data #127

Closed fPecc closed 3 years ago

fPecc commented 3 years ago

Describe the bug The NodeRed node is returning an ETIMEDOUT error every time it tries to upload data to Mindsphere. This installation has been working fine and uploading data correctly for about 3 weeks, until the 31/03/2021, when this error appeared. We need information on how to get more logs or more data to solve this issue. Perhaps there is a problem with the internet connection between the PC and Mindsphere, but if that is the case, we need information on how to verify this.

To Reproduce We couldn´t reproduce the issue in other environments.

Expected behavior The data should be correctly uploaded to Mindsphere.

Screenshots Attached is a screenshot of the error. image

Desktop (please complete the following information):

MindSphere Plan

Additional context This is a production environment and we need to get this up and running as fast as possible.

sn0wcat commented 3 years ago

@fPecc can you check if you can reach mindsphere from that PC using a browser? unfortunately that looks like a network connectivity issue and node-red or mindconnect node can't do much about it.

fPecc commented 3 years ago

The NodeRed is installed behind a proxy, but all necessary environment variables to be able to reach Mindsphere were configured. Two configuration were added to npm using npm config set: https-proxy and proxy. Actually, if I type my tenants URL in a browser inside that machine, I am able to access the tenant.

I was looking at the troubleshooting guide and noticed that this could be related to a invalid date/time on the device. The computer where this NodeRed is installed is part of an Active Directory, and the entire Active Directory is synchronized via NTP with the Microsoft servers. Is this configuration OK, or should we synchronize to another specific NTP server?

sn0wcat commented 3 years ago

@fPecc this is probably not the time on the device, but most probably your proxy settings. You need to have HTTP_PROXY variable set up correctly and that should happen before the node-red process is started. the error indicates that node process can't reach internet...

fPecc commented 3 years ago

@sn0wcat Its strange that the communication has been working for a while now only using the npm proxy configs. But anyways, I configured both environment variables http_proxy and https_proxy and then opened a new command prompt and verified the configuration using:

echo %http_proxy% echo %https_proxy%

The result of both commands was the expected configured proxy. Then, I restarted the NodeRed.

I will be monitoring the communication today and give some feedback.

sn0wcat commented 3 years ago

@fPecc glad to hear it :) just ping me if there are problems :)

EliasReuter commented 3 years ago

Hi @sn0wcat

I'm having the same problem right now, but there is no proxy configured. In order to test Internet Connection and if it's a network connectivity issue, I added a http request node (GET https://www.google.com) and the statusCode is "200".

image

What do you suggest us to try?

OS: Windows 10 NPM version: 6.14.11 Node version: 14.16.0 NodeRed version: 1.2.9 Mindconnect node version: 3.11.0

sn0wcat commented 3 years ago

@EliasReuter if the device is in the same network configure the proxy the same way @fPecc did, this looks like network issue

sn0wcat commented 3 years ago

@EliasReuter mindconnect node uses the HTTP_PROXY environment variable, it might be that http node can handle the system proxy settings but the node needs the variable explicitly set //cc @fPecc

EliasReuter commented 3 years ago

@sn0wcat Even if I don't have or need proxy configured in my environment?

sn0wcat commented 3 years ago

@EliasReuter did you manage to get the connectivity working, can we close this issue?

EliasReuter commented 3 years ago

Hi @sn0wcat Yes. It was a customer's network configuration problem that caused this error in my case. We can close this issue.

Thank you for the support!