Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: EACCES: permission denied, scandir '/home/testuser/myapp/docker/data/db' #5403

Closed
masterbater opened this issue May 2, 2022 · 6 comments
Assignees

Comments

@masterbater
Copy link

Hello is there anyway we could exclude a folder from scandir, I mounted some files to my container in readonly mode and I got this error message when running yarn rw g types
`
Generating...

node:fs:1392
handleErrorFromBinding(ctx);
^

Error: EACCES: permission denied, scandir '/home/jasonzach/modernsmarthealth/docker/data/db'
at Object.readdirSync (node:fs:1392:3)
at readdirWithFileTypes (/home/jasonzach/modernsmarthealth/node_modules/@nodelib/fs.scandir/out/providers/sync.js:16:33)
at Object.read (/home/jasonzach/modernsmarthealth/node_modules/@nodelib/fs.scandir/out/providers/sync.js:10:16)
at SyncReader.scandirSync [as _scandir] (/home/jasonzach/modernsmarthealth/node_modules/@nodelib/fs.scandir/out/index.js:18:17)
at SyncReader._handleDirectory (/home/jasonzach/modernsmarthealth/node_modules/@nodelib/fs.walk/out/readers/sync.js:28:34)
at SyncReader._handleQueue (/home/jasonzach/modernsmarthealth/node_modules/@nodelib/fs.walk/out/readers/sync.js:23:18)
at SyncReader.read (/home/jasonzach/modernsmarthealth/node_modules/@nodelib/fs.walk/out/readers/sync.js:15:14)
at SyncProvider.read (/home/jasonzach/modernsmarthealth/node_modules/@nodelib/fs.walk/out/providers/sync.js:11:29)
at ReaderSync.walkSync [as _walkSync] (/home/jasonzach/modernsmarthealth/node_modules/@nodelib/fs.walk/out/index.js:20:21)
at ReaderSync.dynamic (/home/jasonzach/modernsmarthealth/node_modules/fast-glob/out/readers/sync.js:13:21) {
errno: -13,
syscall: 'scandir',
code: 'EACCES',
path: '/home/jasonzach/modernsmarthealth/docker/data/db'
}
rw generate types

Generate supplementary code

Options:
--help Show help [boolean]
--version Show version number [boolean]
--cwd Working directory to use (where redwood.toml is located.)

Error: Command failed with exit code 1: yarn rw-gen
at makeError (/home/jasonzach/modernsmarthealth/node_modules/execa/lib/error.js:60:11)
at Function.module.exports.sync (/home/jasonzach/modernsmarthealth/node_modules/execa/index.js:194:17)
at Object.handler (/home/jasonzach/modernsmarthealth/node_modules/@redwoodjs/cli/dist/commands/generate.js:27:18)
at /home/jasonzach/modernsmarthealth/node_modules/yargs/build/index.cjs:443:71
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
shortMessage: 'Command failed with exit code 1: yarn rw-gen',
command: 'yarn rw-gen',
escapedCommand: '"yarn rw-gen"',
exitCode: 1,
signal: undefined,
signalDescription: undefined,
stdout: undefined,
stderr: undefined,
failed: true,
timedOut: false,
isCanceled: false,
killed: false
}`

@jtoar jtoar moved this to Needs triage in Triage May 2, 2022
@jtoar jtoar added this to Triage May 2, 2022
@dac09 dac09 assigned dac09 and unassigned callingmedic911 May 2, 2022
@dac09
Copy link
Contributor

dac09 commented May 2, 2022

Hello @masterbater (nice username) - Redwood generates and writes types for you when you run either the dev server, or yarn rw g types into a few places.

You'll need to give write access to the following directories:

  • .redwood (and all sub directories)
  • ./web/types
  • ./api/types
  • node_modules (prisma generates the client here)

That should get rid of the access error! Let us know if this helps :)

@masterbater
Copy link
Author

masterbater commented May 2, 2022 via email

@dac09
Copy link
Contributor

dac09 commented May 3, 2022

Yeah - because yarn rw g actually generates files to write to the FS, makes sense that readonly mode would throw an error.

Ok to close out the issue?

@masterbater
Copy link
Author

masterbater commented May 3, 2022 via email

@dac09 dac09 closed this as completed May 4, 2022
Repository owner moved this from Needs triage to Done in Triage May 4, 2022
@YesYouKenSpace
Copy link

YesYouKenSpace commented Dec 5, 2022

Feels like this was closed in a hasty manner. I think this is a flaw where there should be folder redwoodjs should be allowed to ignore.

@Tobbe
Copy link
Member

Tobbe commented Jun 28, 2023

@kennethtxytqw If you're still interested in this more discussion is happening in #7761 and you're more than welcome to join in 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

No branches or pull requests

5 participants