Markourai / DomoticzSuez

Domoticz plugin to retrieve information on toutsurmoneau website (Suez)
GNU General Public License v3.0
1 stars 2 forks source link

"Data received are not JSON: Expecting value: line 1 column 1 (char 0) during step getdatadays" after a 502 html error #2

Closed fripooy closed 3 years ago

fripooy commented 3 years ago

Hi,

I just install the plugin in my domoticz. There is an error during data retrieving :

'2020-11-09 22:13:01.550 (EauSuez) 70 70 6c 65 57 65 62 4b 69 74 2f 35 33 37 2e 33 36 20 28 4b ppleWebKit/537.36.(K
2020-11-09 22:13:01.550 (EauSuez) 48 54 4d 4c 2c 20 6c 69 6b 65 20 47 65 63 6b 6f 29 20 43 68 HTML,.like.Gecko).Ch
2020-11-09 22:13:01.550 (EauSuez) 72 6f 6d 65 2f 36 31 2e 30 2e 33 31 36 33 2e 31 30 30 20 4d rome/61.0.3163.100.M
2020-11-09 22:13:01.550 (EauSuez) 6f 62 69 6c 65 20 53 61 66 61 72 69 2f 35 33 37 2e 33 36 0d obile.Safari/537.36.
2020-11-09 22:13:01.550 (EauSuez) 0a 43 6f 6e 6e 65 63 74 69 6f 6e 3a 20 6b 65 65 70 2d 61 6c .Connection:.keep-al
2020-11-09 22:13:01.550 (EauSuez) 69 76 65 0d 0a 48 6f 73 74 3a 20 77 77 77 2e 74 6f 75 74 73 ive..Host:.www.touts
2020-11-09 22:13:01.550 (EauSuez) 75 72 6d 6f 6e 65 61 75 2e 66 72 3a 34 34 33 0d 0a 43 6f 6f urmoneau.fr:443..Coo
2020-11-09 22:13:01.550 (EauSuez) 6b 69 65 3a 20 65 5a 53 45 53 53 49 44 3d 61 33 32 34 38 30 kie:.eZSESSID=a32480
2020-11-09 22:13:01.550 (EauSuez) 31 32 37 36 38 63 38 34 33 38 37 35 31 39 30 65 38 61 62 36 12768c843875190e8ab6
2020-11-09 22:13:01.550 (EauSuez) 61 61 33 31 37 30 0d 0a 0d 0a .. .. .. .. .. .. .. .. .. .. aa3170....
2020-11-09 22:13:17.656 (EauSuez) Pushing 'onHeartbeatCallback' on to queue
2020-11-09 22:13:17.684 (EauSuez) Processing 'onHeartbeatCallback' message
2020-11-09 22:13:17.684 (EauSuez) Calling message handler 'onHeartbeat'.
2020-11-09 22:13:17.684 (EauSuez) onHeartbeat() called
2020-11-09 22:13:37.663 (EauSuez) Pushing 'onHeartbeatCallback' on to queue
2020-11-09 22:13:37.693 (EauSuez) Processing 'onHeartbeatCallback' message
2020-11-09 22:13:37.693 (EauSuez) Calling message handler 'onHeartbeat'.
2020-11-09 22:13:37.693 (EauSuez) onHeartbeat() called
2020-11-09 22:13:57.670 (EauSuez) Pushing 'onHeartbeatCallback' on to queue
2020-11-09 22:13:57.709 (EauSuez) Processing 'onHeartbeatCallback' message
2020-11-09 22:13:57.709 (EauSuez) Calling message handler 'onHeartbeat'.
2020-11-09 22:13:57.709 (EauSuez) onHeartbeat() called
2020-11-09 22:14:01.711 (EauSuez) Pushing 'ReadEvent' on to queue
2020-11-09 22:14:01.741 (EauSuez) Processing 'ReadEvent' message
2020-11-09 22:14:01.741 (EauSuez) Received 788 bytes of data
2020-11-09 22:14:01.741 (EauSuez) 48 54 54 50 2f 31 2e 31 20 35 30 32 20 42 61 64 20 47 61 74 HTTP/1.1.502.Bad.Gat
2020-11-09 22:14:01.741 (EauSuez) 65 77 61 79 0d 0a 44 61 74 65 3a 20 4d 6f 6e 2c 20 30 39 20 eway..Date:.Mon,.09.
2020-11-09 22:14:01.741 (EauSuez) 4e 6f 76 20 32 30 32 30 20 32 31 3a 31 33 3a 30 31 20 47 4d Nov.2020.21:13:01.GM
2020-11-09 22:14:01.741 (EauSuez) 54 0d 0a 53 74 72 69 63 74 2d 54 72 61 6e 73 70 6f 72 74 2d T..Strict-Transport-
2020-11-09 22:14:01.741 (EauSuez) 53 65 63 75 72 69 74 79 3a 20 6d 61 78 2d 61 67 65 3d 33 36 Security:.max-age=36
2020-11-09 22:14:01.741 (EauSuez) 30 30 3b 20 69 6e 63 6c 75 64 65 53 75 62 44 6f 6d 61 69 6e 00;.includeSubDomain
2020-11-09 22:14:01.741 (EauSuez) 73 3b 20 70 72 65 6c 6f 61 64 0d 0a 53 74 72 69 63 74 2d 54 s;.preload..Strict-T
2020-11-09 22:14:01.741 (EauSuez) 72 61 6e 73 70 6f 72 74 2d 53 65 63 75 72 69 74 79 3a 20 6d ransport-Security:.m
2020-11-09 22:14:01.742 (EauSuez) 61 78 2d 61 67 65 3d 33 36 30 30 3b 20 69 6e 63 6c 75 64 65 ax-age=3600;.include
2020-11-09 22:14:01.742 (EauSuez) 53 75 62 44 6f 6d 61 69 6e 73 3b 20 70 72 65 6c 6f 61 64 0d SubDomains;.preload.
2020-11-09 22:14:01.742 (EauSuez) 0a 43 6f 6e 74 65 6e 74 2d 4c 65 6e 67 74 68 3a 20 34 36 33 .Content-Length:.463
2020-11-09 22:14:01.742 (EauSuez) 0d 0a 4b 65 65 70 2d 41 6c 69 76 65 3a 20 74 69 6d 65 6f 75 ..Keep-Alive:.timeou
2020-11-09 22:14:01.742 (EauSuez) 74 3d 35 2c 20 6d 61 78 3d 33 30 30 0d 0a 43 6f 6e 6e 65 63 t=5,.max=300..Connec
2020-11-09 22:14:01.742 (EauSuez) 74 69 6f 6e 3a 20 4b 65 65 70 2d 41 6c 69 76 65 0d 0a 43 6f tion:.Keep-Alive..Co
2020-11-09 22:14:01.742 (EauSuez) 6e 74 65 6e 74 2d 54 79 70 65 3a 20 74 65 78 74 2f 68 74 6d ntent-Type:.text/htm
2020-11-09 22:14:01.742 (EauSuez) 6c 3b 20 63 68 61 72 73 65 74 3d 69 73 6f 2d 38 38 35 39 2d l;.charset=iso-8859-
2020-11-09 22:14:01.742 (EauSuez) 31 0d 0a 0d 0a 3c 21 44 4f 43 54 59 50 45 20 48 54 4d 4c 20 1......502.
2020-11-09 22:14:01.742 (EauSuez) 42 61 64 20 47 61 74 65 77 61 79 3c 2f 74 69 74 6c 65 3e 0a Bad.Gateway.
2020-11-09 22:14:01.742 (EauSuez) 3c 2f 68 65 61 64 3e 3c 62 6f 64 79 3e 0a 3c 68 31 3e 42 61 .

Ba 2020-11-09 22:14:01.742 (EauSuez) 64 20 47 61 74 65 77 61 79 3c 2f 68 31 3e 0a 3c 70 3e 54 68 d.Gateway

.

Th 2020-11-09 22:14:01.742 (EauSuez) 65 20 70 72 6f 78 79 20 73 65 72 76 65 72 20 72 65 63 65 69 e.proxy.server.recei 2020-11-09 22:14:01.742 (EauSuez) 76 65 64 20 61 6e 20 69 6e 76 61 6c 69 64 0d 0a 72 65 73 70 ved.an.invalid..resp 2020-11-09 22:14:01.742 (EauSuez) 6f 6e 73 65 20 66 72 6f 6d 20 61 6e 20 75 70 73 74 72 65 61 onse.from.an.upstrea 2020-11-09 22:14:01.742 (EauSuez) 6d 20 73 65 72 76 65 72 2e 3c 62 72 20 2f 3e 0d 0a 54 68 65 m.server...The 2020-11-09 22:14:01.743 (EauSuez) 20 70 72 6f 78 79 20 73 65 72 76 65 72 20 63 6f 75 6c 64 20 .proxy.server.could. 2020-11-09 22:14:01.743 (EauSuez) 6e 6f 74 20 68 61 6e 64 6c 65 20 74 68 65 20 72 65 71 75 65 not.handle.the.reque 2020-11-09 22:14:01.743 (EauSuez) 73 74 20 3c 65 6d 3e 3c 61 20 68 72 65 66 3d 22 2f 6d 6f 6e st.GET /mon-compt 2020-11-09 22:14:01.743 (EauSuez) 65 2d 65 6e 2d 6c 69 67 6e 65 2f 73 74 61 74 4a 44 61 74 61 e-en-ligne/statJData 2020-11-09 22:14:01.743 (EauSuez) 2f 32 30 32 30 2f 31 30 2f 31 32 34 30 3c 2f 61 3e 3c 2f 65 /2020/10/1240.

.Reason:.Error.reading.fro 2020-11-09 22:14:01.743 (EauSuez) 6d 20 72 65 6d 6f 74 65 20 73 65 72 76 65 72 3c 2f 73 74 72 m.remote.server

