Skip to content

4.4.0出现panic #2750

@BurtSweet

Description

@BurtSweet

Describe the bug
A clear and concise description of what the bug is.
升级4.4.0后出现panic,然后删除数据库重新运行依然panic

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

goroutine 1588 [running]:
github.com/cloudreve/Cloudreve/v4/pkg/filemanager/manager.CronCollectTrashBin({0x307cc10, 0xc00749c8a0})
/home/vsts/work/1/s/pkg/filemanager/manager/recycle.go:316 +0x373
github.com/cloudreve/Cloudreve/v4/pkg/crontab.taskWrapper.func1()
/home/vsts/work/1/s/pkg/crontab/crontab.go:71 +0x2f7
github.com/robfig/cron/v3.FuncJob.Run(0xc00827efd0?)
/home/vsts/go/pkg/mod/github.com/robfig/cron/v3@v3.0.1/cron.go:136 +0x12
github.com/robfig/cron/v3.(*Cron).startJob.func1()
/home/vsts/go/pkg/mod/github.com/robfig/cron/v3@v3.0.1/cron.go:312 +0x55
created by github.com/robfig/cron/v3.(*Cron).startJob in goroutine 75
/home/vsts/go/pkg/mod/github.com/robfig/cron/v3@v3.0.1/cron.go:310 +0x90
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1924633]

goroutine 1117 [running]:
github.com/cloudreve/Cloudreve/v4/pkg/filemanager/manager.CronCollectTrashBin({0x307cc10, 0xc0016387e0})
/home/vsts/work/1/s/pkg/filemanager/manager/recycle.go:316 +0x373
github.com/cloudreve/Cloudreve/v4/pkg/crontab.taskWrapper.func1()
/home/vsts/work/1/s/pkg/crontab/crontab.go:71 +0x2f7
github.com/robfig/cron/v3.FuncJob.Run(0xc000d17fd0?)
/home/vsts/go/pkg/mod/github.com/robfig/cron/v3@v3.0.1/cron.go:136 +0x12
github.com/robfig/cron/v3.(*Cron).startJob.func1()
/home/vsts/go/pkg/mod/github.com/robfig/cron/v3@v3.0.1/cron.go:312 +0x55
created by github.com/robfig/cron/v3.(*Cron).startJob in goroutine 25
/home/vsts/go/pkg/mod/github.com/robfig/cron/v3@v3.0.1/cron.go:310 +0x90

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: debian 12
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions