[gelöst] Pushover funktioniert nicht mehr über PERL Aufruf

Begonnen von bg1704, 27 Januar 2020, 09:29:54

Vorheriges Thema - Nächstes Thema

bg1704

Hallo zusammen,

seit Anfang Januar funktioniert das Pushover nicht mehr. Folgende Applikation habe ich für Pushover ertüchtigt, damit lief das System seit 3-4 Jahren:

Globale, flexible Fenster-/Tür-Offen-Meldungen
https://forum.fhem.de/index.php/topic,36504.0.html


sub PushInfo($$) {
   my ($msgsubj,$msgtext) = @_;

   fhem("set <Pushover> msg 'winOpenMessage' '$msgsubj - $msgtext' ")
}


Das Verhalten ist für mich nicht nachvollziehbar, da ein Testaufruf über die cmd-Zeile einwandfrei funktioniert.
Ich habe das Logfile einmal mit dem PERL Aufruf und dann einmal mit dem cmd-Aufruf:
Zuerst den nicht funktionierende PERL Aufruf:

2020.01.26 14:21:16 5: Cmd: >{PushInfo('Türe','Test Dummy ist immer noch  offen');}<
2020.01.26 14:21:16 5: Cmd: >set pushmsg msg Türe - Test Dummy ist immer noch  offen<
2020.01.26 14:21:16 5: Pushover pushmsg: called function Pushover_SetMessage2()
2020.01.26 14:21:16 5: Pushover pushmsg: called function Pushover_SendCommand()
2020.01.26 14:21:16 4: Pushover pushmsg: REQ messages.json/message=Türe - Test Dummy ist immer noch offen&user=xyz
2020.01.26 14:21:16 5: Pushover pushmsg: GET https://api.pushover.net:443/1/messages.json (POST DATA: message=Türe - Test Dummy ist immer noch offen&user=xyz, noshutdown=1)
2020.01.26 14:21:16 5: HttpUtils url=https://api.pushover.net:443/1/messages.json
2020.01.26 14:21:16 4: IP: api.pushover.net -> 207.244.81.102
2020.01.26 14:21:16 5: Starting notify loop for pushmsg, 1 event(s), first is msg Türe - Test Dummy ist immer noch offen
2020.01.26 14:21:16 5: rg_battery: not on any display, ignoring notify
2020.01.26 14:21:16 5: End notify loop for pushmsg


2020.01.26 14:21:22 4: CUL_Parse: CUL_0 Z02020DCD -99.5
2020.01.26 14:21:22 5: CUL_0: dispatch Z02020D
2020.01.26 14:21:22 5: Starting notify loop for CUL_0, 1 event(s), first is UNKNOWNCODE Z02020D
2020.01.26 14:21:22 5: rg_battery: not on any display, ignoring notify
2020.01.26 14:21:22 5: End notify loop for CUL_0
2020.01.26 14:21:22 3: CUL_0: Unknown code Z02020D, help me!
2020.01.26 14:21:22 4: HttpUtils: https://api.pushover.net:443/1/messages.json: Can't connect(2) to https://api.pushover.net:443:  SSL connect attempt failed because of handshake problems error:00000000:lib(0):func(0):reason(0)
2020.01.26 14:21:22 5: Pushover pushmsg: Received HttpUtils callback:

