Skip to content

[BUG] 上传文件时报错 runtime error: invalid memory address or nil pointer dereference #2618

@mcdudu233

Description

@mcdudu233

请确认以下事项

  • 我已确认阅读并同意 AGPL-3.0 第15条
    本程序不提供任何明示或暗示的担保,使用风险由您自行承担。

  • 我已确认阅读并同意 AGPL-3.0 第16条
    无论何种情况,版权持有人或其他分发者均不对使用本程序所造成的任何损失承担责任。

  • 我确认我的描述清晰,语法礼貌,能帮助开发者快速定位问题,并符合社区规则。

  • 我已确认阅读了OpenList文档

  • 我已确认没有重复的问题或讨论。

  • 我已确认是OpenList的问题,而不是其他原因(例如 网络依赖操作)。

  • 我认为此问题必须由OpenList处理,而非第三方。

  • 我已确认这个问题在最新版本中没有被修复。

  • 我没有阅读这个清单,只是闭眼选中了所有的复选框,请关闭这个 Issue 。

OpenList 版本(必填)

v4.2.2

使用的存储驱动(必填)

Crypt+Chunk+Aliyundrive

问题描述(必填)

按照官网的建议配置的Crypt+Chunk+Aliyundrive,使用rclone同步到Crypt的时候,上传某些文件会遇到500错误。

这些文件在网页进行上传也会出现同样的错误,如下图:

Image

同时日志文件报错:

[GIN] 2026/06/15 - 05:11:01 | 200 |  7.243926436s |      100.64.1.1 | POST     "/api/fs/list"

