msojocs / bilibili-linux

基于哔哩哔哩官方客户端移植的Linux版本 支持漫游
MIT License
719 stars 34 forks source link

每次首次打开时, 无法启动, 需二次启动 #66

Closed NextAlone closed 1 year ago

NextAlone commented 1 year ago

每次首次打开时, 无法启动, 需二次启动才可以

命令行输出

> bilibili
get isPackaged true
get isPackaged true
20:52:28.950 (AppIndex) › Starting...
get isPackaged false
20:52:28.952 (AppIndex) › Deep link url:
get isPackaged true
20:52:28.987 (AppIndex) › Creating new instance!
(node:3087205) UnhandledPromiseRejectionWarning: FetchError: request to http://localhost:3032/restart failed, reason: connectECONNREFUSED 127.0.0.1:3032
    at ClientRequest.<anonymous> (/usr/share/bilibili/bilibili.asar/node_modules/node-fetch/lib/index.js:1505:11)
    at ClientRequest.emit (node:events:390:28)
    at Socket.socketErrorListener (node:_http_client:447:9)
    at Socket.emit (node:events:390:28)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
(Use `electron --trace-warnings ...` to show where the warning was created)
(node:3087205) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing insideof an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
[3087239:0322/205229.023761:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.

进程信息

 PID:▲   User      │ TTY   CPU MEM CPU Time │ Command
                   │       [%] [%]          │
 3087204 nextalone │ pts/1 0.0 0.0 00:00:00 │ /usr/bin/bash /usr/bin/bilibili
 3087205 nextalone │ pts/1 0.0 0.2 00:00:00 │ /usr/lib/electron17/electron --enable-crashpad /usr/share/bilibili/bilibili.asar
 3087239 nextalone │ pts/1 0.0 0.2 00:00:00 │ /usr/lib/electron17/electron --type=gpu-process --enable-crashpad --enable-crash-reporter=c4e7b015-7cb3-49b1-9658-e927bbdfdacd,no_channel --user-data-dir=/home/nextalone/.config/bilibili --gpu-preferences=UAAAAAAAAAAgAAAIAAAAAAAAAAAAAAAAAABgAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAABgAAAAAAAAAGAAAAAAAAAAIAAAAAAAAAAgAAAAAAAAACAAAAAAAAAA= --shared-files --field-trial-handle=0,547749415746670464,4667130065998405314,131072 --disable-features=PlzServiceWorker,SpareRendererForSitePerProcess
 3087276 nextalone │ pts/1 0.0 0.2 00:00:00 │ /usr/lib/electron17/electron --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --enable-crashpad --enable-crash-reporter=c4e7b015-7cb3-49b1-9658-e927bbdfdacd,no_channel --user-data-dir=/home/nextalone/.config/bilibili --shared-files=v8_context_snapshot_data:100 --field-trial-handle=0,547749415746670464,4667130065998405314,131072 --disable-features=PlzServiceWorker,SpareRendererForSitePerProcess --enable-crashpad

系统信息

> uname -srm
Linux 6.2.7-native_amd-xanmod1-1 x86_64

包版本信息

> p -Qi bilibili-bin
Name            : bilibili-bin
Version         : 1.9.1-3
Description     : 哔哩哔哩官方客户端linux移植版。Bilibili official desktop client
Architecture    : any
URL             : https://github.com/msojocs/bilibili-linux
Licenses        : custom
Groups          : None
Provides        : None
Depends On      : ffmpeg  electron17  libappindicator-gtk3
Optional Deps   : None
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 39.88 MiB
Packager        : Next Alone <>
Build Date      : Sat 18 Feb 2023 01:11:40 AM CST
Install Date    : Sat 18 Feb 2023 01:34:18 AM CST
Install Reason  : Explicitly installed
Install Script  : Yes
Validated By    : Signature
dongfengweixiao commented 1 year ago

在 archlinux 下,存在相同的问题。

终端下首次启动的日志如下:

➜  ~ bilibili 
get isPackaged true
get isPackaged true
18:35:17.589 (AppIndex) › Starting...
get isPackaged false
18:35:17.596 (AppIndex) › Deep link url: 
get isPackaged true
18:35:17.658 (AppIndex) › Creating new instance!
(node:11868) UnhandledPromiseRejectionWarning: FetchError: request to http://localhost:3032/restart failed, reason: connect ECONNREFUSED 127.0.0.1:3032
    at ClientRequest.<anonymous> (/usr/share/bilibili/bilibili.asar/node_modules/node-fetch/lib/index.js:1505:11)
    at ClientRequest.emit (node:events:390:28)
    at Socket.socketErrorListener (node:_http_client:447:9)
    at Socket.emit (node:events:390:28)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
(Use `electron --trace-warnings ...` to show where the warning was created)
(node:11868) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
[11904:0429/183517.730254:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
^C%                                                                                                               
msojocs commented 1 year ago

确实有,但是不好复现。。。

dongfengweixiao commented 1 year ago

确实有,但是不好复现。。。

v1.10.1 版本中此问题似乎已经修复。

dongfengweixiao commented 1 year ago

确实有,但是不好复现。。。

v1.10.1 版本依旧存在此问题。看起来是一个本地的服务没起来,导致获取不到数据。

get isPackaged true
get isPackaged true
23:24:56.195 (AppIndex) › Starting...
get isPackaged false
23:24:56.199 (AppIndex) › Process args ["/usr/lib/electron17/electron","/usr/share/bilibili/bilibili.asar"]

(electron:16641): Gtk-WARNING **: 23:24:56.251: Theme parsing error: gtk.css:4287:35: '-2px' is not a valid color name

(electron:16641): Gtk-WARNING **: 23:24:56.251: Theme parsing error: gtk.css:4291:35: '-1px' is not a valid color name
get isPackaged true
23:24:56.348 (AppIndex) › Creating new instance!
(node:16641) UnhandledPromiseRejectionWarning: FetchError: request to http://localhost:3032/restart failed, reason: connect ECONNREFUSED 127.0.0.1:3032
    at ClientRequest.<anonymous> (/usr/share/bilibili/bilibili.asar/node_modules/node-fetch/lib/index.js:1505:11)
    at ClientRequest.emit (node:events:390:28)
    at Socket.socketErrorListener (node:_http_client:447:9)
    at Socket.emit (node:events:390:28)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
(Use `electron --trace-warnings ...` to show where the warning was created)
(node:16641) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
[16680:0525/232456.482419:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
msojocs commented 1 year ago

已定位问题点 在配置文件 ~/.config/bilibili/.runtime 中 如果启动前 localServer 长度非0,启动就会失败。 应该是关闭程序的时候会出现概率性 localServer 没有正确清空。

msojocs commented 1 year ago

已处理

NextAlone commented 1 year ago

已处理

我这边可以用1.10.1-4复测是吧