. 2020-11-09 22:14:01.743 (EauSuez) 3c 2f 68 74 6d 6c 3e 0a .. .. .. .. .. .. .. .. .. .. .. .. . 2020-11-09 22:14:01.743 (EauSuez) Pushing 'onMessageCallback' on to queue 2020-11-09 22:14:01.743 (EauSuez) Processing 'onMessageCallback' message 2020-11-09 22:14:01.743 (EauSuez) Calling message handler 'onMessage'. 2020-11-09 22:14:01.743 (EauSuez) onMessage called 2020-11-09 22:14:01.743 (EauSuez) getdatadays 2020-11-09 22:14:01.744 (EauSuez) Parsing data for year: 2020 and month: 10 2020-11-09 22:14:01.744 (EauSuez) Dict details (3): 2020-11-09 22:14:01.744 (EauSuez) --->'Status':'502' 2020-11-09 22:14:01.744 (EauSuez) --->'Headers (6): 2020-11-09 22:14:01.744 (EauSuez) ------->'Date':'Mon, 09 Nov 2020 21:13:01 GMT' 2020-11-09 22:14:01.744 (EauSuez) ------->'Strict-Transport-Security':'['max-age=3600; includeSubDomains; preload', 'max-age=3600; includeSubDomains; preload']' 2020-11-09 22:14:01.744 (EauSuez) ------->'Content-Length':'463' 2020-11-09 22:14:01.744 (EauSuez) ------->'Keep-Alive':'timeout=5, max=300' 2020-11-09 22:14:01.744 (EauSuez) ------->'Connection':'Keep-Alive' 2020-11-09 22:14:01.744 (EauSuez) ------->'Content-Type':'text/html; charset=iso-8859-1' 2020-11-09 22:14:01.744 (EauSuez) --->'Data':'b'\n\n502 Bad Gateway\n\n

Bad Gateway

\n

The proxy server received an invalid\r\nresponse from an upstream server.
\r\nThe proxy server could not handle the request GET /mon-compte-en-ligne/statJData/2020/10/1240.

\nReason: Error reading from remote server

\n\n'' 2020-11-09 22:14:01.744 (EauSuez) Begin Data Days 2020-11-09 22:14:01.744 (EauSuez) Dict details (3): 2020-11-09 22:14:01.744 (EauSuez) --->'Status':'502' 2020-11-09 22:14:01.744 (EauSuez) --->'Headers (6): 2020-11-09 22:14:01.744 (EauSuez) ------->'Date':'Mon, 09 Nov 2020 21:13:01 GMT' 2020-11-09 22:14:01.744 (EauSuez) ------->'Strict-Transport-Security':'['max-age=3600; includeSubDomains; preload', 'max-age=3600; includeSubDomains; preload']' 2020-11-09 22:14:01.745 (EauSuez) ------->'Content-Length':'463' 2020-11-09 22:14:01.745 (EauSuez) ------->'Keep-Alive':'timeout=5, max=300' 2020-11-09 22:14:01.745 (EauSuez) ------->'Connection':'Keep-Alive' 2020-11-09 22:14:01.745 (EauSuez) ------->'Content-Type':'text/html; charset=iso-8859-1' 2020-11-09 22:14:01.745 (EauSuez) --->'Data':'b'\n\n502 Bad Gateway\n\n

Bad Gateway

\n

The proxy server received an invalid\r\nresponse from an upstream server.
\r\nThe proxy server could not handle the request GET /mon-compte-en-ligne/statJData/2020/10/1240.

\nReason: Error reading from remote server

\n\n'' 2020-11-09 22:14:01.745 (EauSuez) Next connection: 2020-11-09 23:29:01 2020-11-09 22:14:01.745 Error: (EauSuez) Data received are not JSON: Expecting value: line 1 column 1 (char 0) during step getdatadays for days of year 2020 and month 10 2020-11-09 22:14:06.693 (EauSuez) Queued asynchronous secure read aborted. 2020-11-09 22:14:06.693 (EauSuez) Pushing 'DisconnectedEvent' on to queue 2020-11-09 22:14:06.717 (EauSuez) Processing 'DisconnectedEvent' message 2020-11-09 22:14:06.717 (EauSuez) Disconnect event received for 'www.toutsurmoneau.fr:443'. 2020-11-09 22:14:06.718 (EauSuez) Pushing 'onDisconnectCallback' on to queue 2020-11-09 22:14:06.718 (EauSuez) Processing 'onDisconnectCallback' message 2020-11-09 22:14:06.718 (EauSuez) Calling message handler 'onDisconnect'. 2020-11-09 22:14:06.718 (EauSuez) onDisconnect called 2020-11-09 22:14:17.677 (EauSuez) Pushing 'onHeartbeatCallback' on to queue 2020-11-09 22:14:17.722 (EauSuez) Processing 'onHeartbeatCallback' message 2020-11-09 22:14:17.723 (EauSuez) Calling message handler 'onHeartbeat'. 2020-11-09 22:14:17.723 (EauSuez) onHeartbeat() called

After few transactions a 502 html code occured.

Do you have an idea ?

Thanks

Markourai commented 3 years ago

Hi, Thank you to try my plugin but I won't update it as I migrated to HomeAssistant (which contains a Suez plugin).

From what I saw, there is an issue with your proxy. That's not something I use at home.

Please feel free to fork my project and improve it if you want.