simont77 / fakegato-history

Module to emulate Elgato Eve history
MIT License
167 stars 15 forks source link

Google Drive module doesn't handle forced logout scenario #49

Closed NorthernMan54 closed 6 years ago

NorthernMan54 commented 6 years ago

@simont77 Hi all, I had to restart my router, and probably the external IP address changed. From that time fakegato, that was still running on my raspberry, stopped to save the history to google drive. I suppose that it is an authentication related problem. Do you know how can we fix it? Unfortunately on my main installation I have logging disabled, so I don’t know if any error was caught.

NorthernMan54 [12:23 PM] @simont77 If you restart homebridge does it fix itself? I'm thinking the error handling doesn't handle the forced logout scenario, and authenticate again.

simont77 [12:27 PM] Yes, restarting homebridge fixes everything, the saved history is correctly reloaded and updated

NorthernMan54 commented 6 years ago

simont77 [8:30 AM] …I had another issue, I just got a power outage. On restart fakegato did not reload the history from google drive and started a new one. I suppose this is due to the fact that homebridge started before the router was ready, so there was no route to google drive. Any idea to fix this?

NorthernMan54 commented 6 years ago

Power outage today, and picked this out of the logs

Sun, 01 Apr 2018 21:50:51 GMT FakeGatoStorageDrive getFolder - err { Error: getaddrinfo ENOTFOUND accounts.google. com accounts.google.com:443 at errnoException (dns.js:28:10) at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:73:26) code: 'ENOTFOUND', errno: 'ENOTFOUND', syscall: 'getaddrinfo', hostname: 'accounts.google.com', host: 'accounts.google.com', port: 443 }

Sun, 01 Apr 2018 21:51:11 GMT FakeGatoStorageDrive no file found, creating howard_Family Room_persist.json { name: 'howard_Family Room_persist.json', parents: [ undefined ] } { mimeType: 'application/json', body: '"{\"firstEntry\":0,\"lastEntry\":2,\"usedMemory\":2,\"refTime\":544312231,\"initialTime\":15226 19431,\"history\":[\"noValue\",{\"time\":1522619431,\"setRefTime\":1},{\"temp\":22.32,\"pressure\":100 6.23,\"humidity\":36.74,\"time\":1522619431}]}"' }

NorthernMan54 commented 6 years ago

Apr 15 14:18:12 penny homebridge[1281]: Sun, 15 Apr 2018 18:18:12 GMT FakeGatoStorageDrive getFolder - err { Error: getaddrinfo ENOTFOUND accounts.google.com accounts.google.com:443 Apr 15 14:18:12 penny homebridge[1281]: at errnoException (dns.js:28:10) Apr 15 14:18:12 penny homebridge[1281]: at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26) Apr 15 14:18:12 penny homebridge[1281]: code: 'ENOTFOUND', Apr 15 14:18:12 penny homebridge[1281]: errno: 'ENOTFOUND', Apr 15 14:18:12 penny homebridge[1281]: syscall: 'getaddrinfo', Apr 15 14:18:12 penny homebridge[1281]: hostname: 'accounts.google.com', Apr 15 14:18:12 penny homebridge[1281]: host: 'accounts.google.com', Apr 15 14:18:12 penny homebridge[1281]: port: 443 }

Apr 15 14:19:13 penny homebridge[1281]: Sun, 15 Apr 2018 18:19:13 GMT FakeGatoStorageDrive download undefined/penny_NODE-2BA4CB_persist.json Apr 15 14:19:13 penny homebridge[1281]: Sun, 15 Apr 2018 18:19:13 GMT FakeGatoStorageDrive download file undefined penny_NODE-2BA4CB_persist.json Apr 15 14:19:13 penny homebridge[1281]: Sun, 15 Apr 2018 18:19:13 GMT FakeGatoStorageDrive getFolder - err { Error: getaddrinfo ENOTFOUND accounts.google.com accounts.google.com:443 Apr 15 14:19:13 penny homebridge[1281]: at errnoException (dns.js:28:10) Apr 15 14:19:13 penny homebridge[1281]: at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26) Apr 15 14:19:13 penny homebridge[1281]: code: 'ENOTFOUND', Apr 15 14:19:13 penny homebridge[1281]: errno: 'ENOTFOUND', Apr 15 14:19:13 penny homebridge[1281]: syscall: 'getaddrinfo', Apr 15 14:19:13 penny homebridge[1281]: hostname: 'accounts.google.com', Apr 15 14:19:13 penny homebridge[1281]: host: 'accounts.google.com', Apr 15 14:19:13 penny homebridge[1281]: port: 443 } Apr 15 14:19:13 penny homebridge[1281]: [4/15/2018, 2:19:13 PM] [mcuiot] Loading... Apr 15 14:19:13 penny homebridge[1281]: [4/15/2018, 2:19:13 PM] [Basement] ** Fakegato-storage read googleDrive file: fakegato/penny_NODE-8F8FE_persist.json

NorthernMan54 commented 6 years ago

Closed with pull request #54