diff --git a/container/shim/src/fetchers/lassie.js b/container/shim/src/fetchers/lassie.js index f55461b7..3e928709 100644 --- a/container/shim/src/fetchers/lassie.js +++ b/container/shim/src/fetchers/lassie.js @@ -247,6 +247,8 @@ function getSemanticErrorStatus(status, body) { * @param {string} filename */ function sendBlockResponse(res, block, cidObj, filename) { + if (res.writableEnded) return; + res.status(200); res.set("content-length", Buffer.byteLength(block)); res.set("content-type", "application/vnd.ipld.raw"); diff --git a/container/shim/src/modules/log_ingestor.js b/container/shim/src/modules/log_ingestor.js index 773cefc2..e1949a45 100644 --- a/container/shim/src/modules/log_ingestor.js +++ b/container/shim/src/modules/log_ingestor.js @@ -206,7 +206,13 @@ async function executeLogIngestor() { if (!(await isFileAccessible(logFile))) continue; // stream the log file and parse the lines - const read = await readLines(logFile); + let read; + try { + read = await readLines(logFile); + } catch (err) { + if (err.code === "ENOENT") continue; + throw err; + } const logs = []; for (let i = 0; i < read.lines.length; i++) {