Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.
This repository was archived by the owner on Jan 13, 2024. It is now read-only.

pkg fails with EACCESS '/lost+found' #528

@mkg20001

Description

@mkg20001

While pkg'ing https://github.com/ipfs/aegir I came accross this error:

> [debug] Directory %1 is added to queue
  /mnt/stuffs/aegir3/node_modules/conventional-changelog-writer/templates
> [debug] Directory %1 is added to queue
  /mnt/stuffs/aegir3/node_modules/conventional-changelog-writer/templates
> [debug] Directory %1 is added to queue
  /mnt/stuffs/aegir3/node_modules/conventional-commits-filter
> [debug] Stat info of %1 is added to queue
  /mnt/stuffs/aegir3/node_modules/conventional-commits-filter/index.js
> [debug] Stat info of %1 is added to queue
  /mnt/stuffs/aegir3/node_modules/is-subset/package.json
> Error! Error: EACCES: permission denied, scandir '/lost+found'
    at Object.readdirSync (fs.js:764:3)
    at exports.readdir (/usr/lib/node_modules/pkg/node_modules/@mrmlnc/readdir-enhanced/lib/sync/fs.js:18:20)
    at Object.safeCall [as safe] (/usr/lib/node_modules/pkg/node_modules/@mrmlnc/readdir-enhanced/lib/call.js:24:8)
    at DirectoryReader.readNextDirectory (/usr/lib/node_modules/pkg/node_modules/@mrmlnc/readdir-enhanced/lib/directory-reader.js:78:10)
    at Readable.DirectoryReader.stream._read (/usr/lib/node_modules/pkg/node_modules/@mrmlnc/readdir-enhanced/lib/directory-reader.js:57:18)
    at Readable.read (_stream_readable.js:452:10)
    at readdirSync (/usr/lib/node_modules/pkg/node_modules/@mrmlnc/readdir-enhanced/lib/sync/index.js:27:21)
    at Function.readdirSyncStat (/usr/lib/node_modules/pkg/node_modules/@mrmlnc/readdir-enhanced/lib/index.js:34:10)
    at ReaderSync.dynamicApi (/usr/lib/node_modules/pkg/node_modules/fast-glob/out/providers/reader-sync.js:61:24)
    at ReaderSync.api (/usr/lib/node_modules/pkg/node_modules/fast-glob/out/providers/reader-sync.js:53:25)

(pkg cmd: pkg -o aegir -t host -d ., ubuntu 18.04 amd64 pkg v4.3.4)

The reason is the is-subset module and it's files field which contains absolute glob paths:

  "files": [
    "/*.js",
    "/module/",
    "/test/",
    "/Readme.md",
    "/License.md"
  ],

The scan causes /* to be scanned which among other things includes /lost+found

Fix would be to make all absolute paths relative (after manually removing the / it begins to work)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions