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

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

Closed
4 tasks done
Muione opened this issue Sep 8, 2024 · 7 comments
Closed
4 tasks done
Labels
bug Something isn't working

Comments

@Muione
Copy link
Contributor

Muione commented Sep 8, 2024

Please make sure of the following things

  • I have read the documentation.
    我已经阅读了文档

  • I'm sure there are no duplicate issues or discussions.
    我确定没有重复的issue或讨论。

  • I'm sure it's due to AList and not something else(such as Network ,Dependencies or Operational).
    我确定是AList的问题,而不是其他原因(例如网络依赖操作)。

  • I'm sure this issue is not fixed in the latest version.
    我确定这个问题在最新版本中没有被修复。

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 触发需要前置条件,触发的流程如下:

  • 更新主程序后, PikPak 存储提示 refresh_token 被其他程序刷新:
    oauth2: "invalid_grant" "refresh token os.0ueD_vBzW2bdYp8Ixvbj3AicurBTUUtb4zUPJzrWreVgwxncE0V55LGU has been refresh at 2024-09-08T16:38:56+08:00"
    
  • refresh_tokencapatch_token 字段(填写了用户名和密码字段)清除然后保存,这时报错:
    ailed init storage: oauth2: "invalid_grant" "refresh token os.0ueD_vBzW2bdYp8Ixvbj3AicurBTUUtb4zUPJzrWreVgwxncE0V55LGU has been refresh at 2024-09-08T16:38:56+08:00"
    
  • 打开 UseLowLatencyAddress 选择项 CustomLowLatencyAddress 字段留空,并保存(这一步应该无关紧要)
  • 禁用 PikPak 存储,再启用,这时提示 request error 500,实际上存储并未正常启用,这时只有禁用按钮
    image
  • 这时添加的 PikPak 完全不可用,重启 alist 主程序,可以复现这一BUG,日志可见下方内容
  • 这一BUG出现后,alist 将无法正常启动

Config / 配置

  • 平台:网页
  • 刷新令牌方法: Oauth2

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
@Muione Muione added the bug Something isn't working label Sep 8, 2024
@Three-taile-dragon
Copy link
Contributor

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

@Muione
Copy link
Contributor Author

Muione commented Sep 8, 2024

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

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

@Three-taile-dragon
Copy link
Contributor

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

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

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

@Muione
Copy link
Contributor Author

Muione commented Sep 8, 2024

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

是的

@Three-taile-dragon
Copy link
Contributor

#7150 试试这版有修复不

@Muione
Copy link
Contributor Author

Muione commented Sep 8, 2024

#7150 试试这版有修复不

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

@Muione Muione closed this as completed Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants