Closed sd462355991 closed 1 month ago
应该是dbus没有启动,容器需要调用到dbus,systemctl start dbus @sd462355991
应该是dbus没有启动,容器需要调用到dbus,systemctl start dbus @sd462355991
是在宿主机输入吧,输入这个命令后,没有任何输出
然后又报错另外错误码。 我是用群晖的,docker
Traceback (most recent call last): File "/app/main.py", line 512, in main pt_key = await get_jd_pt_key(playwright, user) File "/app/main.py", line 373, in get_jd_pt_key browser = await playwright.chromium.launch(headless=headless, args=args) File "/usr/local/lib/python3.10/site-packages/playwright/async_api/_generated.py", line 14115, in launch await self._impl_obj.launch( File "/usr/local/lib/python3.10/site-packages/playwright/_impl/_browser_type.py", line 95, in launch Browser, from_channel(await self._channel.send("launch", params)) File "/usr/local/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 59, in send return await self._connection.wrap_api_call( File "/usr/local/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 514, in wrap_api_call raise rewrite_error(error, f"{parsed_st['apiName']}: {error}") from None playwright._impl._errors.TargetClosedError: BrowserType.launch: Target page, context or browser has been closed Browser logs:
╔════════════════════════════════════════════════════════════════════════════════════════════════╗
║ Looks like you launched a headed browser without having a XServer running. ║
║ Set either 'headless: true' or use 'xvfb-run
python main.py Traceback (most recent call last): File "C:\Users\z\Desktop\JD\other\main.py", line 5, in
from config import ( File "C:\Users\z\Desktop\JD\other\config.py", line 6 "force_update": "True" ^ SyntaxError: invalid syntax 我的在windows下运行,提示这个报错。
@icepage
应该是dbus没有启动,容器需要调用到dbus,systemctl start dbus @sd462355991
是在宿主机输入吧,输入这个命令后,没有任何输出
然后又报错另外错误码。 我是用群晖的,docker
Traceback (most recent call last): File "/app/main.py", line 512, in main pt_key = await get_jd_pt_key(playwright, user) File "/app/main.py", line 373, in get_jd_pt_key browser = await playwright.chromium.launch(headless=headless, args=args) File "/usr/local/lib/python3.10/site-packages/playwright/async_api/_generated.py", line 14115, in launch await self._impl_obj.launch( File "/usr/local/lib/python3.10/site-packages/playwright/_impl/_browser_type.py", line 95, in launch Browser, from_channel(await self._channel.send("launch", params)) File "/usr/local/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 59, in send return await self._connection.wrap_api_call( File "/usr/local/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 514, in wrap_api_call raise rewrite_error(error, f"{parsed_st['apiName']}: {error}") from None playwright._impl._errors.TargetClosedError: BrowserType.launch: Target page, context or browser has been closed Browser logs:
╔════════════════════════════════════════════════════════════════════════════════════════════════╗ ║ Looks like you launched a headed browser without having a XServer running. ║ ║ Set either 'headless: true' or use 'xvfb-run ' before running Playwright. ║ ║ ║ ║ <3 Playwright Team ║ ╚════════════════════════════════════════════════════════════════════════════════════════════════╝ Call log: /root/.cache/ms-playwright/chromium-1134/chrome-linux/chrome --disable-field-trial-config --disable-background-networking --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate,HttpsUpgrades,PaintHolding,PlzDedicatedWorker --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf --disable-search-engine-choice-screen --unsafely-disable-devtools-self-xss-warnings --no-sandbox --no-sandbox --disable-setuid-sandbox --user-data-dir=/tmp/playwright_chromiumdev_profile-TgbJVo --remote-debugging-pipe --no-startup-window
- pid=22
- [pid=22][err] [22:37:1017/133502.042941:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
- [pid=22][err] [22:22:1017/133502.047183:ERROR:ozone_platform_x11.cc(244)] Missing X server or $DISPLAY
- [pid=22][err] [22:22:1017/133502.047233:ERROR:env.cc(258)] The platform failed to initialize. Exiting.
2024-10-17 13:35:02.113 | INFO | main:run_scheduled_tasks:25 - 下次更新任务时间为2024-10-17 15:35:00
root 6035 0.0 0.0 4696 1920 ? Ss Sep08 0:04 /sbin/dbus-daemon --session --fork --print-address root 6102 0.0 0.0 4924 2216 ? Ss Sep08 3:36 /sbin/dbus-daemon --system --nopidfile root 20309 0.0 0.0 33216 2336 pts/5 S+ 17:14 0:00 grep --color=auto dbus admin1 30469 0.0 0.0 4812 3268 ? S< Sep08 0:04 /sbin/dbus-daemon --session --print-address=13
不知道这个算不算可以?
看日志,是dbus并未正常运行,主要是这个报错,/run/dbus/system_bus_socket: No such file or directory,没有这个socket文件或没权限。另外检查下headless是否配置为了True? @sd462355991
2024-10-17 12:06:39.763 | INFO | main:get_ql_api:439 - 开始获取QL登录态...... 2024-10-17 12:06:39.764 | INFO | main:get_ql_api:445 - 使用client_id和client_secret登录...... 2024-10-17 12:06:39.827 | INFO | main:get_ql_api:449 - client_id和client_secret正常可用...... 2024-10-17 12:06:39.858 | INFO | main:main:489 - 获取环境变量成功 2024-10-17 12:06:41.155 | INFO | main:main:511 - 开始更新1598xxxxxxx8(为了隐私,这里手机号我给改了) Traceback (most recent call last): File "/app/main.py", line 512, in main pt_key = await get_jd_pt_key(playwright, user) File "/app/main.py", line 373, in get_jd_pt_key browser = await playwright.chromium.launch(headless=headless, args=args) File "/usr/local/lib/python3.10/site-packages/playwright/async_api/_generated.py", line 14115, in launch await self._impl_obj.launch( File "/usr/local/lib/python3.10/site-packages/playwright/_impl/_browser_type.py", line 95, in launch Browser, from_channel(await self._channel.send("launch", params)) File "/usr/local/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 59, in send return await self._connection.wrap_api_call( File "/usr/local/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 514, in wrap_api_call raise rewrite_error(error, f"{parsed_st['apiName']}: {error}") from None playwright._impl._errors.TargetClosedError: BrowserType.launch: Target page, context or browser has been closed Browser logs:
╔════════════════════════════════════════════════════════════════════════════════════════════════╗ ║ Looks like you launched a headed browser without having a XServer running. ║ ║ Set either 'headless: true' or use 'xvfb-run' before running Playwright. ║
║ ║
║ <3 Playwright Team ║
╚════════════════════════════════════════════════════════════════════════════════════════════════╝
Call log: