Compress may cause Error: EPERM: operation not permitted open 'xxx\xxxx\xxxxx\myfile'. It`s ok with the option of compress is false.
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript, node.js
- 領域
- backend
調査の方向性
報告された stack trace を手がかりに、lib/RollingFileWriteStream.js の _shouldRoll、_moveOldFiles、_renewWriteStream を中心に調査を始めてください。提供された index.js、compress: true、開いた状態の myfile を使って Windows で再現します。ファイルのローテーション中に繰り返し実行しても EPERM が発生しなくなれば完了です。
索引モデルが issue の本文から書いたものです。
説明
This issue is discovered from "log4js-node", The latest version of "log4js-node" has the same issue because of this dependency.
replicate step:
- Download source code of this project.
- Create a 'index.js' file in root of this project.
- Input content in 'index.js' file:
var rollers = require('./lib/index');
var stream = new rollers.RollingFileStream('myfile', 10000, 12, {
compress: true,
});
for (let i = 0; i < 30; i++) {
// console.log(i);
stream.write(getContent());
}
stream.end();
function getContent() {
return `
{
a: {a: 1, b: 2, c: 3, d: 4, e: 5, f: 123321, g: 234432432, h: 31321, i: 23232, j: 23432423432432, k: 1123321},
b: {a: 1, b: 2, c: 3, d: 4, e: 5, f: 123321, g: 234432432, h: 31321, i: 23232, j: 23432423432432, k: 1123321},
c: {a: 1, b: 2, c: 3, d: 4, e: 5, f: 123321, g: 234432432, h: 31321, i: 23232, j: 23432423432432, k: 1123321},
......... // 70000 lines repeated
}`
}
- Execute
node index.jsin terminal. - Open the hot file "myfile" with notebook or VSCode as you like. This step is very important. The issue will not replicate without this step.
- Execute
node index.jsin terminal again. If no error occur, you can execute more times. The probability is very high, more than 50%.
Finally get this error in terminal:
Error: EPERM: operation not permitted, open 'D:\nodeProgram\TEST\test-streamroller\streamroller-master\myfile'
at Object.openSync (node:fs:596:3)
at Object.writeFileSync (node:fs:2322:35)
at Object.appendFileSync (node:fs:2384:6)
at RollingFileStream._renewWriteStream (D:\nodeProgram\TEST\test-streamroller\streamroller-master\lib\RollingFileWriteStream.js:312:8)
at RollingFileStream._moveOldFiles (D:\nodeProgram\TEST\test-streamroller\streamroller-master\lib\RollingFileWriteStream.js:232:10)
at async RollingFileStream._shouldRoll (D:\nodeProgram\TEST\test-streamroller\streamroller-master\lib\RollingFileWriteStream.js:170:7) {
errno: -4048,
syscall: 'open',
code: 'EPERM',
path: 'D:\nodeProgram\TEST\test-streamroller\streamroller-master\myfile'
}
- 主要言語
- JavaScript
- スター
- 38
- フォーク
- 20
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
log4js-node/streamroller のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
log4js-node/streamroller#176 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
log4js-node/streamroller#173 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 15/100
log4js-node/streamroller#171 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
log4js-node/streamroller#163 · コメント 3 件 ·
-
Rollover on startup オープンenhancement
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
log4js-node/streamroller#120 · リアクション 1 件 ·
log4js-node/streamroller の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
docToolchain/docToolchain#1705 ·
-
Timezone select lists one option per character; duplicate "Failed" reason; shared tracker popover id オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
nightscout/nocturne#1414 ·
-
bug v2
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
modelcontextprotocol/inspector#2458 · コメント 1 件 ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
carbon-design-system/ibm-products#9907 ·