{"record":{"id":"b35934aa17722bdd","repo":"louislam/uptime-kuma","slug":"failed-to-fetch-measurement-res-data-id-th","errorCode":null,"errorMessage":"Failed to fetch measurement (${res.data.id}): ${this.formatApiError(measurement.data.error)}","messagePattern":"Failed to fetch measurement \\((.+?)\\): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/monitor-types/globalping.js","lineNumber":109,"sourceCode":"        let res = await client.createMeasurement(opts);\n\n        // Retry if the server returns a 500 error\n        if (!res.ok && Globalping.isHttpStatus(500, res)) {\n            res = await client.createMeasurement(opts);\n        }\n\n        if (!res.ok) {\n            if (Globalping.isHttpStatus(429, res)) {\n                throw new Error(`Failed to create measurement: ${this.formatTooManyRequestsError(hasAPIToken)}`);\n            }\n            throw new Error(`Failed to create measurement: ${this.formatApiError(res.data.error)}`);\n        }\n\n        log.debug(\"monitor\", `Globalping fetch measurement: ${res.data.id}`);\n        let measurement = await client.awaitMeasurement(res.data.id);\n\n        if (!measurement.ok) {\n            throw new Error(\n                `Failed to fetch measurement (${res.data.id}): ${this.formatApiError(measurement.data.error)}`\n            );\n        }\n\n        const probe = measurement.data.results[0].probe;\n        const result = measurement.data.results[0].result;\n\n        if (result.status === \"failed\") {\n            throw new Error(this.formatResponse(probe, `Failed: ${result.rawOutput}`));\n        }\n\n        if (!result.timings?.length) {\n            throw new Error(this.formatResponse(probe, `Failed: ${result.rawOutput}`));\n        }\n\n        heartbeat.ping = result.stats.avg || 0;\n        heartbeat.msg = this.formatResponse(probe, \"OK\");\n        heartbeat.status = UP;","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/louislam/uptime-kuma/blob/6b5ea0155793e666666745fb8d6fef1e829543a2/server/monitor-types/globalping.js#L91-L127","documentation":"Thrown after createMeasurement succeeds but awaitMeasurement(id) returns non-ok. The measurement was accepted (res.data.id exists) yet polling for its completion failed, typically due to a Globalping server-side error, timeout on the awaiting loop, or the measurement id becoming inaccessible. The original id is embedded for correlation.","triggerScenarios":"Globalping accepts the create call and returns an id, then the polling endpoint returns an error status (5xx during probe execution, or a 404 if the id was purged). awaitMeasurement returns {ok:false} with data.error.","commonSituations":"Probe-side failure cascading into the status endpoint; Globalping platform incident mid-measurement; long-running measurements hitting the await timeout; account/credit state changing between create and poll.","solutions":["Inspect the embedded error (formatApiError output) for the specific failure.","Retry the monitor check; transient await failures usually clear on the next heartbeat.","If recurring, check status.globalping.io and reduce measurement complexity (fewer packets, simpler target).","Correlate the printed measurement id with Globalping dashboards if available."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await gp.monitor(client, monitor, heartbeat, hasToken);\n} catch (e) {\n  if (/Failed to fetch measurement/.test(e.message)) { heartbeat.status = PENDING; heartbeat.msg = e.message; return; }\n  throw e;\n}","preventionTips":["Treat awaitMeasurement failures as transient; let the next heartbeat retry.","Track the embedded measurement id in logs for Globalping-side correlation."],"tags":["globalping","api","measurement","transient","uptime-kuma"],"backgroundTag":null,"analyzedSha":"6b5ea0155793e666666745fb8d6fef1e829543a2","analyzedAt":"2026-08-12T23:42:12.959Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}