Skip to content

上传文件报错 #266

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

Open
chaser8 opened this issue Mar 6, 2023 · 5 comments
Open

上传文件报错 #266

chaser8 opened this issue Mar 6, 2023 · 5 comments

Comments

@chaser8
Copy link

chaser8 commented Mar 6, 2023

[2023-03-06 09:27:02] 上传文件:/data/backup//data/log.txt
panic: runtime error: index out of range [0] with length 0

goroutine 13 [running]:
github.com/tickstep/aliyunpan/internal/syncdrive.(*FileActionTask).uploadFile(0xc0000b6000, 0xf1c9d8, 0xc000474140, 0x0, 0x0)
/Users/tickstep/Documents/Workspace/go/projects/aliyunpan/internal/syncdrive/file_action_task.go:538 +0x2505
github.com/tickstep/aliyunpan/internal/syncdrive.(*FileActionTask).DoAction(0xc0000b6000, 0xf1c9d8, 0xc000474140, 0x0, 0x0)
/Users/tickstep/Documents/Workspace/go/projects/aliyunpan/internal/syncdrive/file_action_task.go:70 +0x1cf0
github.com/tickstep/aliyunpan/internal/syncdrive.(*FileActionTaskManager).fileActionTaskExecutor.func1(0xc0000b6000, 0xf1c9d8, 0xc000474140, 0xc0000a00e0, 0xc0004c4570)
/Users/tickstep/Documents/Workspace/go/projects/aliyunpan/internal/syncdrive/file_action_task_mgr.go:819 +0x45
created by github.com/tickstep/aliyunpan/internal/syncdrive.(*FileActionTaskManager).fileActionTaskExecutor
/Users/tickstep/Documents/Workspace/go/projects/aliyunpan/internal/syncdrive/file_action_task_mgr.go:818 +0x30d

@xiaoyaofenfen
Copy link
Collaborator

新版本上传已经优化很多,请在新版本中继续关注,感谢反馈

@shniubobo
Copy link

使用 v0.3.6 依旧报错,请 reopen 这个 issue。

panic: runtime error: index out of range [0] with length 0

goroutine 44 [running]:
github.com/tickstep/aliyunpan/internal/syncdrive.(*FileActionTask).uploadFile(0xc0001aabd0, {0x16a0168, 0xc0005643c0})
        /Users/tickstep/Documents/Workspace/go/projects/aliyunpan/internal/syncdrive/file_action_task.go:533 +0x225a
github.com/tickstep/aliyunpan/internal/syncdrive.(*FileActionTask).DoAction(0xc0001aabd0, {0x16a0168, 0xc0005643c0})
        /Users/tickstep/Documents/Workspace/go/projects/aliyunpan/internal/syncdrive/file_action_task.go:66 +0x173
github.com/tickstep/aliyunpan/internal/syncdrive.(*FileActionTaskManager).fileActionTaskExecutor.func1()
        /Users/tickstep/Documents/Workspace/go/projects/aliyunpan/internal/syncdrive/file_action_task_mgr.go:557 +0x3a
created by github.com/tickstep/aliyunpan/internal/syncdrive.(*FileActionTaskManager).fileActionTaskExecutor in goroutin
e 50
        /Users/tickstep/Documents/Workspace/go/projects/aliyunpan/internal/syncdrive/file_action_task_mgr.go:556 +0x2c5

@shniubobo
Copy link

目前的 workaround 是删除 sync_drive 目录下的数据库文件

@xiaoyaofenfen
Copy link
Collaborator

你能帮忙开启Debug,把debug日志贴上来看看

@xiaoyaofenfen xiaoyaofenfen reopened this Mar 3, 2025
@shniubobo
Copy link

复现步骤我写一下,我刚刚又试了一遍,无法稳定复现,所以没法提供日志

配置文件:

{
 "configVer": "1.0",
 "syncTaskList": [
  {
   "name": "[REDACTED]",
   "driveName": "backup",
   "localFolderPath": "[REDACTED]",
   "panFolderPath": "[REDACTED]",
   "mode": "upload",
   "policy": "increment"
  }
 ]
}

登录步骤省略。运行以下命令,等待片刻后 ctrl+c 退出,再次运行即报错,多次运行均稳定报错

./aliyunpan --verbose sync start --up 10 --cycle onetime --log true

然后删除配置文件中 id 字段对应的文件夹(文件夹中有两个数据库文件和两个锁文件),再多次运行,均无法复现报错。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants