{"record":{"id":"9f892ef2ec47cfef","repo":"denoland/deno","slug":"benchcontext-start-has-already-been-invoked","errorCode":null,"errorMessage":"BenchContext::start() has already been invoked","messagePattern":"BenchContext::start\\(\\) has already been invoked","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"cli/js/40_bench.js","lineNumber":432,"sourceCode":"    allSlice,\n    allLength,\n  );\n}\n\n/** @param desc {BenchDescription} */\nfunction createBenchContext(desc) {\n  return {\n    [SymbolToStringTag]: \"BenchContext\",\n    name: desc.name,\n    origin: desc.origin,\n    start() {\n      if (currentBenchId !== desc.id) {\n        throw new TypeError(\n          \"The benchmark which this context belongs to is not being executed\",\n        );\n      }\n      if (currentBenchUserExplicitStart != null) {\n        throw new TypeError(\n          \"BenchContext::start() has already been invoked\",\n        );\n      }\n      currentBenchUserExplicitStart = benchNow();\n    },\n    end() {\n      const end = benchNow();\n      if (currentBenchId !== desc.id) {\n        throw new TypeError(\n          \"The benchmark which this context belongs to is not being executed\",\n        );\n      }\n      if (currentBenchUserExplicitEnd != null) {\n        throw new TypeError(\"BenchContext::end() has already been invoked\");\n      }\n      currentBenchUserExplicitEnd = end;\n    },\n  };","sourceCodeStart":414,"sourceCodeEnd":450,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/cli/js/40_bench.js#L414-L450","documentation":"The HTTP download of the laufey archive completed (after retries) but the body decoded to zero bytes, so there is nothing to SHA-256 verify and the fetch is treated as a failed download of that URL.","triggerScenarios":"A proxy or SSL-inspecting gateway returning a 2xx with an empty body; a transient origin/mirror fault; a redirect chain ending in an empty response.","commonSituations":"Corporate proxies and TLS-inspection appliances; captive-portal or degraded VPN networks; mirror outages.","solutions":["Simply retry the command — empty 2xx bodies are usually transient","Bypass or fix the intercepting proxy for the laufey release host","Verify the URL with curl and confirm a non-empty payload and sane Content-Length","Clear the partial cache entry and re-run so a fresh download is attempted"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"const res = await fetch(url, { method: 'HEAD' });\nconst len = Number(res.headers.get('content-length'));\nif (res.ok && len === 0) throw new Error('mirror/proxy returned empty body — switch network or mirror');","typeGuard":null,"tryCatchPattern":"for (let i = 0; i < 3; i++) {\n  try { return await download(url); }\n  catch (e) {\n    if (!/empty response/.test(String(e))) throw e;\n    await sleep(1000 * (i + 1));\n  }\n}\nthrow new Error('empty response persisted after retries — check proxy/network');","preventionTips":["Bypass intercepting proxies for the laufey release host","Pre-download the archive once into the cache on a healthy network","Check Content-Length before trusting a 2xx from unfamiliar mirrors"],"tags":["network","download","desktop","laufey","proxy"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}