[BUG] Error: EBUSY: resource busy or locked when using volumes in docker-compose with playwright 1.19.0 and mcr.microsoft.com/playwright:v1.15.0-focal
See original GitHub issueContext:
- Playwright Version: 1.19.0
- Operating System: Linux in Docker
- Node.js version: v16.13.2
- Browser: Chromium
- Extra: using volumes in docker-compose
- The issue was not there with versions:
- 1.16.3 for playwright
- mcr.microsoft.com/playwright:v1.10.0-focal
Code Snippet
Dockerfile
:
FROM mcr.microsoft.com/playwright:v1.15.0-focal
RUN mkdir /app
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY package.json package-lock.json /app/
RUN npm install && npx playwright install
COPY . /app/
in docker-compose.yml
:
version: '3'
services:
app:
build: .
command: 'bash'
tty: true
volumes:
- /tmp/e2e-output:/tmp/e2e-output
in playwright.config.ts
:
import { PlaywrightTestConfig } from '@playwright/test'
const config: PlaywrightTestConfig = {
testDir: 'e2e',
workers: 3,
outputDir: '/tmp/e2e-output',
use: {
headless: false,
screenshot: 'only-on-failure',
},
reporter: [['json'], ['list']],
}
export default config
in package.json
:
...
"scripts": {
"boot": "playwright install",
"test": "dotenv-flow -- playwright test",
"browser": "dotenv-flow -- playwright test --headed",
"format": "eslint --cache --cache-strategy content --fix ."
},
...
Describe the bug
After building the docker image and run with npm run test
inside of docker container,
got this error:
Error: EBUSY: resource busy or locked, rmdir '/app/test-results'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mapx-e2e@0.1.0 test: `dotenv-flow -- playwright test "report"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mapx-e2e@0.1.0 test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-02-15T05_02_32_297Z-debug.log
and inside of log, there is nothing useful
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
EBUSY: resource busy or locked in Docker when trying to do ...
The solution that worked for me was: Persist the node_modules volume and bind the entire directory; Clear the cache; Install through docker.
Read more >playwright Changelog - pyup.io
... [BUG] Error: EBUSY: resource busy or locked when using volumes in docker-compose with playwright 1.19.0 and mcr.microsoft.com/playwright:v1.15.0-focal
Read more >playwright 1.19.2 on Node.js NPM - NewReleases.io
... [BUG] Error: EBUSY: resource busy or locked when using volumes in docker-compose with playwright 1.19.0 and mcr.microsoft.com/playwright:v1.15.0-focal ...
Read more >Error: Ebusy: Resource Busy Or Locked Rmdir 'Path' - ADocLib
Error : EBUSY: resource busy or locked when using volumes in dockercompose with playwright 1.19.0 and mcr.microsoft.com/playwright:v1.15.0focal.
Read more >playwright: Versions - Openbase
... [BUG] Error: EBUSY: resource busy or locked when using volumes in docker-compose with playwright 1.19.0 and mcr.microsoft.com/playwright:v1.15.0-focal ...
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 Free
Top 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
You can get around this issue pretty easily by defining outputDir in playwright.config to something like
reports/test-results
and then simply mounting the reports dir as a volume.Yep I can repro. Turns out before 1.19 the
test-results
folder never actually was removed, so old results were piling in.As of 2b55adaafa, we consider failure to clean up test results folder a fatal error. Let me see what we can do here.