PARAM:
$VAR1 = {
          'protocol' => 'https',
          'httpversion' => '1.1',
          'hu_blocking' => 0,
          'loglevel' => 4,
          'auth' => 0,
          'conn' => undef,
          'hu_port' => '443',
          'hu_portSfx' => '',
          'timeout' => 3,
          'displayurl' => 'https://api.pushover.net:443/1/messages.json',
          'url' => 'https://api.pushover.net:443/1/messages.json',
          'NAME' => '',
          'cmd' => 'message=T%c3%bcre%20%2d%20Test%20Dummy%20ist%20immer%20noch%20offen&user=xyz',
          'sslargs' => {},
          'path' => '/1/messages.json',
          'data' => 'message=T%c3%bcre%20%2d%20Test%20Dummy%20ist%20immer%20noch%20offen&user=xyz',
          'service' => 'messages.json',
          'host' => 'api.pushover.net',
          'hash' => {
                      'USER_KEY' => 'xyz',
                      '.attrminint' => [],
                      'READINGS' => {
                                      'apiRemaining' => {
                                                          'TIME' => '2020-01-26 14:20:31',
                                                          'VAL' => '7450
'
                                                        },
                                      'lastResult' => {
                                                        'TIME' => '2020-01-26 14:20:31',
                                                        'VAL' => 'ok'
                                                      },
                                      'tokenState' => {
                                                        'TIME' => '2017-04-14 13:41:19',
                                                        'VAL' => 'valid'
                                                      },
                                      'state' => {
                                                   'TIME' => '2020-01-26 14:20:50',
                                                   'VAL' => 'disconnected'
                                                 },
                                      'userState' => {
                                                       'TIME' => '2017-04-14 13:41:19',
                                                       'VAL' => 'valid'
                                                     },
                                      'group' => {
                                                   'TIME' => '2017-04-14 13:41:19',
                                                   'VAL' => '0'
                                                 },
                                      'available' => {
                                                       'TIME' => '2020-01-26 14:20:50',
                                                       'VAL' => 0
                                                     },
                                      'lastDevice' => {
                                                        'TIME' => '2020-01-26 14:20:31',
                                                        'VAL' => 'motogplay,oneplusa3003'
                                                      },
                                      'apiReset' => {
                                                      'TIME' => '2020-01-26 14:20:31',
                                                      'VAL' => '1580536800
'
                                                    },
                                      'lastTitle' => {
                                                       'TIME' => '2019-07-14 12:28:22',
                                                       'VAL' => 'FHEM'
                                                     },
                                      'devices' => {
                                                     'TIME' => '2017-10-11 20:56:57',
                                                     'VAL' => 'motogplay,oneplusa3003'
                                                   },
                                      'lastRequest' => {
                                                         'TIME' => '2020-01-26 14:20:31',
                                                         'VAL' => 'eb7419f2-e6f4-4003-9687-c6eaa490e0c3'
                                                       },
                                      'lastMessage' => {
                                                         'TIME' => '2020-01-26 14:20:31',
                                                         'VAL' => 'testnachricth'
                                                       },
                                      'lastAction' => {
                                                        'TIME' => '2020-01-26 14:20:31',
                                                        'VAL' => '-'
                                                      },
                                      'apiLimit' => {
                                                      'TIME' => '2020-01-26 14:20:31',
                                                      'VAL' => '7500
'
                                                    },
                                      'lastPriority' => {
                                                          'TIME' => '2019-12-28 15:40:01',
                                                          'VAL' => '1'
                                                        }
                                    },
                      'DEF' => 'xyz',
                      'VALIDATION_TIMER' => '1580045150.41157',
                      'FUUID' => '5c4b4abb-f33f-3c90-c3e5-14bdb99ec0b0a23a',
                      'NR' => 56,
                      '.FhemMetaInternals' => 1,
                      'APP_TOKEN' => 'xyz',
                      'NAME' => 'pushmsg',
                      'TYPE' => 'Pushover',
                      'FVERSION' => '70_Pushover.pm:v2.2.0-s20897/2020-01-06',
                      'STATE' => 'disconnected',
                      '.attraggr' => []
                    },
          'redirects' => 0,
          'callback' => sub { "DUMMY" },
          'compress' => 1,
          'type' => {
                      'attachment' => undef,
                      'priority' => undef,
                      'device' => undef,
                      'message' => 'Türe - Test Dummy ist immer noch offen',
                      'retry' => undef,
                      'url_title' => undef,
                      'timestamp' => undef,
                      'action' => undef,
                      'title' => undef,
                      'expire' => undef,
                      'sound' => undef
                    },
          'addr' => 'https://api.pushover.net:443',
          'noshutdown' => 1,
          'header' => {
                        'Accept-Charset' => 'UTF-8',
                        'User-Agent' => 'FHEM-Pushover/1.0.0',
                        'Accept' => 'application/json;charset=UTF-8',
                        'Agent' => 'FHEM-Pushover/1.0.0'
                      }
        };


