andrei-tatar / node-red-contrib-smartnora

Node Red Google Home integration
https://smart-nora.eu/
109 stars 24 forks source link

Can't link my SmartNora account to the devices in nodered #287

Closed Shikaban closed 11 months ago

Shikaban commented 11 months ago

I'm getting not connected under the each node of smartnora, And in the debug this is what is reporting, am I doing something wrong? image

andrei-tatar commented 11 months ago

@Shikaban can you post full logs? It seems like there's an issue with the network/internet access on your machine and nora can't access the internet:

image

jvdpas commented 11 months ago

After updating from 1.20.0 to 1.21.0 im also not able to authenticate. 12/1/2023, 7:51:29 PM msg : string[67] "nora: FirebaseError: Firebase: Error (auth/network-request-failed)."

I am able to login https://smart-nora.eu/my-nora Maybe something to do with google 2FA?

jvdpas commented 11 months ago

After reverting to1.20.0 tried to login via nora config node. The "link account" shows "instance unknown to link" See screenshot below.

unknown

Shikaban commented 11 months ago

After reverting to1.20.0 tried to login via nora config node.

unknown

Even for me the same popup after I click ok it's going in a loop where is not logging in , same for me unknokwn appear.

Shikaban commented 11 months ago

@Shikaban can you post full logs?

It seems like there's an issue with the network/internet access on your machine and nora can't access the internet:

image

Hi andrei yes I will share it as soon il get back to my home that screenshot was taken from my iPhone as I was out of my home for work, when I'm back i will share better photo , the account is a premium account and the subscription is active with a renew at 3º of this month. Just give me like 15 hours I'm going to take-off in this moment

Shikaban commented 11 months ago

My user id:

vqIWAc8vGpSiquZ6GEozbtuposm1

image

andrei-tatar commented 11 months ago

@Shikaban it's not clear to me what is happening. Have you been able to check the internet access on the device you're running node-red on? The error is the same (network-request-failed).

Can you try pinging identitytoolkit.googleapis.com (eg: ping identitytoolkit.googleapis.com).

Do you have any firewall rules setup or something else that could block the network traffic to the node-red instance?

andrei-tatar commented 11 months ago

After reverting to1.20.0 tried to login via nora config node. The "link account" shows "instance unknown to link" See screenshot below.

This might be related to the browser you're using and shouldn't impact the login. What browser/os are you using?

Shikaban commented 11 months ago

@Shikaban it's not clear to me what is happening. Have you been able to check the internet access on the device you're running node-red on? The error is the same (network-request-failed).

Can you try pinging identitytoolkit.googleapis.com (eg: ping identitytoolkit.googleapis.com).

Do you have any firewall rules setup or something else that could block the network traffic to the node-red instance?

Yes I've disabled the pihole that I was using just to be sure but all of that happened after I've updated to the last version, I was using the 1.18.2 for a while so I've just updated firstly to the 1.20 and after to the 1.21 as it wasn't working.

Internet is ok I've also tried to disable all the flow and create only one node with SmartNora but nothing. Ping is ok image

Also tried to link a new account just for testing purpose but still nothing.

Could I do something more for helping us finding the issue?

I will try to move from buster release to bookworm but I think I'll find the time on the next Saturday , living with a little daughter is a little hard 😆

andrei-tatar commented 11 months ago

@Shikaban can you provide more info on the following:

  1. running on a Raspberry Pi?
  2. running debian buster?
  3. node.js version?
  4. node-red version?
  5. is this a new setup and it's not working or on the same setup you have now, it worked before?
  6. what region of the globe are you in? Italy?
  7. is there any other detail in the node-red logs? (if you run sudo journalctl -u nodered -S yesterday > nodered_logs_1day.txt and send over the file nodered_logs_1day.txt - maybe over email).
jvdpas commented 11 months ago

After reverting to1.20.0 tried to login via nora config node. The "link account" shows "instance unknown to link" See screenshot below.

This might be related to the browser you're using and shouldn't impact the login. What browser/os are you using?

Hi Andrea,

I used 2 chrome and firefox. The 'unknown' is replaced by the local node-red ip when i ''Clear cookies and site data...". But that does not resolve the issue as you stated.

Used ping to check internet access on the PI. That is ok.

Removed "node-red-contrib-smartnora" node from node-red including the global node configuration. Reinstalled version 1.21.0 and repeated the smart nora twice whith 2 accounts.

From log "nodered_logs_1day.txt" Dec 03 11:03:49 raspberrypi Node-RED[324]: [2023-12-03T10:03:49.090Z] @firebase/auth: Auth (10.7.0): INTERNAL ASSERTION FAILED: Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill Dec 03 11:03:49 raspberrypi Node-RED[324]: 3 Dec 11:03:49 - [error] nora: FirebaseError: Firebase: Error (auth/network-request-failed).

No Solution yet. Do you have any ideas?

andrei-tatar commented 11 months ago

@jvdpas - if you could also provide answers to the same questions as above:

  1. running on a Raspberry Pi?
  2. running debian buster?
  3. node.js version?
  4. node-red version?
  5. is this a new setup and it's not working or on the same setup you have now, it worked before?
  6. what region of the globe are you in? Italy?
  7. is there any other detail in the node-red logs? (if you run sudo journalctl -u nodered -S yesterday > nodered_logs_1day.txt and send over the file nodered_logs_1day.txt - maybe over email).
jvdpas commented 11 months ago
  1. yes
  2. NO "Raspbian GNU/Linux 9 (stretch)"
  3. Node.js v14.21.0.
  4. 3.0.2: Maintenance Release
  5. It was a working setup (in use a few years)
  6. No netherlands
  7. snip from log Dec 03 11:02:37 raspberrypi Node-RED[324]: [2023-12-03T10:02:37.479Z] @firebase/auth: Auth (10.7.0): INTERNAL ASSERTION FAILED: Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill Dec 03 11:02:37 raspberrypi Node-RED[324]: 3 Dec 11:02:37 - [error] nora: FirebaseError: Firebase: Error (auth/network-request-failed).
andrei-tatar commented 11 months ago

@jvdpas I think the problem is the one you highlighted in the logs: Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill.

I was able to reproduce it using the versions you're running. I think the actual problem is the old npm version shipped with node 14. I'm looking into a fix. The fastest fix for you would probably be to update node.js to v18 or v20.

andrei-tatar commented 11 months ago

@jvdpas @Shikaban I've published node-red-contrib-smartnora version 1.21.4 (you can install it by running, inside .node-red folder: npm install node-red-contrib-smartnora@1.21.4).

The issue was caused by the latest firebase package version. I fixed it to 10.6 and that fixed the issue.

jvdpas commented 11 months ago

@jvdpas @Shikaban I've published node-red-contrib-smartnora version 1.21.4 (you can install it by running, inside .node-red folder: npm install node-red-contrib-smartnora@1.21.4).

The issue was caused by the latest firebase package version. I fixed it to 10.6 and that fixed the issue.

Hi Andrei, Thanx nohting else to say ;-)

jvdpas commented 11 months ago

It works, Thanx

Shikaban commented 11 months ago

I was going to give you all the information but you've already manage to fix it! Thanks a lot Andrei! All is working as intended, I will still try to update to bookworm so I can keep the last version of node.js

Again I'll appreciate what you have done!

jvdpas commented 11 months ago

I was going to give you all the information but you've already manage to fix it! Thanks a lot Andrei! All is working as intended, I will still try to update to bookworm so I can keep the last version of node.js

Again I'll appreciate what you have done!

Hi Shikaban, could you please close the ticket. ThanX