Comments (29)
It says you can try the --no-sandbox
option. Have you tried?
from koishi-plugin-puppeteer.
It says you can try the
--no-sandbox
option. Have you tried?
Tried it, still getting an error.
2022-04-27 18:00:58 [W] ndefined;1mapp Error: Failed to launch the browser process! spawn /chrome-linux/chrome --no-sandbox ENOENT
TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
at onClose (/koishi4地址/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:241:20)
at ChildProcess.<anonymous> (/koishi4地址/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:233:85)
at ChildProcess.emit (events.js:400:28)
at Process.ChildProcess._handle.onexit (internal/child_process.js:280:12)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
from koishi-plugin-puppeteer.
提供一下环境信息,包括系统版本,Node 版本和 chromium 版本。
from koishi-plugin-puppeteer.
try not to specify the path of chrome executable, just add the option.
Also, check if there is an instance of chromium under node_modules/puppeteer/bin
from koishi-plugin-puppeteer.
try not to specify the path of chrome executable, just add the option.
Also, check if there is an instance of chromium under
node_modules/puppeteer/bin
The error I sent before was not specified, but he still reported an error.
from koishi-plugin-puppeteer.
提供一下环境信息,包括系统版本,Node 版本和 chromium 版本。
OS: CentOS 7.9.2009 x86_64
Platform: onebot
Node version: v14.19.0
Koishi version: 4.6.1
chromium: 982053
https://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux_x64/982053/chrome-linux.zip
from koishi-plugin-puppeteer.
try not to specify the path of chrome executable, just add the option.
Also, check if there is an instance of chromium under
node_modules/puppeteer/bin
The error I sent before was not specified, but he still reported an error.
But the first error indicated you have incoked chrome successfully, just failed to enter the sandbox mode, so --no-sandbox
is a potential solution here.
from koishi-plugin-puppeteer.
try not to specify the path of chrome executable, just add the option.
Also, check if there is an instance of chromium undernode_modules/puppeteer/bin
The error I sent before was not specified, but he still reported an error.
But the first error indicated you have incoked chrome successfully, just failed to enter the sandbox mode, so
--no-sandbox
is a potential solution here.
In the error message I see this Running as root without --no-sandbox is not supported.
, but not using root will cause the plugin to fail to install in the control panel.
from koishi-plugin-puppeteer.
In the error message I see this
Running as root without --no-sandbox is not supported.
, but not using root will cause the plugin to fail to install in the control panel.
That is because you have some permission issue in your current workspace, for example, the folder is created by root and not allow other users to modify files inside it.
Theoretically you should run koishi as non-root user, so you might need to chown and chmod your workspace folders.
from koishi-plugin-puppeteer.
In the error message I see this
Running as root without --no-sandbox is not supported.
, but not using root will cause the plugin to fail to install in the control panel.That is because you have some permission issue in your current workspace, for example, the folder is created by root and not allow other users to modify files inside it. Theoretically you should run koishi as non-root user, so you might need to chown and chmod your workspace folders.
I've done it again now, and he didn't report an error, but it still didn't work properly.
from koishi-plugin-puppeteer.
I think the chess plugin would output text until you type chess --imageMode
lol.
from koishi-plugin-puppeteer.
I think the chess plugin would output text until you type
chess --imageMode
lol.
Is that so? It doesn't seem to work, but I'm fine in koishi3 version.
Ah, it's so uncomfortable. Although I don't use this function for a long time, it is the easiest one I know to check whether it is working properly.
from koishi-plugin-puppeteer.
You sure you type the command right? What I see in the image seems like you used a full-width dash (——) instead of half-width hyphens (-).
from koishi-plugin-puppeteer.
should be --image-mode
from koishi-plugin-puppeteer.
should be
--image-mode
Options always are kebab-case même even registered as camelCase in code?
from koishi-plugin-puppeteer.
I've beening always writting like this, the command above might work but I'm not sure.
from koishi-plugin-puppeteer.
黑白棋 --image-mode
May be caused by the font, it looks like (——)
from koishi-plugin-puppeteer.
黑白棋 --image-mode
Is your "黒白棋" a shortcut or an alias? If it is a shortcut, you should register it with prefix
and fuzzy
, otherwise it would just ignore your arguments.
ctx
.command("chess")
.shortcut("黒白棋", { prefix: true, fuzzy: true })
// ^ like this. ^
from koishi-plugin-puppeteer.
黑白棋 --image-mode
Is your "黒白棋" a shortcut or an alias? If it is a shortcut, you should register it with
prefix
andfuzzy
, otherwise it would just ignore your arguments.ctx .command("chess") .shortcut("黒白棋", { prefix: true, fuzzy: true }) // ^ like this. ^
"黒白棋" is a chessboard in chess
. Direct input of chess --image-mode
will not generate a chessboard
from koishi-plugin-puppeteer.
Ah, I see.
So it is a shortcut, I think you should call the chess
command instead.
Direct input of
chess --image-mode
will not generate a chessboard
This is not a command for playing, but for setting the "mode" to the image mode.
Koishi would reply something like "已切换到图片模式。" if you successfully setup puppeteer and chess plugin when you enter this command. If koishi replies something else, that means your puppeteer isn't initialised correctly. You should check out if there is a log that says "app apply plugin puppeteer" without error.
By the way, what is the output if you type "help chess", does it says that there are options "--image-mode" and "--text-mode" in the reply?
from koishi-plugin-puppeteer.
Ah, I see. So it is a shortcut, I think you should call the
chess
command instead.Direct input of
chess --image-mode
will not generate a chessboardThis is not a command for playing, but for setting the "mode" to the image mode. Koishi would reply something like "已切换到图片模式。" if you successfully setup puppeteer and chess plugin when you enter this command. If koishi replies something else, that means your puppeteer isn't initialised correctly. You should check out if there is a log that says "app apply plugin puppeteer" without error.
By the way, what is the output if you type "help chess", does it says that there are options "--image-mode" and "--text-mode" in the reply?
2022-04-28 10:37:46 [W] ndefined;1mmarket Error: read ECONNRESET
at TLSWrap.onStreamRead (internal/stream_base_commons.js:209:20)
2022-04-28 10:37:58 [W] ndefined;1mapp TimeoutError: Timed out after 30000 ms while trying to connect to the browser! Only Chrome at revision r982053 is guaranteed to work.
at Timeout.onTimeout (/koishi4/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:252:20)
at listOnTimeout (internal/timers.js:557:17)
at processTimers (internal/timers.js:500:7)
2022-04-28 10:38:13 [D] ndefined;1mmessage [#] Frank: chess --image-mode
I just saw that there was indeed an error, but it was only displayed when I first entered chess --image-mode
.
chess [position]
棋类游戏
输入“五子棋”“黑白棋”“围棋”开始对应的一局游戏。
再输入“落子 A1”将棋子落于 A1 点上。
目前默认使用图片模式。文本模式速度更快,但是在部分机型上可能无法正常显示,同时无法适应过大的棋盘。
可用的选项有:
--rule <rule> 设置规则,支持的规则有 go, gomoku, othello
--size <size> 设置大小
--skip 跳过回合
--repent 悔棋
-v, --show, --view 显示棋盘
-e, --stop, --end 停止游戏
2022-04-28 10:37:58 [W] ndefined;1mapp TimeoutError: Timed out after 30000 ms while trying to connect to the browser! Only Chrome at revision r982053 is guaranteed to work.
at Timeout.onTimeout (/koishi4/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:252:20)
at listOnTimeout (internal/timers.js:557:17)
at processTimers (internal/timers.js:500:7)
from koishi-plugin-puppeteer.
So now what is the situation? You choose the chrome that you downloaded or the one bundled in puppeteer?
What I saw is that puppeteer didn't successfully connect to chrome.
from koishi-plugin-puppeteer.
So now what is the situation? You choose the chrome that you downloaded or the one bundled in puppeteer?
What I saw is that puppeteer didn't successfully connect to chrome.
What I posted just now was bundled with puppeteer, and now this is my own.
2022-04-28 10:45:14 [I] ndefined;1mapp reload plugin ndefinedmpuppeteer
2022-04-28 10:45:14 [W] ndefined;1mapp Error: Failed to launch the browser process! spawn /www/chrome-linux/chrome --no-sandbox ENOENT
TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
at onClose (/koishi4/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:241:20)
at ChildProcess.<anonymous> (/koishi4/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:233:85)
at ChildProcess.emit (events.js:400:28)
at Process.ChildProcess._handle.onexit (internal/child_process.js:280:12)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
from koishi-plugin-puppeteer.
Looks like that is a common issue on CentOS 7, what I using is Ubuntu and Debian so I have no many painful experiences while installing the puppeteer.
Try check out:
puppeteer/puppeteer#560
from koishi-plugin-puppeteer.
docker中运行依旧会出现这个问题。
from koishi-plugin-puppeteer.
docker中运行依旧会出现这个问题。
what do you mean by "这个问题" ?
Also, just FYI, it would be better to install google-chrome-stable
via package manager like apt
in docker container before starting puppeteer with option path
point to the path of the chrome that you installed. De plus, the environment variables PUPPETEER_SKIP_CHROMIUM_DOWNLOAD
should be set to true
while installing puppeteer
to prevent downloading the chromium built-in.
EDIT: There are official trouble shooting steps on their website, try to see yourself here.
Au fait, it is not recommanded to run alpine image with puppeteer, which is trouble-ish many times.
https://pptr.dev/troubleshooting/#running-puppeteer-in-docker
from koishi-plugin-puppeteer.
@vissu Are you using the puppeteer-specific docker image? You may try that one.
from koishi-plugin-puppeteer.
测试了一下,使用 koishi 官方的 latest-puppeteer docker 镜像并安装 puppeteer 插件及 chess 插件是可以正常运行并渲染图片的,请检查一下您的运行环境
from koishi-plugin-puppeteer.
通过官方的 koishijs/koishi docker镜像搭建koishi后,基本上没有出现完全不能正常工作的问题了,但有一点不知道是我的问题还是插件本身。
在每次重启 koishi 的docker容器后,puppeteer并没有正常工作,需要手动禁用该插件并重新启用后才能正常工作。
from koishi-plugin-puppeteer.
Related Issues (20)
- Bug(?): `<html>` looks like not accepting attributes like `lang`?
- 关于 render
- Bug: TypeError: Cannot read properties of undefined (reading 'replace')
- 网页截图 -f 不生效 HOT 2
- shot可否调用百度智能云的图片审查功能 HOT 1
- Feature(pptr): 让 Puppeteer 尊重 Koishi 全局代理设置 HOT 6
- 文字动态加载等待问题 HOT 2
- bug: 样式(字符串)传入 puppeteer 以后被转义了 HOT 1
- bug: 调用 ctx.puppeteer.render 时无法加载本地资源 HOT 4
- 希望能加入`headless: "new"` 配置项消除 warning HOT 2
- Docs: clarify not to use chrome installed by snap on Linux HOT 1
- Bug: canvas.loadImage 加载本地图片报错
- Docs: 侧边导航栏路由异常
- Feature: 提供 Page Pool,提升渲染速度
- Feature: 调整pptr渲染图片的格式(或大小) HOT 1
- Feature: 希望koishi-plugin-puppeteer能修改渲染出的图片的格式,或者能压缩一下图片大小
- DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
- Feature: Connect to Existing Browser Instance
- Bug: 缺少 canvas 服务的声明合并 HOT 1
- 无法使用puppeteer
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from koishi-plugin-puppeteer.