ERROR:
$VAR1 = 'https://api.pushover.net:443/1/messages.json: Can\'t connect(2) to https://api.pushover.net:443:  SSL connect attempt failed because of handshake problems error:00000000:lib(0):func(0):reason(0)';


DATA:
$VAR1 = '';

2020.01.26 14:21:22 4: Pushover pushmsg: RCV TIMEOUT messages.json/message=Türe - Test Dummy ist immer noch offen&user=xyz



Jetzt der funktionierende PERL Aufruf:


2020.01.26 14:20:30 5: Cmd: >set pushmsg msg testnachricth<
2020.01.26 14:20:30 5: Pushover pushmsg: called function Pushover_SetMessage2()
2020.01.26 14:20:30 5: Pushover pushmsg: called function Pushover_SendCommand()
2020.01.26 14:20:30 4: Pushover pushmsg: REQ messages.json/message=testnachricth&user=xyz
2020.01.26 14:20:30 5: Pushover pushmsg: GET https://api.pushover.net:443/1/messages.json (POST DATA: message=testnachricth&user=xyz, noshutdown=1)
2020.01.26 14:20:30 5: HttpUtils url=https://api.pushover.net:443/1/messages.json
2020.01.26 14:20:30 4: IP: api.pushover.net -> 207.244.81.102
2020.01.26 14:20:30 5: Starting notify loop for pushmsg, 1 event(s), first is msg testnachricth
2020.01.26 14:20:30 5: rg_battery: not on any display, ignoring notify
2020.01.26 14:20:30 5: End notify loop for pushmsg
2020.01.26 14:20:30 4: WEB_192.168.178.37_55698 GET /fhem?fw_id=1144; BUFLEN:0
2020.01.26 14:20:30 4: WEB: /fhem?fw_id=1144 / RL:1881 / text/html; charset=UTF-8 / Content-Encoding: gzip
/ Cache-Control: no-cache, no-store, must-revalidate

2020.01.26 14:20:31 5: HttpUtils request header:
POST /1/messages.json HTTP/1.1
Host: api.pushover.net
Accept-Encoding: gzip,deflate
Connection: Close
Accept-Charset: UTF-8
User-Agent: FHEM-Pushover/1.0.0
Accept: application/json;charset=UTF-8
Agent: FHEM-Pushover/1.0.0
Content-Length: 94
Content-Type: application/x-www-form-urlencoded

2020.01.26 14:20:31 4: WEB_192.168.178.37_55698 GET /fhem?XHR=1&inform=type=status;filter=;since=1580044829;fmt=JSON&fw_id=1144×tamp=1580044868822; BUFLEN:0
2020.01.26 14:20:31 4: https://api.pushover.net:443/1/messages.json: HTTP response code 200
2020.01.26 14:20:31 5: HttpUtils https://api.pushover.net:443/1/messages.json: Got data, length: 61
2020.01.26 14:20:31 5: HttpUtils response header:
HTTP/1.1 200 OK
Server: nginx
Date: Sun, 26 Jan 2020 13:20:31 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: close
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, OPTIONS
Access-Control-Allow-Headers: X-Requested-With, X-Prototype-Version, Origin, Accept, Content-Type, X-CSRF-Token, X-Pushover-App, Authorization
Access-Control-Max-Age: 1728000
X-Limit-App-Limit: 7500
X-Limit-App-Remaining: 7450
X-Limit-App-Reset: 1580536800
ETag: W/"5658cdffaa6ceaf4d2cdf99511c0085f"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: eb7419f2-e6f4-4003-9687-c6eaa490e0c3
X-Runtime: 0.156441
X-Frame-Options: DENY
Strict-Transport-Security: max-age=31536000
2020.01.26 14:20:31 5: Pushover pushmsg: Received HttpUtils callback:

