GitHub Actions Docker permission denied error running mix
See original GitHub issue- Laravel Mix Version: 6.0.42 (
npm list --depth=0
) - Node Version (
node -v
): v16.14.0 - NPM Version (
npm -v
): 8.3.1 - OS: Ubuntu 20.04 in Docker
Description:
When using Laravel Mix in GitHub Actions using a Docker image with PHP + Node inside, Laravel Mix gives a permission error:
Run npm run production
> production
> mix --production
[info] [webpackbar] Compiling Mix
node:internal/fs/utils:344
throw err;
^
Error: EACCES: permission denied, open '/__w/{SNIP}/{SNIP}/public/mix-manifest.json'
at Object.openSync (node:fs:585:3)
at Object.writeFileSync (node:fs:2155:35)
at File.write (/__w/{SNIP}/{SNIP}/node_modules/laravel-mix/src/File.js:211:12)
at Manifest.refresh (/__w/{SNIP}/{SNIP}/node_modules/laravel-mix/src/Manifest.js:86:50)
at /__w/{SNIP}/{SNIP}/node_modules/laravel-mix/src/webpackPlugins/ManifestPlugin.js:21:48
at Hook.eval [as callAsync] (eval at create (/__w/{SNIP}/{SNIP}/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:12:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/__w/{SNIP}/{SNIP}/node_modules/tapable/lib/Hook.js:18:14)
at Compiler.emitAssets (/__w/{SNIP}/{SNIP}/node_modules/webpack/lib/Compiler.js:871:19)
at /__w/{SNIP}/{SNIP}/node_modules/webpack/lib/Compiler.js:459:10
at processTicksAndRejections (node:internal/process/task_queues:78:11) {
errno: -13,
syscall: 'open',
code: 'EACCES',
path: '/__w/{SNIP}/{SNIP}/public/mix-manifest.json'
npm install
works fine and can write node_modules
fine.
Steps To Reproduce:
I’ve setup a public repository that shows off the problem, here is the workflow run showing the same error message:
https://github.com/Jamesking56/mix-permissions-error/runs/5351945168?check_suite_focus=true
Issue Analytics
- State:
- Created 2 years ago
- Comments:9
Top Results From Across the Web
Permissions error - after declaring USER and WORKDIR #740
I have this: FROM node:9 USER node WORKDIR /home/node/app COPY package.json . RUN npm install --loglevel=warn; and I get: Step 20/24 : RUN...
Read more >get permission denied when using docker in self-hosted server
HI all, I have an issue about using docker in self-hosted server. I have a runner installed on ubuntu 18.04. The runner is...
Read more >Permission denied after second run #1045 - GitHub
The error appears only after the second start. If you run the action only once (no matter with or without repository-name property) it...
Read more >Self-hosted runner with Docker step creates files that trip up ...
Describe the bug When using self-hosted runners, git checkouts are cached between runs (this is nice, because it greatly speeds up our ...
Read more >Permissions error when building actions container, no such ...
According to the log above the build works, but running the container fails (see the /usr/bin/docker run line and below). The “permission denied”...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry for my late reply. @trip-somers @thecrypticace @nklmilojevic
I’ve got a workaround working for this just by adding a step before
npm run production
:This is a hack at best, so this still needs fixing in some way. Not sure if its a mix bug or a GitHub actions bug if I’m honest as this bug doesn’t occur when using a shared runner.
Have you ever solved this problem? I don’t think it’s a mix issue, it’s a docker issue… Existing projects are all fine, but new ones don’t work. Has the docker permission policy changed to be more detailed?