�[31m2026/06/15 05:12:52 [Recovery] 2026/06/15 - 05:12:52 panic recovered:
runtime error: invalid memory address or nil pointer dereference
/opt/hostedtoolcache/go/1.25.0/x64/src/runtime/panic.go:262 (0x484cd8)
/opt/hostedtoolcache/go/1.25.0/x64/src/runtime/signal_unix.go:925 (0x484ca8)
/home/runner/work/OpenList/OpenList/drivers/chunk/driver.go:127 (0x1e91a64)
/home/runner/work/OpenList/OpenList/internal/op/fs.go:185 (0xc7e59c)
/home/runner/work/OpenList/OpenList/internal/fs/get.go:37 (0x11b3bea)
/home/runner/work/OpenList/OpenList/internal/fs/fs.go:44 (0x11b1afb)
/home/runner/work/OpenList/OpenList/drivers/crypt/driver.go:176 (0x1eb09c7)
/home/runner/work/OpenList/OpenList/internal/op/fs.go:185 (0xc7e59c)
/home/runner/work/OpenList/OpenList/internal/fs/get.go:37 (0x11b3bea)
/home/runner/work/OpenList/OpenList/internal/fs/fs.go:44 (0x11b1afb)
/home/runner/work/OpenList/OpenList/server/handles/fsup.go:63 (0x1971fc4)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.1/context.go:185 (0x117ccaa)
/home/runner/work/OpenList/OpenList/server/middlewares/limit.go:28 (0x1a07a78)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.1/context.go:185 (0x190f1f8)
/home/runner/work/OpenList/OpenList/server/middlewares/fsup.go:47 (0x190f0ab)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.1/context.go:185 (0x117ccaa)
/home/runner/work/OpenList/OpenList/server/middlewares/auth.go:74 (0x1a057f7)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.1/context.go:185 (0x190e23a)
/home/runner/work/OpenList/OpenList/server/middlewares/check.go:35 (0x190e228)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.1/context.go:185 (0x118a7ae)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.1/recovery.go:102 (0x118a79b)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.1/context.go:185 (0x1189884)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.1/logger.go:249 (0x118986b)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.1/context.go:185 (0x1188d0a)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.1/gin.go:644 (0x11886c7)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.1/gin.go:600 (0x11881ec)
/opt/hostedtoolcache/go/1.25.0/x64/src/net/http/server.go:3340 (0x7577ad)
/opt/hostedtoolcache/go/1.25.0/x64/src/net/http/server.go:2109 (0x7360c4)
/opt/hostedtoolcache/go/1.25.0/x64/src/runtime/asm_amd64.s:1693 (0x48ae20)
�[0m
[GIN] 2026/06/15 - 05:12:52 | 500 |  512.340296ms |      100.64.1.1 | PUT      "/api/fs/put"
[GIN] 2026/06/15 - 05:12:53 | 200 |   842.54275ms |      100.64.1.1 | POST     "/api/fs/list"

奇怪的是这些文件只要重命名为其他名称,就能成功上传了,可能是文件名引起的问题?

日志(必填)

[GIN] 2026/06/15 - 05:11:01 | 200 |  7.243926436s |      100.64.1.1 | POST     "/api/fs/list"

�[31m2026/06/15 05:12:52 [Recovery] 2026/06/15 - 05:12:52 panic recovered:
runtime error: invalid memory address or nil pointer dereference
/opt/hostedtoolcache/go/1.25.0/x64/src/runtime/panic.go:262 (0x484cd8)
/opt/hostedtoolcache/go/1.25.0/x64/src/runtime/signal_unix.go:925 (0x484ca8)
/home/runner/work/OpenList/OpenList/drivers/chunk/driver.go:127 (0x1e91a64)
/home/runner/work/OpenList/OpenList/internal/op/fs.go:185 (0xc7e59c)
/home/runner/work/OpenList/OpenList/internal/fs/get.go:37 (0x11b3bea)
/home/runner/work/OpenList/OpenList/internal/fs/fs.go:44 (0x11b1afb)
/home/runner/work/OpenList/OpenList/drivers/crypt/driver.go:176 (0x1eb09c7)
/home/runner/work/OpenList/OpenList/internal/op/fs.go:185 (0xc7e59c)
/home/runner/work/OpenList/OpenList/internal/fs/get.go:37 (0x11b3bea)
/home/runner/work/OpenList/OpenList/internal/fs/fs.go:44 (0x11b1afb)
/home/runner/work/OpenList/OpenList/server/handles/fsup.go:63 (0x1971fc4)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.1/context.go:185 (0x117ccaa)
/home/runner/work/OpenList/OpenList/server/middlewares/limit.go:28 (0x1a07a78)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.1/context.go:185 (0x190f1f8)
/home/runner/work/OpenList/OpenList/server/middlewares/fsup.go:47 (0x190f0ab)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.1/context.go:185 (0x117ccaa)
/home/runner/work/OpenList/OpenList/server/middlewares/auth.go:74 (0x1a057f7)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.1/context.go:185 (0x190e23a)
/home/runner/work/OpenList/OpenList/server/middlewares/check.go:35 (0x190e228)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.1/context.go:185 (0x118a7ae)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.1/recovery.go:102 (0x118a79b)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.1/context.go:185 (0x1189884)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.1/logger.go:249 (0x118986b)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.1/context.go:185 (0x1188d0a)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.1/gin.go:644 (0x11886c7)
/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.1/gin.go:600 (0x11881ec)
/opt/hostedtoolcache/go/1.25.0/x64/src/net/http/server.go:3340 (0x7577ad)
/opt/hostedtoolcache/go/1.25.0/x64/src/net/http/server.go:2109 (0x7360c4)
/opt/hostedtoolcache/go/1.25.0/x64/src/runtime/asm_amd64.s:1693 (0x48ae20)
�[0m
[GIN] 2026/06/15 - 05:12:52 | 500 |  512.340296ms |      100.64.1.1 | PUT      "/api/fs/put"
[GIN] 2026/06/15 - 05:12:53 | 200 |   842.54275ms |      100.64.1.1 | POST     "/api/fs/list"

配置文件内容(必填)

{
  "force": false,
  "site_url": "",
  "cdn": "",
  "jwt_secret": "xxx",
  "token_expires_in": 48,
  "database": {
    "type": "sqlite3",
    "host": "",
    "port": 0,
    "user": "",
    "password": "",
    "name": "",
    "db_file": "data/data.db",
    "table_prefix": "x_",
    "ssl_mode": "",
    "dsn": ""
  },
  "meilisearch": {
    "host": "http://localhost:7700",
    "api_key": "",
    "index": "openlist"
  },
  "scheme": {
    "address": "0.0.0.0",
    "http_port": 5244,
    "https_port": -1,
    "force_https": false,
    "cert_file": "",
    "key_file": "",
    "unix_file": "",
    "unix_file_perm": "",
    "enable_h2c": false,
    "enable_h3": false
  },
  "temp_dir": "data/temp",
  "bleve_dir": "data/bleve",
  "dist_dir": "",
  "log": {
    "enable": true,
    "name": "data/log/log.log",
    "max_size": 50,
    "max_backups": 30,
    "max_age": 28,
    "compress": false,
    "filter": {
      "enable": false,
      "filters": [
        {
          "cidr": "",
          "path": "/ping",
          "method": ""
        },
        {
          "cidr": "",
          "path": "",
          "method": "HEAD"
        },
        {
          "cidr": "",
          "path": "/dav/",
          "method": "PROPFIND"
        }
      ]
    }
  },
  "delayed_start": 0,
  "auto_memory_limit": 4,
  "min_free_memory": 0,
  "max_block_limit": 0,
  "max_connections": 0,
  "max_concurrency": 64,
  "tls_insecure_skip_verify": false,
  "tasks": {
    "download": {
      "workers": 5,
      "max_retry": 1,
      "task_persistant": false
    },
    "transfer": {
      "workers": 5,
      "max_retry": 2,
      "task_persistant": false
    },
    "upload": {
      "workers": 5,
      "max_retry": 0,
      "task_persistant": false
    },
    "copy": {
      "workers": 5,
      "max_retry": 2,
      "task_persistant": false
    },
    "move": {
      "workers": 5,
      "max_retry": 2,
      "task_persistant": false
    },
    "decompress": {
      "workers": 5,
      "max_retry": 2,
      "task_persistant": false
    },
    "decompress_upload": {
      "workers": 5,
      "max_retry": 2,
      "task_persistant": false
    },
    "allow_retry_canceled": false
  },
  "cors": {
    "allow_origins": [
      "*"
    ],
    "allow_methods": [
      "*"
    ],
    "allow_headers": [
      "*"
    ]
  },
  "s3": {
    "enable": false,
    "port": 5246,
    "ssl": false
  },
  "ftp": {
    "enable": false,
    "listen": ":5221",
    "find_pasv_port_attempts": 50,
    "active_transfer_port_non_20": false,
    "idle_timeout": 900,
    "connection_timeout": 30,
    "disable_active_mode": false,
    "default_transfer_binary": false,
    "enable_active_conn_ip_check": true,
    "enable_pasv_conn_ip_check": true
  },
  "sftp": {
    "enable": false,
    "listen": ":5222"
  },
  "last_launched_version": "v4.2.2",
  "proxy_address": ""
}

复现链接(可选)

No response

AI生成内容(可选)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions