AlistGo / AlistGo/alist

sftp连接失败,因为有网络波动问题,连接失败,网络恢复之后没有自动重连.

Ouverte
#8,490 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
bug
Langage dominant
Go
Étoiles
50.2k
Forks
7.9k
Merge moyen
7 j 21 h
PR mergées (30 j)
6

Description

### Please make sure of the following things

- [x] I have read the [documentation](https://alist.nn.ci).
我已经阅读了[文档](https://alist.nn.ci)。

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

- [x] I'm sure it's due to `AList` and not something else(such as [Network](https://alist.nn.ci/faq/howto.html#tls-handshake-timeout-read-connection-reset-by-peer-dns-lookup-failed-connect-connection-refused-client-timeout-exceeded-while-awaiting-headers-no-such-host) ,`Dependencies` or `Operational`).
我确定是`AList`的问题,而不是其他原因(例如[网络](https://alist.nn.ci/zh/faq/howto.html#tls-handshake-timeout-read-connection-reset-by-peer-dns-lookup-failed-connect-connection-refused-client-timeout-exceeded-while-awaiting-headers-no-such-host),`依赖`或`操作`)。

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

### AList Version / AList 版本

v3.44.0

### Driver used / 使用的存储驱动

sftp

### Describe the bug / 问题描述

sftp连接失败,因为有网络波动问题,连接失败,网络恢复之后没有自动重连.

特别是对于笔记本电脑来说,问题更加严重!!!!!!!!!!比如说alist启动时,还没有连上无线网络!

```
ERRO[2025-05-06 21:58:06] failed get enabled storages: dial tcp 10.200.200.3:8022: connect: connection refused

failed init storage

github.com/alist-org/alist/v3/internal/op.initStorage

/home/runner/work/alist/alist/internal/op/storage.go:139

github.com/alist-org/alist/v3/internal/op.LoadStorage

/home/runner/work/alist/alist/internal/op/storage.go:83

github.com/alist-org/alist/v3/internal/bootstrap.LoadStorages.func1

/home/runner/work/alist/alist/internal/bootstrap/storage.go:20

runtime.goexit

/opt/hostedtoolcache/go/1.24.1/x64/src/runtime/asm_amd64.s:1700
```

### Reproduction / 复现链接

```json
[
{
"Id": "e2e4be7499882faad33e024439b44f67200c23a746480be9fbd28e0205261010",
"Created": "2025-04-22T17:32:14.103893312Z",
"Path": "/entrypoint.sh",
"Args": [],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 35786,
"ExitCode": 0,
"Error": "",
"StartedAt": "2025-05-06T13:43:05.111472447Z",
"FinishedAt": "2025-05-06T13:43:00.495919804Z"
},
"Image": "sha256:63e79ce3820411430c2dbc992e730db025aa0b265b6eeb17a449abe3288bf2d4",
"ResolvConfPath": "/mnt/f6c1575f-5826-425d-8dbe-9d69e0aa30f4/var/lib/docker/containers/e2e4be7499882faad33e024439b44f67200c23a746480be9fbd28e0205261010/resolv.conf",
"HostnamePath": "/mnt/f6c1575f-5826-425d-8dbe-9d69e0aa30f4/var/lib/docker/containers/e2e4be7499882faad33e024439b44f67200c23a746480be9fbd28e0205261010/hostname",
"HostsPath": "/mnt/f6c1575f-5826-425d-8dbe-9d69e0aa30f4/var/lib/docker/containers/e2e4be7499882faad33e024439b44f67200c23a746480be9fbd28e0205261010/hosts",
"LogPath": "/mnt/f6c1575f-5826-425d-8dbe-9d69e0aa30f4/var/lib/docker/containers/e2e4be7499882faad33e024439b44f67200c23a746480be9fbd28e0205261010/e2e4be7499882faad33e024439b44f67200c23a746480be9fbd28e0205261010-json.log",
"Name": "/alist",
"RestartCount": 17,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "unconfined",
"ExecIDs": null,
"HostConfig": {
"Binds": [
"/:/mnt/host",
"/root/alist-data/docker_data/alist:/opt/alist/data"
],
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {
"max-file": "3",
"max-size": "10m"
}
},
"NetworkMode": "host",
"PortBindings": {
"5244/tcp": [
{
"HostIp": "",
"HostPort": "5244"
}
]
},
"RestartPolicy": {
"Name": "always",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"ConsoleSize": [
0,
0
],
"CapAdd": [
"AUDIT_WRITE",
"CHOWN",
"DAC_OVERRIDE",
"FOWNER",
"FSETID",
"KILL",
"MKNOD",
"NET_BIND_SERVICE",
"NET_RAW",
"SETFCAP",
"SETGID",
"SETPCAP",
"SETUID",
"SYS_CHROOT"
],
"CapDrop": [
"AUDIT_CONTROL",
"BLOCK_SUSPEND",
"DAC_READ_SEARCH",
"IPC_LOCK",
"IPC_OWNER",
"LEASE",
"LINUX_IMMUTABLE",
"MAC_ADMIN",
"MAC_OVERRIDE",
"NET_ADMIN",
"NET_BROADCAST",
"SYSLOG",
"SYS_ADMIN",
"SYS_BOOT",
"SYS_MODULE",
"SYS_NICE",
"SYS_PACCT",
"SYS_PTRACE",
"SYS_RAWIO",
"SYS_RESOURCE",
"SYS_TIME",
"SYS_TTY_CONFIG",
"WAKE_ALARM"
],
"CgroupnsMode": "private",
"Dns": [],
"DnsOptions": [],
"DnsSearch": [],
"ExtraHosts": [],
"GroupAdd": null,
"IpcMode": "private",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": true,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": [
"label=disable"
],
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 67108864,
"Runtime": "runc",
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": null,
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": [],
"DeviceCgroupRules": null,
"DeviceRequests": [],
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": null,
"PidsLimit": null,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0,
"MaskedPaths": null,
"ReadonlyPaths": null,
"Init": false
},
"GraphDriver": {
"Data": {
"ID": "e2e4be7499882faad33e024439b44f67200c23a746480be9fbd28e0205261010",
"LowerDir": "/mnt/f6c1575f-5826-425d-8dbe-9d69e0aa30f4/var/lib/docker/overlay2/4a23a3501859f46274a3705e07977c8e78dbe1808a409afe33dd28744901bfa9-init/diff:/mnt/f6c1575f-5826-425d-8dbe-9d69e0aa30f4/var/lib/docker/overlay2/eb3cff695a16d9ddfe1974c51f63110d243016e1863ec81a620b7768256b67dd/diff:/mnt/f6c1575f-5826-425d-8dbe-9d69e0aa30f4/var/lib/docker/overlay2/621c2f180c7036784d4a893197728462221b601af413b49b035812a1b04af943/diff:/mnt/f6c1575f-5826-425d-8dbe-9d69e0aa30f4/var/lib/docker/overlay2/c151200e85040d8dc40ae2e2c4f2db275f7eec58f2e0b462b148427a581cb9fa/diff:/mnt/f6c1575f-5826-425d-8dbe-9d69e0aa30f4/var/lib/docker/overlay2/338cc790589719515cedd56c47df5124476e738c03eb9f02eb9e7f6a3e3394ce/diff:/mnt/f6c1575f-5826-425d-8dbe-9d69e0aa30f4/var/lib/docker/overlay2/b31e668776c2d4c599b7f2418b0b02bdbd570987ef4d03a6f2c43239cd7eddcf/diff:/mnt/f6c1575f-5826-425d-8dbe-9d69e0aa30f4/var/lib/docker/overlay2/677f9723b4416321042121e2804a06b501550f682d4bb9639e554146d4b37989/diff",
"MergedDir": "/mnt/f6c1575f-5826-425d-8dbe-9d69e0aa30f4/var/lib/docker/overlay2/4a23a3501859f46274a3705e07977c8e78dbe1808a409afe33dd28744901bfa9/merged",
"UpperDir": "/mnt/f6c1575f-5826-425d-8dbe-9d69e0aa30f4/var/lib/docker/overlay2/4a23a3501859f46274a3705e07977c8e78dbe1808a409afe33dd28744901bfa9/diff",
"WorkDir": "/mnt/f6c1575f-5826-425d-8dbe-9d69e0aa30f4/var/lib/docker/overlay2/4a23a3501859f46274a3705e07977c8e78dbe1808a409afe33dd28744901bfa9/work"
},
"Name": "overlay2"
},
"Mounts": [
{
"Type": "bind",
"Source": "/",
"Destination": "/mnt/host",
"Mode": "",
"RW": true,
"Propagation": "rslave"
},
{
"Type": "bind",
"Source": "/root/alist-data/docker_data/alist",
"Destination": "/opt/alist/data",
"Mode": "",
"RW": true,
"Propagation": "rprivate"
}
],
"Config": {
"Hostname": "4129589df0ce",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"5244/tcp": {},
"5245/tcp": {}
},
"Tty": true,
"OpenStdin": true,
"StdinOnce": false,
"Env": [
"RUN_ARIA2=false",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/alist",
"PUID=0",
"PGID=0",
"TZ=Asia/Shanghai",
"UMASK=022"
],
"Cmd": [
"/entrypoint.sh"
],
"Image": "xhofe/alist:latest",
"Volumes": {
"/mnt/host": {},
"/opt/alist/data": {},
"/opt/alist/data/": {}
},
"WorkingDir": "/opt/alist",
"Entrypoint": null,
"OnBuild": null,
"Labels": {
"MAINTAINER": "i@nn.ci",
"com.docker.compose.config-hash": "c3965057b949c54a83e6a9cbf71177483daa1e155a2bcdbcc91e189a5ae883fa",
"com.docker.compose.container-number": "1",
"com.docker.compose.depends_on": "",
"com.docker.compose.image": "sha256:63e79ce3820411430c2dbc992e730db025aa0b265b6eeb17a449abe3288bf2d4",
"com.docker.compose.oneoff": "False",
"com.docker.compose.project": "alist",
"com.docker.compose.project.config_files": "",
"com.docker.compose.project.working_dir": "/data/compose/49",
"com.docker.compose.replace": "5a34c818069035ac14bb376812b6d380a9b09c2ff196e501329bb9814b73be6c",
"com.docker.compose.service": "alist",
"com.docker.compose.version": "",
"org.opencontainers.image.created": "2025-01-27T16:05:25.639Z",
"org.opencontainers.image.description": "🗂️A file list/WebDAV program that supports multiple storages, powered by Gin and Solidjs. / 一个支持多存储的文件列表/WebDAV程序,使用 Gin 和 Solidjs。",
"org.opencontainers.image.licenses": "AGPL-3.0",
"org.opencontainers.image.revision": "226c34929a8bf7154bcf6c9f701c78da356c7ce5",
"org.opencontainers.image.source": "https://github.com/AlistGo/alist",
"org.opencontainers.image.title": "alist",
"org.opencontainers.image.url": "https://github.com/AlistGo/alist",
"org.opencontainers.image.version": "v3.42.0"
}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "6fc3feb73970665a643dfe51e465305d9f427894302a579559d0600855766b94",
"SandboxKey": "/var/run/docker/netns/default",
"Ports": {},
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"MacAddress": "",
"Networks": {
"host": {
"IPAMConfig": {},
"Links": null,
"Aliases": null,
"MacAddress": "",
"DriverOpts": null,
"GwPriority": 0,
"NetworkID": "1423ba69e3e52e3caaecd768c85dd2dce3f708965b957b245cff4281742299e3",
"EndpointID": "a61e43df35179354b9012c10fd9ab936c2134937c03039a500269f481f49b4ba",
"Gateway": "",
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"DNSNames": null
}
}
}
}
]
```

### Config / 配置

```json
{
"code": 200,
"message": "success",
"data": {
"id": 16,
"mount_path": "/minio",
"order": 0,
"driver": "SFTP",
"cache_expiration": 30,
"status": "work",
"addition": "{\"address\":\"10.200.200.3:8022\",\"username\":\"\",\"private_key\":\"\",\"password\":\"\",\"passphrase\":\"\",\"root_folder_path\":\"/\",\"ignore_symlink_error\":false}",
"remark": "",
"modified": "2025-05-06T23:29:10.8236002+08:00",
"disabled": false,
"disable_index": false,
"enable_sign": false,
"order_by": "",
"order_direction": "",
"extract_folder": "front",
"web_proxy": false,
"webdav_policy": "native_proxy",
"proxy_range": false,
"down_proxy_url": ""
}
}
```

### Logs / 日志

```
ERRO[2025-05-06 21:58:06] failed get enabled storages: dial tcp 10.200.200.3:8022: connect: connection refused

failed init storage

github.com/alist-org/alist/v3/internal/op.initStorage

/home/runner/work/alist/alist/internal/op/storage.go:139

github.com/alist-org/alist/v3/internal/op.LoadStorage

/home/runner/work/alist/alist/internal/op/storage.go:83

github.com/alist-org/alist/v3/internal/bootstrap.LoadStorages.func1

/home/runner/work/alist/alist/internal/bootstrap/storage.go:20

runtime.goexit

/opt/hostedtoolcache/go/1.24.1/x64/src/runtime/asm_amd64.s:1700
```

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.