Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. [gelöst] Api-Calls seit Update auf 5.7 nicht mehr möglich

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    [gelöst] Api-Calls seit Update auf 5.7 nicht mehr möglich

    This topic has been deleted. Only users with topic management privileges can see it.
    • arteck
      arteck Developer Most Active last edited by arteck

      @tmartin sagte in Api-Calls seit Update auf 5.7 nicht mehr möglich:

      axios

      wo ist der definiert ?? nicht im deinem schnippsel

      ? 1 Reply Last reply Reply Quote 0
      • ?
        A Former User @arteck last edited by

        @arteck wird oben im script alles definiert:

        const axios = require('axios');
        const https = require('https');
        const httpsAgent = new https.Agent({ rejectUnauthorized: false });
        let APITOKEN = 'javascript.0.Alarmanlage.Api-Token';
        

        Und natürlich vorher in der Instanz als zusätzliches Module definiert u. laut logs auch installiert.
        Hat ja auch vor dem Update u. jetzt dem Downgrade immer funktioniert.

        1 Reply Last reply Reply Quote 0
        • ?
          A Former User last edited by A Former User

          Okay und wenn ich den Try-Catch Block entferne und nur den axios.post habe kommt folgender Error:

          2022-06-08 10:19:21.191  - error: host.pfitiob01 Caught by controller[0]: (node:1127781) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
          2022-06-08 10:19:21.194  - error: host.pfitiob01 Caught by controller[0]: (Use `node --trace-warnings ...` to show where the warning was created)
          2022-06-08 10:19:21.194  - error: host.pfitiob01 Caught by controller[1]: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
          2022-06-08 10:19:21.194  - error: host.pfitiob01 Caught by controller[2]: [AxiosError: Request failed with status code 401] {
          2022-06-08 10:19:21.194  - error: host.pfitiob01 Caught by controller[2]:   code: 'ERR_BAD_REQUEST',
          2022-06-08 10:19:21.195  - error: host.pfitiob01 Caught by controller[2]:   config: {
          2022-06-08 10:19:21.195  - error: host.pfitiob01 Caught by controller[2]:     transitional: {
          2022-06-08 10:19:21.195  - error: host.pfitiob01 Caught by controller[2]:       silentJSONParsing: true,
          2022-06-08 10:19:21.195  - error: host.pfitiob01 Caught by controller[2]:       forcedJSONParsing: true,
          2022-06-08 10:19:21.195  - error: host.pfitiob01 Caught by controller[2]:       clarifyTimeoutError: false
          2022-06-08 10:19:21.196  - error: host.pfitiob01 Caught by controller[2]:     },
          2022-06-08 10:19:21.196  - error: host.pfitiob01 Caught by controller[2]:     adapter: [Function: httpAdapter],
          2022-06-08 10:19:21.196  - error: host.pfitiob01 Caught by controller[2]:     transformRequest: [ [Function: transformRequest] ],
          2022-06-08 10:19:21.196  - error: host.pfitiob01 Caught by controller[2]:     transformResponse: [ [Function: transformResponse] ],
          2022-06-08 10:19:21.196  - error: host.pfitiob01 Caught by controller[2]:     timeout: 0,
          2022-06-08 10:19:21.196  - error: host.pfitiob01 Caught by controller[2]:     xsrfCookieName: 'XSRF-TOKEN',
          2022-06-08 10:19:21.197  - error: host.pfitiob01 Caught by controller[2]:     xsrfHeaderName: 'X-XSRF-TOKEN',
          2022-06-08 10:19:21.197  - error: host.pfitiob01 Caught by controller[2]:     maxContentLength: -1,
          2022-06-08 10:19:21.197  - error: host.pfitiob01 Caught by controller[2]:     maxBodyLength: -1,
          2022-06-08 10:19:21.197  - error: host.pfitiob01 Caught by controller[2]:     env: { FormData: [Function] },
          2022-06-08 10:19:21.197  - error: host.pfitiob01 Caught by controller[2]:     validateStatus: [Function: validateStatus],
          2022-06-08 10:19:21.197  - error: host.pfitiob01 Caught by controller[2]:     headers: {
          2022-06-08 10:19:21.198  - error: host.pfitiob01 Caught by controller[2]:       Accept: 'application/json, text/plain, */*',
          2022-06-08 10:19:21.198  - error: host.pfitiob01 Caught by controller[2]:       'Content-Type': 'application/json',
          2022-06-08 10:19:21.198  - error: host.pfitiob01 Caught by controller[2]:       'User-Agent': 'axios/0.27.2',
          2022-06-08 10:19:21.198  - error: host.pfitiob01 Caught by controller[2]:       'Content-Length': 273
          2022-06-08 10:19:21.198  - error: host.pfitiob01 Caught by controller[2]:     },
          2022-06-08 10:19:21.198  - error: host.pfitiob01 Caught by controller[2]:     httpsAgent: Agent {
          2022-06-08 10:19:21.199  - error: host.pfitiob01 Caught by controller[2]:       _events: [Object: null prototype],
          2022-06-08 10:19:21.199  - error: host.pfitiob01 Caught by controller[2]:       _eventsCount: 2,
          2022-06-08 10:19:21.199  - error: host.pfitiob01 Caught by controller[2]:       _maxListeners: 100,
          2022-06-08 10:19:21.199  - error: host.pfitiob01 Caught by controller[2]:       defaultPort: 443,
          2022-06-08 10:19:21.199  - error: host.pfitiob01 Caught by controller[2]:       protocol: 'https:',
          2022-06-08 10:19:21.199  - error: host.pfitiob01 Caught by controller[2]:       options: [Object],
          2022-06-08 10:19:21.200  - error: host.pfitiob01 Caught by controller[2]:       requests: {},
          2022-06-08 10:19:21.200  - error: host.pfitiob01 Caught by controller[2]:       sockets: [Object],
          2022-06-08 10:19:21.200  - error: host.pfitiob01 Caught by controller[2]:       freeSockets: {},
          2022-06-08 10:19:21.200  - error: host.pfitiob01 Caught by controller[2]:       keepAliveMsecs: 1000,
          2022-06-08 10:19:21.200  - error: host.pfitiob01 Caught by controller[2]:       keepAlive: false,
          2022-06-08 10:19:21.200  - error: host.pfitiob01 Caught by controller[2]:       maxSockets: Infinity,
          2022-06-08 10:19:21.200  - error: host.pfitiob01 Caught by controller[2]:       maxFreeSockets: 256,
          2022-06-08 10:19:21.201  - error: host.pfitiob01 Caught by controller[2]:       scheduling: 'lifo',
          2022-06-08 10:19:21.201  - error: host.pfitiob01 Caught by controller[2]:       maxTotalSockets: Infinity,
          2022-06-08 10:19:21.201  - error: host.pfitiob01 Caught by controller[2]:       totalSocketCount: 1,
          2022-06-08 10:19:21.201  - error: host.pfitiob01 Caught by controller[2]:       maxCachedSessions: 100,
          2022-06-08 10:19:21.201  - error: host.pfitiob01 Caught by controller[2]:       _sessionCache: [Object],
          2022-06-08 10:19:21.201  - error: host.pfitiob01 Caught by controller[2]:       [Symbol(kCapture)]: false
          2022-06-08 10:19:21.202  - error: host.pfitiob01 Caught by controller[2]:     },
          2022-06-08 10:19:21.202  - error: host.pfitiob01 Caught by controller[2]:     method: 'post',
          2022-06-08 10:19:21.202  - error: host.pfitiob01 Caught by controller[2]:     url: 'https://fcm.googleapis.com/v1/projects/smarthome-568ee/messages:send',
          2022-06-08 10:19:21.202  - error: host.pfitiob01 Caught by controller[2]:     data: '{"message":{"topic":"httppfitiob01hqpfitconsultde8084","notification":{"title":"Alarmanlage","body":"Alarmanlage aktiviert -> OFFENE Fenster/Türen:<br>EG/Stephan-Ben<br>EG/Alex-Tom<br>EG/WC-Herren<br>Keller/Serverraum 2<br>Keller/Getränkekeller<br>Keller/Serverraum 2"}}}'
          2022-06-08 10:19:21.202  - error: host.pfitiob01 Caught by controller[2]:   },
          2022-06-08 10:19:21.202  - error: host.pfitiob01 Caught by controller[2]:   request: <ref *1> ClientRequest {
          2022-06-08 10:19:21.202  - error: host.pfitiob01 Caught by controller[2]:     _events: [Object: null prototype] {
          2022-06-08 10:19:21.203  - error: host.pfitiob01 Caught by controller[2]:       error: [Array],
          2022-06-08 10:19:21.203  - error: host.pfitiob01 Caught by controller[2]:       abort: [Function (anonymous)],
          2022-06-08 10:19:21.203  - error: host.pfitiob01 Caught by controller[2]:       aborted: [Function (anonymous)],
          2022-06-08 10:19:21.203  - error: host.pfitiob01 Caught by controller[2]:       connect: [Function (anonymous)],
          2022-06-08 10:19:21.203  - error: host.pfitiob01 Caught by controller[2]:       socket: [Function (anonymous)],
          2022-06-08 10:19:21.203  - error: host.pfitiob01 Caught by controller[2]:       timeout: [Function (anonymous)],
          2022-06-08 10:19:21.203  - error: host.pfitiob01 Caught by controller[2]:       prefinish: [Function: requestOnPrefinish]
          2022-06-08 10:19:21.204  - error: host.pfitiob01 Caught by controller[2]:     },
          2022-06-08 10:19:21.204  - error: host.pfitiob01 Caught by controller[2]:     _eventsCount: 7,
          2022-06-08 10:19:21.204  - error: host.pfitiob01 Caught by controller[2]:     _maxListeners: 100,
          2022-06-08 10:19:21.204  - error: host.pfitiob01 Caught by controller[2]:     outputData: [],
          2022-06-08 10:19:21.204  - error: host.pfitiob01 Caught by controller[2]:     outputSize: 0,
          2022-06-08 10:19:21.204  - error: host.pfitiob01 Caught by controller[2]:     writable: true,
          2022-06-08 10:19:21.204  - error: host.pfitiob01 Caught by controller[2]:     destroyed: false,
          2022-06-08 10:19:21.204  - error: host.pfitiob01 Caught by controller[2]:     _last: true,
          2022-06-08 10:19:21.205  - error: host.pfitiob01 Caught by controller[2]:     chunkedEncoding: false,
          2022-06-08 10:19:21.205  - error: host.pfitiob01 Caught by controller[2]:     shouldKeepAlive: false,
          2022-06-08 10:19:21.205  - error: host.pfitiob01 Caught by controller[2]:     _defaultKeepAlive: true,
          2022-06-08 10:19:21.205  - error: host.pfitiob01 Caught by controller[2]:     useChunkedEncodingByDefault: true,
          2022-06-08 10:19:21.205  - error: host.pfitiob01 Caught by controller[2]:     sendDate: false,
          2022-06-08 10:19:21.205  - error: host.pfitiob01 Caught by controller[2]:     _removedConnection: false,
          2022-06-08 10:19:21.206  - error: host.pfitiob01 Caught by controller[2]:     _removedContLen: false,
          2022-06-08 10:19:21.206  - error: host.pfitiob01 Caught by controller[2]:     _removedTE: false,
          2022-06-08 10:19:21.206  - error: host.pfitiob01 Caught by controller[2]:     _contentLength: null,
          2022-06-08 10:19:21.206  - error: host.pfitiob01 Caught by controller[2]:     _hasBody: true,
          2022-06-08 10:19:21.206  - error: host.pfitiob01 Caught by controller[2]:     _trailer: '',
          2022-06-08 10:19:21.206  - error: host.pfitiob01 Caught by controller[2]:     finished: true,
          2022-06-08 10:19:21.206  - error: host.pfitiob01 Caught by controller[2]:     _headerSent: true,
          2022-06-08 10:19:21.206  - error: host.pfitiob01 Caught by controller[2]:     socket: TLSSocket {
          2022-06-08 10:19:21.207  - error: host.pfitiob01 Caught by controller[2]:       _tlsOptions: [Object],
          2022-06-08 10:19:21.207  - error: host.pfitiob01 Caught by controller[2]:       _secureEstablished: true,
          2022-06-08 10:19:21.207  - error: host.pfitiob01 Caught by controller[2]:       _securePending: false,
          2022-06-08 10:19:21.207  - error: host.pfitiob01 Caught by controller[2]:       _newSessionPending: false,
          2022-06-08 10:19:21.207  - error: host.pfitiob01 Caught by controller[2]:       _controlReleased: true,
          2022-06-08 10:19:21.207  - error: host.pfitiob01 Caught by controller[2]:       secureConnecting: false,
          2022-06-08 10:19:21.208  - error: host.pfitiob01 Caught by controller[2]:       _SNICallback: null,
          2022-06-08 10:19:21.208  - error: host.pfitiob01 Caught by controller[2]:       servername: 'fcm.googleapis.com',
          2022-06-08 10:19:21.208  - error: host.pfitiob01 Caught by controller[2]:       alpnProtocol: false,
          2022-06-08 10:19:21.208  - error: host.pfitiob01 Caught by controller[2]:       authorized: true,
          2022-06-08 10:19:21.208  - error: host.pfitiob01 Caught by controller[2]:       authorizationError: null,
          2022-06-08 10:19:21.208  - error: host.pfitiob01 Caught by controller[2]:       encrypted: true,
          2022-06-08 10:19:21.208  - error: host.pfitiob01 Caught by controller[2]:       _events: [Object: null prototype],
          2022-06-08 10:19:21.208  - error: host.pfitiob01 Caught by controller[2]:       _eventsCount: 10,
          2022-06-08 10:19:21.209  - error: host.pfitiob01 Caught by controller[2]:       connecting: false,
          2022-06-08 10:19:21.209  - error: host.pfitiob01 Caught by controller[2]:       _hadError: false,
          2022-06-08 10:19:21.209  - error: host.pfitiob01 Caught by controller[2]:       _parent: null,
          2022-06-08 10:19:21.209  - error: host.pfitiob01 Caught by controller[2]:       _host: 'fcm.googleapis.com',
          2022-06-08 10:19:21.209  - error: host.pfitiob01 Caught by controller[2]:       _readableState: [ReadableState],
          2022-06-08 10:19:21.209  - error: host.pfitiob01 Caught by controller[2]:       _maxListeners: 100,
          2022-06-08 10:19:21.209  - error: host.pfitiob01 Caught by controller[2]:       _writableState: [WritableState],
          2022-06-08 10:19:21.210  - error: host.pfitiob01 Caught by controller[2]:       allowHalfOpen: false,
          2022-06-08 10:19:21.210  - error: host.pfitiob01 Caught by controller[2]:       _sockname: null,
          2022-06-08 10:19:21.210  - error: host.pfitiob01 Caught by controller[2]:       _pendingData: null,
          2022-06-08 10:19:21.210  - error: host.pfitiob01 Caught by controller[2]:       _pendingEncoding: '',
          2022-06-08 10:19:21.210  - error: host.pfitiob01 Caught by controller[2]:       server: undefined,
          2022-06-08 10:19:21.210  - error: host.pfitiob01 Caught by controller[2]:       _server: null,
          2022-06-08 10:19:21.210  - error: host.pfitiob01 Caught by controller[2]:       ssl: [TLSWrap],
          2022-06-08 10:19:21.211  - error: host.pfitiob01 Caught by controller[2]:       _requestCert: true,
          2022-06-08 10:19:21.211  - error: host.pfitiob01 Caught by controller[2]:       _rejectUnauthorized: false,
          2022-06-08 10:19:21.211  - error: host.pfitiob01 Caught by controller[2]:       parser: null,
          2022-06-08 10:19:21.211  - error: host.pfitiob01 Caught by controller[2]:       _httpMessage: [Circular *1],
          2022-06-08 10:19:21.211  - error: host.pfitiob01 Caught by controller[2]:       [Symbol(res)]: [TLSWrap],
          2022-06-08 10:19:21.211  - error: host.pfitiob01 Caught by controller[2]:       [Symbol(verified)]: true,
          2022-06-08 10:19:21.212  - error: host.pfitiob01 Caught by controller[2]:       [Symbol(pendingSession)]: null,
          2022-06-08 10:19:21.212  - error: host.pfitiob01 Caught by controller[2]:       [Symbol(async_id_symbol)]: 3260,
          2022-06-08 10:19:21.212  - error: host.pfitiob01 Caught by controller[2]:       [Symbol(kHandle)]: [TLSWrap],
          2022-06-08 10:19:21.212  - error: host.pfitiob01 Caught by controller[2]:       [Symbol(kSetNoDelay)]: false,
          2022-06-08 10:19:21.212  - error: host.pfitiob01 Caught by controller[2]:       [Symbol(lastWriteQueueSize)]: 0,
          2022-06-08 10:19:21.212  - error: host.pfitiob01 Caught by controller[2]:       [Symbol(timeout)]: null,
          2022-06-08 10:19:21.212  - error: host.pfitiob01 Caught by controller[2]:       [Symbol(kBuffer)]: null,
          2022-06-08 10:19:21.213  - error: host.pfitiob01 Caught by controller[2]:       [Symbol(kBufferCb)]: null,
          2022-06-08 10:19:21.213  - error: host.pfitiob01 Caught by controller[2]:       [Symbol(kBufferGen)]: null,
          2022-06-08 10:19:21.213  - error: host.pfitiob01 Caught by controller[2]:       [Symbol(kCapture)]: false,
          2022-06-08 10:19:21.213  - error: host.pfitiob01 Caught by controller[2]:       [Symbol(kBytesRead)]: 0,
          2022-06-08 10:19:21.213  - error: host.pfitiob01 Caught by controller[2]:       [Symbol(kBytesWritten)]: 0,
          2022-06-08 10:19:21.213  - error: host.pfitiob01 Caught by controller[2]:       [Symbol(connect-options)]: [Object],
          2022-06-08 10:19:21.213  - error: host.pfitiob01 Caught by controller[2]:       [Symbol(RequestTimeout)]: undefined
          2022-06-08 10:19:21.214  - error: host.pfitiob01 Caught by controller[2]:     },
          2022-06-08 10:19:21.214  - error: host.pfitiob01 Caught by controller[2]:     _header: 'POST /v1/projects/smarthome-568ee/messages:send HTTP/1.1\r\n' +
          2022-06-08 10:19:21.214  - error: host.pfitiob01 Caught by controller[2]:       'Accept: application/json, text/plain, */*\r\n' +
          2022-06-08 10:19:21.214  - error: host.pfitiob01 Caught by controller[2]:       'Content-Type: application/json\r\n' +
          2022-06-08 10:19:21.214  - error: host.pfitiob01 Caught by controller[2]:       'User-Agent: axios/0.27.2\r\n' +
          2022-06-08 10:19:21.214  - error: host.pfitiob01 Caught by controller[2]:       'Content-Length: 273\r\n' +
          2022-06-08 10:19:21.215  - error: host.pfitiob01 Caught by controller[2]:       'Host: fcm.googleapis.com\r\n' +
          2022-06-08 10:19:21.215  - error: host.pfitiob01 Caught by controller[2]:       'Connection: close\r\n' +
          2022-06-08 10:19:21.215  - error: host.pfitiob01 Caught by controller[2]:       '\r\n',
          2022-06-08 10:19:21.215  - error: host.pfitiob01 Caught by controller[2]:     _keepAliveTimeout: 0,
          2022-06-08 10:19:21.215  - error: host.pfitiob01 Caught by controller[2]:     _onPendingData: [Function: noopPendingOutput],
          2022-06-08 10:19:21.215  - error: host.pfitiob01 Caught by controller[2]:     agent: Agent {
          2022-06-08 10:19:21.216  - error: host.pfitiob01 Caught by controller[2]:       _events: [Object: null prototype],
          2022-06-08 10:19:21.216  - error: host.pfitiob01 Caught by controller[2]:       _eventsCount: 2,
          2022-06-08 10:19:21.216  - error: host.pfitiob01 Caught by controller[2]:       _maxListeners: 100,
          2022-06-08 10:19:21.216  - error: host.pfitiob01 Caught by controller[2]:       defaultPort: 443,
          2022-06-08 10:19:21.216  - error: host.pfitiob01 Caught by controller[2]:       protocol: 'https:',
          2022-06-08 10:19:21.216  - error: host.pfitiob01 Caught by controller[2]:       options: [Object],
          2022-06-08 10:19:21.216  - error: host.pfitiob01 Caught by controller[2]:       requests: {},
          2022-06-08 10:19:21.218  - error: host.pfitiob01 Caught by controller[2]:       sockets: [Object],
          2022-06-08 10:19:21.218  - error: host.pfitiob01 Caught by controller[2]:       freeSockets: {},
          2022-06-08 10:19:21.218  - error: host.pfitiob01 Caught by controller[2]:       keepAliveMsecs: 1000,
          2022-06-08 10:19:21.219  - error: host.pfitiob01 Caught by controller[2]:       keepAlive: false,
          2022-06-08 10:19:21.219  - error: host.pfitiob01 Caught by controller[2]:       maxSockets: Infinity,
          2022-06-08 10:19:21.219  - error: host.pfitiob01 Caught by controller[2]:       maxFreeSockets: 256,
          2022-06-08 10:19:21.219  - error: host.pfitiob01 Caught by controller[2]:       scheduling: 'lifo',
          2022-06-08 10:19:21.221  - error: host.pfitiob01 Caught by controller[2]:       maxTotalSockets: Infinity,
          2022-06-08 10:19:21.221  - error: host.pfitiob01 Caught by controller[2]:       totalSocketCount: 1,
          2022-06-08 10:19:21.221  - error: host.pfitiob01 Caught by controller[2]:       maxCachedSessions: 100,
          2022-06-08 10:19:21.221  - error: host.pfitiob01 Caught by controller[2]:       _sessionCache: [Object],
          2022-06-08 10:19:21.221  - error: host.pfitiob01 Caught by controller[2]:       [Symbol(kCapture)]: false
          2022-06-08 10:19:21.221  - error: host.pfitiob01 Caught by controller[2]:     },
          2022-06-08 10:19:21.221  - error: host.pfitiob01 Caught by controller[2]:     socketPath: undefined,
          2022-06-08 10:19:21.222  - error: host.pfitiob01 Caught by controller[2]:     method: 'POST',
          2022-06-08 10:19:21.222  - error: host.pfitiob01 Caught by controller[2]:     maxHeaderSize: undefined,
          2022-06-08 10:19:21.222  - error: host.pfitiob01 Caught by controller[2]:     insecureHTTPParser: undefined,
          2022-06-08 10:19:21.222  - error: host.pfitiob01 Caught by controller[2]:     path: '/v1/projects/smarthome-568ee/messages:send',
          2022-06-08 10:19:21.222  - error: host.pfitiob01 Caught by controller[2]:     _ended: true,
          2022-06-08 10:19:21.222  - error: host.pfitiob01 Caught by controller[2]:     res: IncomingMessage {
          2022-06-08 10:19:21.222  - error: host.pfitiob01 Caught by controller[2]:       _readableState: [ReadableState],
          2022-06-08 10:19:21.222  - error: host.pfitiob01 Caught by controller[2]:       _events: [Object: null prototype],
          2022-06-08 10:19:21.223  - error: host.pfitiob01 Caught by controller[2]:       _eventsCount: 4,
          2022-06-08 10:19:21.223  - error: host.pfitiob01 Caught by controller[2]:       _maxListeners: 100,
          2022-06-08 10:19:21.223  - error: host.pfitiob01 Caught by controller[2]:       socket: [TLSSocket],
          2022-06-08 10:19:21.223  - error: host.pfitiob01 Caught by controller[2]:       httpVersionMajor: 1,
          2022-06-08 10:19:21.223  - error: host.pfitiob01 Caught by controller[2]:       httpVersionMinor: 1,
          2022-06-08 10:19:21.223  - error: host.pfitiob01 Caught by controller[2]:       httpVersion: '1.1',
          2022-06-08 10:19:21.223  - error: host.pfitiob01 Caught by controller[2]:       complete: true,
          2022-06-08 10:19:21.223  - error: host.pfitiob01 Caught by controller[2]:       headers: [Object],
          2022-06-08 10:19:21.224  - error: host.pfitiob01 Caught by controller[2]:       rawHeaders: [Array],
          2022-06-08 10:19:21.224  - error: host.pfitiob01 Caught by controller[2]:       trailers: {},
          2022-06-08 10:19:21.224  - error: host.pfitiob01 Caught by controller[2]:       rawTrailers: [],
          2022-06-08 10:19:21.224  - error: host.pfitiob01 Caught by controller[2]:       aborted: false,
          2022-06-08 10:19:21.224  - error: host.pfitiob01 Caught by controller[2]:       upgrade: false,
          2022-06-08 10:19:21.224  - error: host.pfitiob01 Caught by controller[2]:       url: '',
          2022-06-08 10:19:21.224  - error: host.pfitiob01 Caught by controller[2]:       method: null,
          2022-06-08 10:19:21.225  - error: host.pfitiob01 Caught by controller[2]:       statusCode: 401,
          2022-06-08 10:19:21.225  - error: host.pfitiob01 Caught by controller[2]:       statusMessage: 'Unauthorized',
          2022-06-08 10:19:21.225  - error: host.pfitiob01 Caught by controller[2]:       client: [TLSSocket],
          2022-06-08 10:19:21.225  - error: host.pfitiob01 Caught by controller[2]:       _consuming: true,
          2022-06-08 10:19:21.225  - error: host.pfitiob01 Caught by controller[2]:       _dumped: false,
          2022-06-08 10:19:21.225  - error: host.pfitiob01 Caught by controller[2]:       req: [Circular *1],
          2022-06-08 10:19:21.226  - error: host.pfitiob01 Caught by controller[2]:       responseUrl: 'https://fcm.googleapis.com/v1/projects/smarthome-568ee/messages:send',
          2022-06-08 10:19:21.226  - error: host.pfitiob01 Caught by controller[2]:       redirects: [],
          2022-06-08 10:19:21.226  - error: host.pfitiob01 Caught by controller[2]:       [Symbol(kCapture)]: false,
          2022-06-08 10:19:21.226  - error: host.pfitiob01 Caught by controller[2]:       [Symbol(RequestTimeout)]: undefined
          2022-06-08 10:19:21.226  - error: host.pfitiob01 Caught by controller[2]:     },
          2022-06-08 10:19:21.226  - error: host.pfitiob01 Caught by controller[2]:     aborted: false,
          2022-06-08 10:19:21.226  - error: host.pfitiob01 Caught by controller[2]:     timeoutCb: null,
          2022-06-08 10:19:21.227  - error: host.pfitiob01 Caught by controller[2]:     upgradeOrConnect: false,
          2022-06-08 10:19:21.227  - error: host.pfitiob01 Caught by controller[2]:     parser: null,
          2022-06-08 10:19:21.227  - error: host.pfitiob01 Caught by controller[2]:     maxHeadersCount: null,
          2022-06-08 10:19:21.227  - error: host.pfitiob01 Caught by controller[2]:     reusedSocket: false,
          2022-06-08 10:19:21.227  - error: host.pfitiob01 Caught by controller[2]:     host: 'fcm.googleapis.com',
          2022-06-08 10:19:21.227  - error: host.pfitiob01 Caught by controller[2]:     protocol: 'https:',
          2022-06-08 10:19:21.228  - error: host.pfitiob01 Caught by controller[2]:     _redirectable: Writable {
          2022-06-08 10:19:21.228  - error: host.pfitiob01 Caught by controller[2]:       _writableState: [WritableState],
          2022-06-08 10:19:21.228  - error: host.pfitiob01 Caught by controller[2]:       _events: [Object: null prototype],
          2022-06-08 10:19:21.228  - error: host.pfitiob01 Caught by controller[2]:       _eventsCount: 3,
          2022-06-08 10:19:21.228  - error: host.pfitiob01 Caught by controller[2]:       _maxListeners: 100,
          2022-06-08 10:19:21.228  - error: host.pfitiob01 Caught by controller[2]:       _options: [Object],
          2022-06-08 10:19:21.228  - error: host.pfitiob01 Caught by controller[2]:       _ended: true,
          2022-06-08 10:19:21.229  - error: host.pfitiob01 Caught by controller[2]:       _ending: true,
          2022-06-08 10:19:21.229  - error: host.pfitiob01 Caught by controller[2]:       _redirectCount: 0,
          2022-06-08 10:19:21.229  - error: host.pfitiob01 Caught by controller[2]:       _redirects: [],
          2022-06-08 10:19:21.229  - error: host.pfitiob01 Caught by controller[2]:       _requestBodyLength: 273,
          2022-06-08 10:19:21.229  - error: host.pfitiob01 Caught by controller[2]:       _requestBodyBuffers: [],
          2022-06-08 10:19:21.229  - error: host.pfitiob01 Caught by controller[2]:       _onNativeResponse: [Function (anonymous)],
          2022-06-08 10:19:21.229  - error: host.pfitiob01 Caught by controller[2]:       _currentRequest: [Circular *1],
          2022-06-08 10:19:21.230  - error: host.pfitiob01 Caught by controller[2]:       _currentUrl: 'https://fcm.googleapis.com/v1/projects/smarthome-568ee/messages:send',
          2022-06-08 10:19:21.230  - error: host.pfitiob01 Caught by controller[2]:       [Symbol(kCapture)]: false
          2022-06-08 10:19:21.230  - error: host.pfitiob01 Caught by controller[2]:     },
          2022-06-08 10:19:21.230  - error: host.pfitiob01 Caught by controller[2]:     [Symbol(kCapture)]: false,
          2022-06-08 10:19:21.230  - error: host.pfitiob01 Caught by controller[2]:     [Symbol(kNeedDrain)]: false,
          2022-06-08 10:19:21.230  - error: host.pfitiob01 Caught by controller[2]:     [Symbol(corked)]: 0,
          2022-06-08 10:19:21.230  - error: host.pfitiob01 Caught by controller[2]:     [Symbol(kOutHeaders)]: [Object: null prototype] {
          2022-06-08 10:19:21.231  - error: host.pfitiob01 Caught by controller[2]:       accept: [Array],
          2022-06-08 10:19:21.231  - error: host.pfitiob01 Caught by controller[2]:       'content-type': [Array],
          2022-06-08 10:19:21.231  - error: host.pfitiob01 Caught by controller[2]:       'user-agent': [Array],
          2022-06-08 10:19:21.231  - error: host.pfitiob01 Caught by controller[2]:       'content-length': [Array],
          2022-06-08 10:19:21.231  - error: host.pfitiob01 Caught by controller[2]:       host: [Array]
          2022-06-08 10:19:21.231  - error: host.pfitiob01 Caught by controller[2]:     }
          2022-06-08 10:19:21.232  - error: host.pfitiob01 Caught by controller[2]:   },
          2022-06-08 10:19:21.232  - error: host.pfitiob01 Caught by controller[2]:   response: {
          2022-06-08 10:19:21.232  - error: host.pfitiob01 Caught by controller[2]:     status: 401,
          2022-06-08 10:19:21.232  - error: host.pfitiob01 Caught by controller[2]:     statusText: 'Unauthorized',
          2022-06-08 10:19:21.232  - error: host.pfitiob01 Caught by controller[2]:     headers: {
          2022-06-08 10:19:21.232  - error: host.pfitiob01 Caught by controller[2]:       'www-authenticate': 'Bearer realm="https://accounts.google.com/"',
          2022-06-08 10:19:21.232  - error: host.pfitiob01 Caught by controller[2]:       vary: 'X-Origin, Referer, Origin,Accept-Encoding',
          2022-06-08 10:19:21.232  - error: host.pfitiob01 Caught by controller[2]:       'content-type': 'application/json; charset=UTF-8',
          2022-06-08 10:19:21.233  - error: host.pfitiob01 Caught by controller[2]:       date: 'Wed, 08 Jun 2022 08:19:20 GMT',
          2022-06-08 10:19:21.233  - error: host.pfitiob01 Caught by controller[2]:       server: 'scaffolding on HTTPServer2',
          2022-06-08 10:19:21.233  - error: host.pfitiob01 Caught by controller[2]:       'cache-control': 'private',
          2022-06-08 10:19:21.233  - error: host.pfitiob01 Caught by controller[2]:       'x-xss-protection': '0',
          2022-06-08 10:19:21.233  - error: host.pfitiob01 Caught by controller[2]:       'x-frame-options': 'SAMEORIGIN',
          2022-06-08 10:19:21.233  - error: host.pfitiob01 Caught by controller[2]:       'x-content-type-options': 'nosniff',
          2022-06-08 10:19:21.233  - error: host.pfitiob01 Caught by controller[2]:       'alt-svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"',
          2022-06-08 10:19:21.234  - error: host.pfitiob01 Caught by controller[2]:       'accept-ranges': 'none',
          2022-06-08 10:19:21.234  - error: host.pfitiob01 Caught by controller[2]:       connection: 'close',
          2022-06-08 10:19:21.234  - error: host.pfitiob01 Caught by controller[2]:       'transfer-encoding': 'chunked'
          2022-06-08 10:19:21.234  - error: host.pfitiob01 Caught by controller[2]:     },
          2022-06-08 10:19:21.234  - error: host.pfitiob01 Caught by controller[2]:     config: {
          2022-06-08 10:19:21.234  - error: host.pfitiob01 Caught by controller[2]:       transitional: [Object],
          2022-06-08 10:19:21.234  - error: host.pfitiob01 Caught by controller[2]:       adapter: [Function: httpAdapter],
          2022-06-08 10:19:21.235  - error: host.pfitiob01 Caught by controller[2]:       transformRequest: [Array],
          2022-06-08 10:19:21.235  - error: host.pfitiob01 Caught by controller[2]:       transformResponse: [Array],
          2022-06-08 10:19:21.235  - error: host.pfitiob01 Caught by controller[2]:       timeout: 0,
          2022-06-08 10:19:21.235  - error: host.pfitiob01 Caught by controller[2]:       xsrfCookieName: 'XSRF-TOKEN',
          2022-06-08 10:19:21.235  - error: host.pfitiob01 Caught by controller[2]:       xsrfHeaderName: 'X-XSRF-TOKEN',
          2022-06-08 10:19:21.235  - error: host.pfitiob01 Caught by controller[2]:       maxContentLength: -1,
          2022-06-08 10:19:21.235  - error: host.pfitiob01 Caught by controller[2]:       maxBodyLength: -1,
          2022-06-08 10:19:21.235  - error: host.pfitiob01 Caught by controller[2]:       env: [Object],
          2022-06-08 10:19:21.236  - error: host.pfitiob01 Caught by controller[2]:       validateStatus: [Function: validateStatus],
          2022-06-08 10:19:21.236  - error: host.pfitiob01 Caught by controller[2]:       headers: [Object],
          2022-06-08 10:19:21.236  - error: host.pfitiob01 Caught by controller[2]:       httpsAgent: [Agent],
          2022-06-08 10:19:21.236  - error: host.pfitiob01 Caught by controller[2]:       method: 'post',
          2022-06-08 10:19:21.236  - error: host.pfitiob01 Caught by controller[2]:       url: 'https://fcm.googleapis.com/v1/projects/smarthome-568ee/messages:send',
          2022-06-08 10:19:21.236  - error: host.pfitiob01 Caught by controller[2]:       data: '{"message":{"topic":"httppfitiob01hqpfitconsultde8084","notification":{"title":"Alarmanlage","body":"Alarmanlage aktiviert -> OFFENE Fenster/Türen:<br>EG/Stephan-Ben<br>EG/Alex-Tom<br>EG/WC-Herren<br>Keller/Serverraum 2<br>Keller/Getränkekeller<br>Keller/Serverraum 2"}}}'
          2022-06-08 10:19:21.236  - error: host.pfitiob01 Caught by controller[2]:     },
          2022-06-08 10:19:21.237  - error: host.pfitiob01 Caught by controller[2]:     request: <ref *1> ClientRequest {
          2022-06-08 10:19:21.237  - error: host.pfitiob01 Caught by controller[2]:       _events: [Object: null prototype],
          2022-06-08 10:19:21.237  - error: host.pfitiob01 Caught by controller[2]:       _eventsCount: 7,
          2022-06-08 10:19:21.237  - error: host.pfitiob01 Caught by controller[2]:       _maxListeners: 100,
          2022-06-08 10:19:21.237  - error: host.pfitiob01 Caught by controller[2]:       outputData: [],
          2022-06-08 10:19:21.237  - error: host.pfitiob01 Caught by controller[2]:       outputSize: 0,
          2022-06-08 10:19:21.237  - error: host.pfitiob01 Caught by controller[2]:       writable: true,
          2022-06-08 10:19:21.238  - error: host.pfitiob01 Caught by controller[2]:       destroyed: false,
          2022-06-08 10:19:21.238  - error: host.pfitiob01 Caught by controller[2]:       _last: true,
          2022-06-08 10:19:21.238  - error: host.pfitiob01 Caught by controller[2]:       chunkedEncoding: false,
          2022-06-08 10:19:21.238  - error: host.pfitiob01 Caught by controller[2]:       shouldKeepAlive: false,
          2022-06-08 10:19:21.238  - error: host.pfitiob01 Caught by controller[2]:       _defaultKeepAlive: true,
          2022-06-08 10:19:21.238  - error: host.pfitiob01 Caught by controller[2]:       useChunkedEncodingByDefault: true,
          2022-06-08 10:19:21.238  - error: host.pfitiob01 Caught by controller[2]:       sendDate: false,
          2022-06-08 10:19:21.238  - error: host.pfitiob01 Caught by controller[2]:       _removedConnection: false,
          2022-06-08 10:19:21.239  - error: host.pfitiob01 Caught by controller[2]:       _removedContLen: false,
          2022-06-08 10:19:21.239  - error: host.pfitiob01 Caught by controller[2]:       _removedTE: false,
          2022-06-08 10:19:21.239  - error: host.pfitiob01 Caught by controller[2]:       _contentLength: null,
          2022-06-08 10:19:21.239  - error: host.pfitiob01 Caught by controller[2]:       _hasBody: true,
          2022-06-08 10:19:21.239  - error: host.pfitiob01 Caught by controller[2]:       _trailer: '',
          2022-06-08 10:19:21.239  - error: host.pfitiob01 Caught by controller[2]:       finished: true,
          2022-06-08 10:19:21.239  - error: host.pfitiob01 Caught by controller[2]:       _headerSent: true,
          2022-06-08 10:19:21.242  - error: host.pfitiob01 Caught by controller[2]:       socket: [TLSSocket],
          2022-06-08 10:19:21.242  - error: host.pfitiob01 Caught by controller[2]:       _header: 'POST /v1/projects/smarthome-568ee/messages:send HTTP/1.1\r\n' +
          2022-06-08 10:19:21.242  - error: host.pfitiob01 Caught by controller[2]:         'Accept: application/json, text/plain, */*\r\n' +
          2022-06-08 10:19:21.242  - error: host.pfitiob01 Caught by controller[2]:         'Content-Type: application/json\r\n' +
          2022-06-08 10:19:21.243  - error: host.pfitiob01 Caught by controller[2]:         'User-Agent: axios/0.27.2\r\n' +
          2022-06-08 10:19:21.243  - error: host.pfitiob01 Caught by controller[2]:         'Content-Length: 273\r\n' +
          2022-06-08 10:19:21.243  - error: host.pfitiob01 Caught by controller[2]:         'Host: fcm.googleapis.com\r\n' +
          2022-06-08 10:19:21.243  - error: host.pfitiob01 Caught by controller[2]:         'Connection: close\r\n' +
          2022-06-08 10:19:21.243  - error: host.pfitiob01 Caught by controller[2]:         '\r\n',
          2022-06-08 10:19:21.243  - error: host.pfitiob01 Caught by controller[2]:       _keepAliveTimeout: 0,
          2022-06-08 10:19:21.243  - error: host.pfitiob01 Caught by controller[2]:       _onPendingData: [Function: noopPendingOutput],
          2022-06-08 10:19:21.244  - error: host.pfitiob01 Caught by controller[2]:       agent: [Agent],
          2022-06-08 10:19:21.244  - error: host.pfitiob01 Caught by controller[2]:       socketPath: undefined,
          2022-06-08 10:19:21.244  - error: host.pfitiob01 Caught by controller[2]:       method: 'POST',
          2022-06-08 10:19:21.244  - error: host.pfitiob01 Caught by controller[2]:       maxHeaderSize: undefined,
          2022-06-08 10:19:21.244  - error: host.pfitiob01 Caught by controller[2]:       insecureHTTPParser: undefined,
          2022-06-08 10:19:21.244  - error: host.pfitiob01 Caught by controller[2]:       path: '/v1/projects/smarthome-568ee/messages:send',
          2022-06-08 10:19:21.244  - error: host.pfitiob01 Caught by controller[2]:       _ended: true,
          2022-06-08 10:19:21.245  - error: host.pfitiob01 Caught by controller[2]:       res: [IncomingMessage],
          2022-06-08 10:19:21.245  - error: host.pfitiob01 Caught by controller[2]:       aborted: false,
          2022-06-08 10:19:21.245  - error: host.pfitiob01 Caught by controller[2]:       timeoutCb: null,
          2022-06-08 10:19:21.245  - error: host.pfitiob01 Caught by controller[2]:       upgradeOrConnect: false,
          2022-06-08 10:19:21.245  - error: host.pfitiob01 Caught by controller[2]:       parser: null,
          2022-06-08 10:19:21.245  - error: host.pfitiob01 Caught by controller[2]:       maxHeadersCount: null,
          2022-06-08 10:19:21.245  - error: host.pfitiob01 Caught by controller[2]:       reusedSocket: false,
          2022-06-08 10:19:21.246  - error: host.pfitiob01 Caught by controller[2]:       host: 'fcm.googleapis.com',
          2022-06-08 10:19:21.246  - error: host.pfitiob01 Caught by controller[2]:       protocol: 'https:',
          2022-06-08 10:19:21.246  - error: host.pfitiob01 Caught by controller[2]:       _redirectable: [Writable],
          2022-06-08 10:19:21.246  - error: host.pfitiob01 Caught by controller[2]:       [Symbol(kCapture)]: false,
          2022-06-08 10:19:21.246  - error: host.pfitiob01 Caught by controller[2]:       [Symbol(kNeedDrain)]: false,
          2022-06-08 10:19:21.246  - error: host.pfitiob01 Caught by controller[2]:       [Symbol(corked)]: 0,
          2022-06-08 10:19:21.246  - error: host.pfitiob01 Caught by controller[2]:       [Symbol(kOutHeaders)]: [Object: null prototype]
          2022-06-08 10:19:21.246  - error: host.pfitiob01 Caught by controller[2]:     },
          2022-06-08 10:19:21.246  - error: host.pfitiob01 Caught by controller[2]:     data: { error: [Object] }
          2022-06-08 10:19:21.247  - error: host.pfitiob01 Caught by controller[2]:   }
          2022-06-08 10:19:21.247  - error: host.pfitiob01 Caught by controller[2]: }
          2022-06-08 10:19:21.247  - error: host.pfitiob01 instance system.adapter.javascript.0 terminated with code 6 (UNCAUGHT_EXCEPTION)
          2022-06-08 10:19:21.247  - info: host.pfitiob01 Restart adapter system.adapter.javascript.0 because enabled
          

          Mich wundert halt das auch:
          2022-06-08 10:19:21.232 - error: host.pfitiob01 Caught by controller[2]: response: {
          2022-06-08 10:19:21.232 - error: host.pfitiob01 Caught by controller[2]: status: 401,
          2022-06-08 10:19:21.232 - error: host.pfitiob01 Caught by controller[2]: statusText: 'Unauthorized',
          2022-06-08 10:19:21.232 - error: host.pfitiob01 Caught by controller[2]: headers: {

          Jedoch hat er einen Token, welcher auch funktioniert

          1 Reply Last reply Reply Quote 0
          • ?
            A Former User last edited by

            habe soeben einfach mal "request" genommen für den Call:

            var request = require('request');
            
            
            var body = {
                    "message": {
            		"topic": "topic",
            		"notification": {
            			    "title": 'test',
            			    "body": 'test'
            		    }
            	    }
                }
            request({
                url: "https://fcm.googleapis.com/v1/projects/project/messages:send",
                method: "POST",
                json: true,
                body: body,
                headers: {
                        'Content-Type': 'application/json',
                        'Authorization': 'token'
                    },
            }, function (error, response, body){
                console.log(response);
            });
            

            Hat ohne Probleme funktioniert..

            arteck 1 Reply Last reply Reply Quote 0
            • arteck
              arteck Developer Most Active @Guest last edited by arteck

              @tmartin dann hast du ein axios problem..wenn request geht ..würde ich mal behaupten..
              hast den in javascript adapter einstelungen definiert ?

              ? 1 Reply Last reply Reply Quote 0
              • ?
                A Former User @arteck last edited by

                @arteck

                Yep, unter zusätzliche Module.

                Hmm, dann steige ich mal um auf request, da habe ich auch kein Problem mit der TLS_Warnung.

                arteck 1 Reply Last reply Reply Quote 0
                • arteck
                  arteck Developer Most Active @Guest last edited by

                  @tmartin request ist veraltert sollte man nicht mehr nutzen...mal so neben bei..

                  ? 1 Reply Last reply Reply Quote 0
                  • ?
                    A Former User @arteck last edited by

                    @arteck ja stimmt auch wieder...hmm dann setz ich mich mal weiter an dem axios Problem.

                    arteck 1 Reply Last reply Reply Quote 0
                    • arteck
                      arteck Developer Most Active @Guest last edited by

                      @tmartin komisch ich nutze auch mehrere aufrufe.. keine probleme

                      ? 1 Reply Last reply Reply Quote 0
                      • ?
                        A Former User @arteck last edited by

                        @arteck Und dein Aufbau ist vermutlich relativ gleich wie meiner oder?

                        arteck 1 Reply Last reply Reply Quote 0
                        • arteck
                          arteck Developer Most Active @Guest last edited by

                          @tmartin ich hab keine token autorisierung drin..

                          1 Reply Last reply Reply Quote 0
                          • ?
                            A Former User last edited by

                            Okay hab den Code jetzt ein bisschen angepasst:

                            //Push-Benachrichtigung bei Alarmierung
                            const sendPush = (title, message) => {
                                const options = {
                                    method: 'POST',
                                    url: 'https://fcm.googleapis.com/v1/projects/project/messages:send',
                                    headers: {
                                        'Content-Type': 'application/json',
                                        Authorization: getState(APITOKEN).val.toString()  },
                                    data: {
                                        message: {
                                            topic: 'topic',
                                            notification: {title: title, body: message}
                                        }
                                    }
                                };
                                axios.request(options).catch(error => {
                                    console.error(error);
                                });
                            };
                            

                            So funktioniert es wieder. Warum auch immer der andere weg über axios.post etc. nicht gehen will.

                            1 Reply Last reply Reply Quote 1
                            • First post
                              Last post

                            Support us

                            ioBroker
                            Community Adapters
                            Donate

                            927
                            Online

                            31.9k
                            Users

                            80.1k
                            Topics

                            1.3m
                            Posts

                            javascript
                            2
                            13
                            220
                            Loading More Posts
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes
                            Reply
                            • Reply as topic
                            Log in to reply
                            Community
                            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                            The ioBroker Community 2014-2023
                            logo