AlistGo / alist

🗂️A file list/WebDAV program that supports multiple storages, powered by Gin and Solidjs. / 一个支持多存储的文件列表/WebDAV程序,使用 Gin 和 Solidjs。
https://alist.nn.ci
GNU Affero General Public License v3.0
44.41k stars 5.76k forks source link

[PikPak] panic: runtime error: invalid memory address or nil pointer dereference #7149

Closed Muione closed 2 months ago

Muione commented 2 months ago

Please make sure of the following things

AList Version / AList 版本

v3.37.1

Driver used / 使用的存储驱动

PikPak

Describe the bug / 问题描述

更新 alist 到最新版本之后,打开 UseLowLatencyAddress 选择项 CustomLowLatencyAddress 字段留空,重启 alist 之后出现报错,并且无法启动:

panic: runtime error: invalid memory address or nil pointer dereference

并且无法启动 alist

Reproduction / 复现链接

这个 BUG 触发需要前置条件,触发的流程如下:

Config / 配置

Logs / 日志

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x16aa22c]

goroutine 166 [running]:
github.com/alist-org/alist/v3/drivers/pikpak.(*PikPak).request(0x4000e6dc00, {0x247bf81, 0x30}, {0x23f4fb7, 0x4}, 0x40000537f0, {0x1dae100, 0x4000e3e2d0})
        /source/drivers/pikpak/util.go:234 +0x3ac
github.com/alist-org/alist/v3/drivers/pikpak.(*PikPak).refreshCaptchaToken(0x4000e6dc00, {0x4000e0e318?, 0x23f7429?}, 0x5?)
        /source/drivers/pikpak/util.go:466 +0x140
github.com/alist-org/alist/v3/drivers/pikpak.(*PikPak).RefreshCaptchaTokenInLogin(0x4000e6dc00, {0x4000e0e318, 0x14}, {0x4000c9a450, 0x23})
        /source/drivers/pikpak/util.go:440 +0x16c
github.com/alist-org/alist/v3/drivers/pikpak.(*PikPak).login(0x4000e6dc00)
        /source/drivers/pikpak/util.go:140 +0x68
github.com/alist-org/alist/v3/drivers/pikpak.(*PikPak).Init(0x4000e6dc00, {0x3853730, 0x4d5a4a0})
        /source/drivers/pikpak/driver.go:117 +0x93c
github.com/alist-org/alist/v3/internal/op.initStorage({0x3853730, _}, {0x14, {0x40007f9920, 0x7}, 0x0, {0x40007f9930, 0x6}, 0x1e, {0x40007f9940, ...}, ...}, ...)
        /source/internal/op/storage.go:94 +0xe4
github.com/alist-org/alist/v3/internal/op.LoadStorage({0x3853730, _}, {0x14, {0x40007f9920, 0x7}, 0x0, {0x40007f9930, 0x6}, 0x1e, {0x40007f9940, ...}, ...})
        /source/internal/op/storage.go:80 +0x10c
github.com/alist-org/alist/v3/internal/bootstrap.LoadStorages.func1({0x4000928608, 0xd, 0x4000bdf300?})
        /source/internal/bootstrap/storage.go:20 +0xb4
created by github.com/alist-org/alist/v3/internal/bootstrap.LoadStorages in goroutine 1
        /source/internal/bootstrap/storage.go:18 +0xc0
github-actions[bot] commented 2 months ago

See

  1. 93% #3637
  2. 60% #1722
Three-taile-dragon commented 2 months ago

所以是 用户名和密码以及 refresh_token 都没填写的情况下,保存->禁用->启用->重启Alist ? ORZ,没想到还有这操作🤡

Muione commented 2 months ago

所以是 用户名和密码以及 refresh_token 都没填写的情况下,保存->禁用->启用->重启Alist ? ORZ,没想到还有这操作🤡

不是,其他都保留着。 因为refresh_token失效了,本来想将refresh_token 和 capatch_token 字段清除后使用用户名、密码重新登陆获取refresh_token,就进行了上述步骤,出现的这个BUG,我这边可以100%复现

Three-taile-dragon commented 2 months ago

所以是 用户名和密码以及 refresh_token 都没填写的情况下,保存->禁用->启用->重启Alist ? ORZ,没想到还有这操作🤡

不是,其他都保留着。 因为refresh_token失效了,本来想将refresh_token 和 capatch_token 字段清除后使用用户名、密码重新登陆获取refresh_token,就进行了上述步骤,出现的这个BUG,我这边可以100%复现

就是说,用户名和密码都有填写,只是清空了 refreshtoken字段 后进行的操作?

Muione commented 2 months ago

就是说,用户名和密码都有填写,只是清空了 refreshtoken字段 后进行的操作?

是的

Three-taile-dragon commented 2 months ago

7150 试试这版有修复不

Muione commented 2 months ago

7150 试试这版有修复不

这个版本没问题; 清除 refresh_token 和 capatch_token 字段后,保存,然后禁用再启用磁盘,能正常进行登陆并挂载。