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

mac m1芯片运行amd64版本镜像报错,无法启动浏览器 #46

Open
zzzkl opened this issue Jun 8, 2023 · 10 comments
Open

mac m1芯片运行amd64版本镜像报错,无法启动浏览器 #46

zzzkl opened this issue Jun 8, 2023 · 10 comments

Comments

@zzzkl
Copy link

zzzkl commented Jun 8, 2023

[email protected] start
ts-node index.ts

Now listening: 127.0.0.1:3000
Error: Failed to launch the browser process! undefined
qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
[78:78:0608/011342.282710:ERROR:nacl_fork_delegate_linux.cc(313)] Bad NaCl helper startup ack (0 bytes)
qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
[47:128:0608/011342.422367:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[47:47:0608/011342.632939:ERROR:ozone_platform_x11.cc(239)] Missing X server or $DISPLAY
[47:47:0608/011342.633036:ERROR:env.cc(255)] The platform failed to initialize. Exiting.

TROUBLESHOOTING: https://pptr.dev/troubleshooting

at ChildProcess.onClose (/usr/src/app/node_modules/@puppeteer/browsers/src/launch.ts:398:11)
at ChildProcess.emit (node:events:525:35)
at ChildProcess.emit (node:domain:489:12)
at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)

Error: Failed to launch the browser process!
qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
[69:69:0608/011342.277389:ERROR:nacl_fork_delegate_linux.cc(313)] Bad NaCl helper startup ack (0 bytes)
qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
[44:126:0608/011342.418070:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[44:44:0608/011342.633099:ERROR:ozone_platform_x11.cc(239)] Missing X server or $DISPLAY
[44:44:0608/011342.633198:ERROR:env.cc(255)] The platform failed to initialize. Exiting.

TROUBLESHOOTING: https://pptr.dev/troubleshooting

at Interface.onClose (/usr/src/app/node_modules/@puppeteer/browsers/src/launch.ts:398:11)
at Interface.emit (node:events:525:35)
at Interface.emit (node:domain:489:12)
at Interface.close (node:internal/readline/interface:533:10)
at Socket.onend (node:internal/readline/interface:259:10)
at Socket.emit (node:events:525:35)
at Socket.emit (node:domain:489:12)
at endReadableNT (node:internal/streams/readable:1359:12)
at processTicksAndRejections (node:internal/process/task_queues:82:21)

Error: Failed to launch the browser process!
qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
[86:86:0608/011342.303118:ERROR:nacl_fork_delegate_linux.cc(313)] Bad NaCl helper startup ack (0 bytes)
qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
[50:136:0608/011342.442557:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[50:50:0608/011342.634191:ERROR:ozone_platform_x11.cc(239)] Missing X server or $DISPLAY
[50:50:0608/011342.634299:ERROR:env.cc(255)] The platform failed to initialize. Exiting.

TROUBLESHOOTING: https://pptr.dev/troubleshooting

at Interface.onClose (/usr/src/app/node_modules/@puppeteer/browsers/src/launch.ts:398:11)
at Interface.emit (node:events:525:35)
at Interface.emit (node:domain:489:12)
at Interface.close (node:internal/readline/interface:533:10)
at Socket.onend (node:internal/readline/interface:259:10)
at Socket.emit (node:events:525:35)
at Socket.emit (node:domain:489:12)
at endReadableNT (node:internal/streams/readable:1359:12)
at processTicksAndRejections (node:internal/process/task_queues:82:21)
@xiangsx
Copy link
Owner

xiangsx commented Jun 8, 2023

第一次启动就报这个错吗

@zzzkl
Copy link
Author

zzzkl commented Jun 8, 2023

是的

@xiangsx
Copy link
Owner

xiangsx commented Jun 8, 2023

https://github.com/puppeteer/puppeteer/issues

可以去这里找下,找到我也和我说一下 谢谢😊

@zzzkl
Copy link
Author

zzzkl commented Jun 8, 2023

看上去像是这个 puppeteer/puppeteer#9763

@xiangsx
Copy link
Owner

xiangsx commented Jun 8, 2023

看起来没有解决方案啊

@zzzkl
Copy link
Author

zzzkl commented Jun 8, 2023

可以构建一个arm64的镜像试试

@xiangsx
Copy link
Owner

xiangsx commented Jun 8, 2023

FROM node:18-alpine

# Install latest chrome dev package and fonts to support major charsets (Chinese, Japanese, Arabic, Hebrew, Thai and a few others)
# Note: this installs the necessary libs to make the bundled version of Chrome that Puppeteer
# installs, work.
RUN apt-get update \
    && apt-get install -y wget gnupg \
    && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor -o /usr/share/keyrings/googlechrome-linux-keyring.gpg \
    && sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/googlechrome-linux-keyring.gpg] http:https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
    && apt-get update \
    && apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-khmeros fonts-kacst fonts-freefont-ttf libxss1 \
      --no-install-recommends \
    && rm -rf /var/lib/apt/lists/* \
    && groupadd -r pptruser && useradd -rm -g pptruser -G audio,video pptruser

USER pptruser

WORKDIR /home/pptruser

COPY puppeteer-browsers-latest.tgz puppeteer-latest.tgz puppeteer-core-latest.tgz ./

# Install @puppeteer/browsers, puppeteer and puppeteer-core into /home/pptruser/node_modules.
RUN npm i ./puppeteer-browsers-latest.tgz ./puppeteer-core-latest.tgz ./puppeteer-latest.tgz \
    && rm ./puppeteer-browsers-latest.tgz ./puppeteer-core-latest.tgz ./puppeteer-latest.tgz \
    && (node -e "require('child_process').execSync(require('puppeteer').executablePath() + ' --credits', {stdio: 'inherit'})" > THIRD_PARTY_NOTICES)
    
USER root

WORKDIR /usr/src/app

COPY --chown=pptruser package.json /usr/src/app/

RUN npm i --registry=https://registry.npm.taobao.org

COPY --chown=pptruser . /usr/src/app

VOLUME [ "/usr/src/app/run" ]

EXPOSE 3000

CMD npm start

你试试用这个dockerfile构建下看看

@DNLINYJ
Copy link
Contributor

DNLINYJ commented Jun 8, 2023

@gaara1990
Copy link

https://github.com/puppeteer/puppeteer/issues

可以去这里找下,找到我也和我说一下 谢谢😊

好的好的

@HamiltionSenior
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants