mikejac / node-red-contrib-google-smarthome

A collection of Node-RED nodes to control your smart home devices via Google Assistant.
GNU General Public License v3.0
116 stars 36 forks source link

continously fetch errors #490

Closed bartbutenaers closed 6 months ago

bartbutenaers commented 6 months ago

Hi all,

I am in the middle of an upgrade of my Node-RED system. Done a lot of things already, but now this node continously logs the following error:

{
  "msg": "Error in HttpActions:reportState()",
  "org_msg": {
    "message": "request to https://www.googleapis.com/oauth2/v4/token failed, reason: getaddrinfo EAI_AGAIN www.googleapis.com",
    "type": "system",
    "errno": "EAI_AGAIN",
    "code": "EAI_AGAIN",
    "config": {
      "method": "POST",
      "url": "https://www.googleapis.com/oauth2/v4/token",
      "data": {
        "grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer",
        "assertion": "...."
      },
      "headers": {
        "Content-Type": "application/x-www-form-urlencoded",
        "User-Agent": "google-api-nodejs-client/8.7.0",
        "x-goog-api-client": "gl-node/18.19.0 auth/8.7.0",
        "Accept": "application/json"
      },
      "responseType": "json",
      "body": "grant_type=urn..."
    }
  },
  "data": {
    "postData": {
      "requestId": "0Ro2tlpN0KPjFKuff5Ir4H",
      "agentUserId": "0",
      "payload": {
        "devices": {
          "states": {
            "c21fefd5b4e86d09": {
              "online": true,
              "openPercent": 0
            }
          }
        }
      }
    }
  }
}

So it will be related to something I have done, but I can't pinpoint it due to my large number of changes.

The weird thing is that everything seems to be working normally, what my voice control concerns...

Does anybody have some tips about what I could try to get rid of this error? Because it occurs once every few seconds...

Thanks!! Bart

Caprico85 commented 6 months ago

Hi,

    "message": "request to https://www.googleapis.com/oauth2/v4/token failed, reason: getaddrinfo EAI_AGAIN www.googleapis.com",

This means a DNS lookup for www.googleapis.com failed. That is, this domain could not be resolved to an IP address. Some things I would try are:

Regards

bartbutenaers commented 6 months ago

Hi @Caprico85,

You nailed it. One of my migration actions was to install a Tailscale agent on my Raspberry, to avoid port forwarding. And seems that this agent had overwritten my /etc/resolv.conf file. I simply had to put the Google dns servers in my tailnet, and everything was solved.

Thanks for sharing your insights, and writing it all down... Really appreciated!!! Bart