@cryptotaxi247 / netdata-1 / commits / 0fb5727e1

log stream_info payload when it cannot be parsed (#19424)

* log stream_info payload when it cannot be parsed * log incorrect status information in stream info parsing

Costa Tsaousis committed Jan 17, 2025 at 10:15 UTC 0fb5727e118c13381cfcddfd59749df03df8f681
1 file changed +7 -2
src/streaming/stream-parents.c
+7 -2
@@ -342,12 +342,15 @@ static bool stream_info_json_parse_v1(struct json_object *jobj, const char *path
342 return true;
343 }
344
345 + buffer_sprintf(error, "status reported (%d) is not OK (%d)", d->remote.status, HTTP_RESP_OK);
346 +
347 d->remote.db_first_time_s = 0;
348 d->remote.db_last_time_s = 0;
349 d->remote.db_status = 0;
350 d->remote.db_liveness = 0;
351 d->remote.ingest_type = 0;
352 d->remote.ingest_status = 0;
353 +
354 return false;
355 }
356
@@ -495,9 +498,11 @@ static bool stream_info_fetch(STREAM_PARENT *d, const char *uuid, int default_po
498 d->selection.info = false;
499 d->reason = STREAM_HANDSHAKE_NO_STREAM_INFO;
500 nd_log(NDLS_DAEMON, NDLP_WARNING,
498 - "STREAM PARENTS '%s': failed to extract fields from JSON stream info response from '%s': %s",
501 + "STREAM PARENTS '%s': failed to extract fields from JSON stream info response from '%s': %s"
502 + " - JSON data: %s",
503 hostname, string2str(d->destination),
500 - buffer_tostring(error));
504 + buffer_tostring(error),
505 + payload_start);
506 return false;
507 }
508