Run Puppeteer docker locally (actor-node-puppeteer-chrome)

I am trying to run&debug my crawler locally, but keep getting following error:
Starting X virtual framebuffer using: Xvfb :99 -ac -screen 0 1280x720x16 -nolisten tcp
2022-11-17T12:30:00.521459905Z Executing main command
2022-11-17T12:30:01.435704710Z INFO System info {"apifyVersion":"3.1.0","apifyClientVersion":"2.6.1","osType":"Linux","nodeVersion":"v18.7.0"}
2022-11-17T12:30:01.441091105Z INFO asdfasdfasdf
2022-11-17T12:30:01.765972208Z INFO PuppeteerCrawler: Starting the crawl
2022-11-17T12:30:02.002157773Z WARN PuppeteerCrawler: Reclaiming failed request back to the list or queue. Failed to launch the browser process!
2022-11-17T12:30:02.002214809Z Failed to move to new namespace: PID namespaces supported, Network namespace supported, but failed: errno = Operation not permitted
2022-11-17T12:30:02.002222677Z [1117/123001.852772:ERROR:file_io_posix.cc(144)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)
2022-11-17T12:30:02.002225607Z [1117/123001.852956:ERROR:file_io_posix.cc(144)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)
Starting X virtual framebuffer using: Xvfb :99 -ac -screen 0 1280x720x16 -nolisten tcp
2022-11-17T12:30:00.521459905Z Executing main command
2022-11-17T12:30:01.435704710Z INFO System info {"apifyVersion":"3.1.0","apifyClientVersion":"2.6.1","osType":"Linux","nodeVersion":"v18.7.0"}
2022-11-17T12:30:01.441091105Z INFO asdfasdfasdf
2022-11-17T12:30:01.765972208Z INFO PuppeteerCrawler: Starting the crawl
2022-11-17T12:30:02.002157773Z WARN PuppeteerCrawler: Reclaiming failed request back to the list or queue. Failed to launch the browser process!
2022-11-17T12:30:02.002214809Z Failed to move to new namespace: PID namespaces supported, Network namespace supported, but failed: errno = Operation not permitted
2022-11-17T12:30:02.002222677Z [1117/123001.852772:ERROR:file_io_posix.cc(144)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)
2022-11-17T12:30:02.002225607Z [1117/123001.852956:ERROR:file_io_posix.cc(144)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)
My dockerfile:
FROM apify/actor-node-puppeteer-chrome:18

COPY --chown=myuser package*.json ./

RUN npm --quiet set progress=false \
&& npm install --omit=dev --omit=optional \
&& echo "Installed NPM packages:" \
&& (npm list --omit=dev --all || true) \
&& echo "Node.js version:" \
&& node --version \
&& echo "NPM version:" \
&& npm --version \
&& rm -r ~/.npm

COPY --chown=myuser . ./

CMD ./start_xvfb_and_run_cmd.sh && npm start --silent
FROM apify/actor-node-puppeteer-chrome:18

COPY --chown=myuser package*.json ./

RUN npm --quiet set progress=false \
&& npm install --omit=dev --omit=optional \
&& echo "Installed NPM packages:" \
&& (npm list --omit=dev --all || true) \
&& echo "Node.js version:" \
&& node --version \
&& echo "NPM version:" \
&& npm --version \
&& rm -r ~/.npm

COPY --chown=myuser . ./

CMD ./start_xvfb_and_run_cmd.sh && npm start --silent
Thanks for any help!
2 Replies
genetic-orange
genetic-orange3y ago
Some compatibility issue with your OS or environment, Dockerfile supposed to be used in Apify cloud, not expected to run locally. On your own computer just use Apify CLI
optimistic-gold
optimistic-gold3y ago
There are multiple people having different issues with running in their system with Docker, check issues https://github.com/apify/crawlee/issues/1685
GitHub
Docker image not working · Issue #1685 · apify/crawlee
Which package is this bug report for? If unsure which one to select, leave blank @crawlee/playwright (PlaywrightCrawler) Issue description npx crawlee create my-crawler docker build docker push Run...

Did you find this page helpful?