PARAM:
$VAR1 = {
          'protocol' => 'https',
          'hu_port' => '443',
          'hu_portSfx' => '',
          'timeout' => 3,
          'url' => 'https://api.pushover.net:443/1/messages.json',
          'code' => '200',
          'cmd' => 'message=testnachricth&user=xyz',
          'data' => 'message=testnachricth&user=xyz',
          'service' => 'messages.json',
          'hash' => {
                      'USER_KEY' => 'xyz',
                      '.attrminint' => [],
                      'READINGS' => {
                                      'apiRemaining' => {
                                                          'TIME' => '2020-01-26 11:36:03',
                                                          'VAL' => '7451'
                                                        },
                                      'lastResult' => {
                                                        'TIME' => '2020-01-26 12:11:49',
                                                        'VAL' => 'ok'
                                                      },
                                      'tokenState' => {
                                                        'TIME' => '2017-04-14 13:41:19',
                                                        'VAL' => 'valid'
                                                      },
                                      'state' => {
                                                   'TIME' => '2020-01-26 14:20:15',
                                                   'VAL' => 'disconnected'
                                                 },
                                      'userState' => {
                                                       'TIME' => '2017-04-14 13:41:19',
                                                       'VAL' => 'valid'
                                                     },
                                      'group' => {
                                                   'TIME' => '2017-04-14 13:41:19',
                                                   'VAL' => '0'
                                                 },
                                      'available' => {
                                                       'TIME' => '2020-01-26 14:20:15',
                                                       'VAL' => 0
                                                     },
                                      'lastDevice' => {
                                                        'TIME' => '2020-01-26 11:36:03',
                                                        'VAL' => 'motogplay,oneplusa3003'
                                                      },
                                      'apiReset' => {
                                                      'TIME' => '2020-01-26 11:36:03',
                                                      'VAL' => '1580536800'
                                                    },
                                      'lastTitle' => {
                                                       'TIME' => '2019-07-14 12:28:22',
                                                       'VAL' => 'FHEM'
                                                     },
                                      'devices' => {
                                                     'TIME' => '2017-10-11 20:56:57',
                                                     'VAL' => 'motogplay,oneplusa3003'
                                                   },
                                      'lastRequest' => {
                                                         'TIME' => '2020-01-26 11:36:03',
                                                         'VAL' => '2a6a6c1a-7f4d-4570-ad6a-e8cc0b3fb957'
                                                       },
                                      'lastMessage' => {
                                                         'TIME' => '2020-01-26 11:36:03',
                                                         'VAL' => 'PO TEST'
                                                       },
                                      'lastAction' => {
                                                        'TIME' => '2020-01-26 11:36:03',
                                                        'VAL' => '-'
                                                      },
                                      'apiLimit' => {
                                                      'TIME' => '2020-01-26 11:36:03',
                                                      'VAL' => '7500'
                                                    },
                                      'lastPriority' => {
                                                          'TIME' => '2019-12-28 15:40:01',
                                                          'VAL' => '1'
                                                        }
                                    },
                      'DEF' => 'xyz',
                      'VALIDATION_TIMER' => '1580045115.0117',
                      'FUUID' => '5c4b4abb-f33f-3c90-c3e5-14bdb99ec0b0a23a',
                      'NR' => 56,
                      '.FhemMetaInternals' => 1,
                      'APP_TOKEN' => 'xyz',
                      'NAME' => 'pushmsg',
                      'TYPE' => 'Pushover',
                      'FVERSION' => '70_Pushover.pm:v2.2.0-s20897/2020-01-06',
                      'STATE' => 'disconnected',
                      '.attraggr' => []
                    },
          'redirects' => 0,
          'httpheader' => 'HTTP/1.1 200 OK
Server: nginx
Date: Sun, 26 Jan 2020 13:20:31 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: close
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, OPTIONS
Access-Control-Allow-Headers: X-Requested-With, X-Prototype-Version, Origin, Accept, Content-Type, X-CSRF-Token, X-Pushover-App, Authorization
Access-Control-Max-Age: 1728000
X-Limit-App-Limit: 7500
X-Limit-App-Remaining: 7450
X-Limit-App-Reset: 1580536800
ETag: W/"5658cdffaa6ceaf4d2cdf99511c0085f"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: eb7419f2-e6f4-4003-9687-c6eaa490e0c3
X-Runtime: 0.156441
X-Frame-Options: DENY
Strict-Transport-Security: max-age=31536000',
          'callback' => sub { "DUMMY" },
          'compress' => 1,
          'type' => {
                      'attachment' => undef,
                      'priority' => undef,
                      'device' => undef,
                      'message' => 'testnachricth',
                      'retry' => undef,
                      'url_title' => undef,
                      'timestamp' => undef,
                      'action' => undef,
                      'title' => undef,
                      'expire' => undef,
                      'sound' => undef
                    },
          'noshutdown' => 1,
          'httpversion' => '1.1',
          'hu_blocking' => 0,
          'loglevel' => 4,
          'auth' => 0,
          'conn' => undef,
          'displayurl' => 'https://api.pushover.net:443/1/messages.json',
          'hu_filecount' => 1,
          'NAME' => '',
          'sslargs' => {},
          'buf' => '',
          'path' => '/1/messages.json',
          'host' => 'api.pushover.net',
          'addr' => 'https://api.pushover.net:443',
          'header' => 'Accept-Charset: UTF-8
User-Agent: FHEM-Pushover/1.0.0
Accept: application/json;charset=UTF-8
Agent: FHEM-Pushover/1.0.0'
        };


ERROR:
$VAR1 = '';


DATA:
$VAR1 = '{"status":1,"request":"eb7419f2-e6f4-4003-9687-c6eaa490e0c3"}';

2020.01.26 14:20:31 4: Pushover pushmsg: RCV messages.json/message=testnachricth&user=xyz
2020.01.26 14:20:31 5: Pushover pushmsg: RES messages.json/message=testnachricth&user=xyz
{"status":1,"request":"eb7419f2-e6f4-4003-9687-c6eaa490e0c3"}
2020.01.26 14:20:31 5: Starting notify loop for pushmsg, 10 event(s), first is apiLimit: 7500\r
2020.01.26 14:20:31 5: createNotifyHash
2020.01.26 14:20:31 5: rg_battery: not on any display, ignoring notify
2020.01.26 14:20:31 5: End notify loop for pushmsg
2020.01.26 14:20:36 4: Connection closed for WEB_192.168.178.37_55698: EOF
2020.01.26 14:20:36 4: WEB_192.168.178.37_55697 GET /fhem/FileLog_logWrapper?dev=Logfile&type=text&file=fhem-2020-01.log; BUFLEN:0



Ich habe die Vermutung, dass es etwas mit SSL zu tun. Deshalb habe ich folgenden Befehl nochmals ausgeführt
cpan -i IO::Socket::SSL
Ohne Erfolg.

Ich bin auch nicht so tief drin und kann deshalb keine weiteren Schlüsse daraus ziehen, deshalb bitte ich um Eure Unterstützung.

Danke vorab

darkness

Ich kenne Pushover nicht. Aber du solltest die URL anpassen und USER/Token unkenntlich machen bzw jetzt neu generieren , damit die Daten keiner "verwenden" kann.

Gruß


bg1704

ZitatIch kenne Pushover nicht. Aber du solltest die URL anpassen und USER/Token unkenntlich machen bzw jetzt neu generieren , damit die Daten keiner "verwenden" kann.
Danke für den Tipp.

rudolfkoenig

Da zwischen Request und Fehlermeldung 6 Sekunden liegen: evtl war nur der Server ueberlastet, und es reicht den timeout hochzusetzen.

bg1704

Zitat
Da zwischen Request und Fehlermeldung 6 Sekunden liegen: evtl war nur der Server ueberlastet, und es reicht den timeout hochzusetzen.
Danke für den Tipp. Werde es heute Abend ausprobieren und Rückmeldung geben.
Kommt SSL als Problem also eher nicht in Betracht?

bg1704

Zitat von: rudolfkoenig am 27 Januar 2020, 10:10:50
Da zwischen Request und Fehlermeldung 6 Sekunden liegen: evtl war nur der Server ueberlastet, und es reicht den timeout hochzusetzen.
Es war tatsächlich eine zeitliches Problem. Hatte nach der Pushovermeldung direkt eine Emailsendung. Diese Emailsendung dauert nun aus unbekanntem Grund länger als früher (hat sich wohl beim Email Provider etwas geändert). Das hat tatsächlich zu dem Fehler geführt.
Bin total froh das Problem so schnell gelöst zu haben, vielen Dank an @rudolfkoenig für den hilfreichen Tipp. Ich hätte wahrscheinlich noch lange gesucht...