justxuewei / cloudreve-docker

Source code of Docker image for Cloudreve V3
https://hub.docker.com/r/xavierniu/cloudreve
MIT License
220 stars 51 forks source link

新装docker容器无法启动。提示无法连接db。 #44

Closed 7th-heaven closed 3 years ago

7th-heaven commented 3 years ago

日志提示: mv: cannot stat 'cloudreve.db': No such file or directory

除此之外,还会在conf.ini中自动添加一段相同的[Database]

justxuewei commented 3 years ago

请问你是升级还是新安装呢?

7th-heaven commented 3 years ago

请问你是升级还是新安装呢?

新安装呀

7th-heaven commented 3 years ago

试了一下配置成mariadb,提示说 panic: 连接数据库不成功, Error 1049: Unknown database 'v3'

看起来像是不会自动初始化数据库。

justxuewei commented 3 years ago

已确认

justxuewei commented 3 years ago

已修复,请等待GitHub Action结束后测试一下。

sarkrui commented 3 years ago

刚刚新装测试过,没办法直接安装的。

无法解析配置文件 '/cloudreve/conf.ini': BOM: read /cloudreve/conf.ini: is a directory panic: 无法解析配置文件 '/cloudreve/conf.ini': BOM: read /cloudreve/conf.ini: is a directory

查了一下过往的 issue,原本是想免手动创建 cloudreve.dbconf.ini,但实际测试创建的是其实是文件夹,手动删除后,重新

touch cloudreve.db && touch conf.ini

才可以成功开机。

justxuewei commented 3 years ago

刚刚新装测试过,没办法直接安装的。

无法解析配置文件 '/cloudreve/conf.ini': BOM: read /cloudreve/conf.ini: is a directory panic: 无法解析配置文件 '/cloudreve/conf.ini': BOM: read /cloudreve/conf.ini: is a directory

查了一下过往的 issue,原本是想免手动创建 cloudreve.dbconf.ini,但实际测试创建的是其实是文件夹,手动删除后,重新

touch cloudreve.db && touch conf.ini

才可以成功开机。

请问你是老版本升级还是新安装?能否给出你的复现过程以及原有版本(如果有的话)?

7th-heaven commented 3 years ago

我重试了新版本,此问题已解决。 但是【可能】导致了下面这个新的数据持久化的问题。

46

sarkrui commented 3 years ago

请问你是老版本升级还是新安装?能否给出你的复现过程以及原有版本(如果有的话)?

xavierniu/cloudreve 镜像是新安装,之前倒是用其他源安装,但确保删除 appdata了。

image

Cloudreve docker 是用的 BlueFang/unraid-docker-templates 直接拉取的,镜像源是 xavierniu/cloudreve。刚刚重新拉取一个 cloudreve2,log如下:

./entrypoint.sh: line 14: /cloudreve/conf.ini: Is a directory ./entrypoint.sh: line 14: /cloudreve/config/conf.ini: No such file or directory Found config at , it has been moved to mv: cannot remove '/cloudreve/conf.ini': Resource busy ./entrypoint.sh: line 17: /cloudreve/config/conf.ini: Is a directory ./entrypoint.sh: line 20: /cloudreve/cloudreve.db: Is a directory ./entrypoint.sh: line 20: /cloudreve/db/cloudreve.db: No such file or directory Move the database file from to mv: cannot remove '/cloudreve/cloudreve.db': Resource busy

V3.3.2 Commit #a11f819 Pro=false

[Panic] 2021-07-15 15:55:47 无法解析配置文件 '/cloudreve/config/conf.ini': BOM: read /cloudreve/config/conf.ini: is a directory panic: 无法解析配置文件 '/cloudreve/config/conf.ini': BOM: read /cloudreve/config/conf.ini: is a directory

goroutine 1 [running]: github.com/cloudreve/Cloudreve/v3/pkg/util.(*Logger).Panic(0xc00013a560, 0x11f24b1, 0x21, 0xc00029fac0, 0x2, 0x2) /ProjectCloudreve/Cloudreve/pkg/util/logger.go:74 +0xe5 github.com/cloudreve/Cloudreve/v3/pkg/conf.Init(0x7ffe0245ff0a, 0x1a) /ProjectCloudreve/Cloudreve/pkg/conf/conf.go:122 +0x1de github.com/cloudreve/Cloudreve/v3/bootstrap.Init(0x7ffe0245ff0a, 0x1a) /ProjectCloudreve/Cloudreve/bootstrap/init.go:18 +0x3e main.init.0() /ProjectCloudreve/Cloudreve/main.go:23 +0x205

justxuewei commented 3 years ago

请问你是老版本升级还是新安装?能否给出你的复现过程以及原有版本(如果有的话)?

xavierniu/cloudreve 镜像是新安装,之前倒是用其他源安装,但确保删除 appdata了。

image

Cloudreve docker 是用的 BlueFang/unraid-docker-templates

直接拉取的,镜像源是 xavierniu/cloudreve。刚刚重新拉取一个 cloudreve2,log如下:

./entrypoint.sh: line 14: /cloudreve/conf.ini: Is a directory

./entrypoint.sh: line 14: /cloudreve/config/conf.ini: No such file or directory

Found config at , it has been moved to

mv: cannot remove '/cloudreve/conf.ini': Resource busy

./entrypoint.sh: line 17: /cloudreve/config/conf.ini: Is a directory

./entrypoint.sh: line 20: /cloudreve/cloudreve.db: Is a directory

./entrypoint.sh: line 20: /cloudreve/db/cloudreve.db: No such file or directory

Move the database file from to

mv: cannot remove '/cloudreve/cloudreve.db': Resource busy

V3.3.2 Commit #a11f819 Pro=false

[Panic] 2021-07-15 15:55:47 无法解析配置文件 '/cloudreve/config/conf.ini': BOM: read /cloudreve/config/conf.ini: is a directory

panic: 无法解析配置文件 '/cloudreve/config/conf.ini': BOM: read /cloudreve/config/conf.ini: is a directory

goroutine 1 [running]:

github.com/cloudreve/Cloudreve/v3/pkg/util.(*Logger).Panic(0xc00013a560, 0x11f24b1, 0x21, 0xc00029fac0, 0x2, 0x2)

/ProjectCloudreve/Cloudreve/pkg/util/logger.go:74 +0xe5

github.com/cloudreve/Cloudreve/v3/pkg/conf.Init(0x7ffe0245ff0a, 0x1a)

/ProjectCloudreve/Cloudreve/pkg/conf/conf.go:122 +0x1de

github.com/cloudreve/Cloudreve/v3/bootstrap.Init(0x7ffe0245ff0a, 0x1a)

/ProjectCloudreve/Cloudreve/bootstrap/init.go:18 +0x3e

main.init.0()

/ProjectCloudreve/Cloudreve/main.go:23 +0x205

我的建议是你删除所有与cloudreve有关的文件,如果你需要保存数据,仅保留conf.ini、cloudreve.db以及一些持久化的文件夹,然后用docker pull命令拉取最新的镜像,最后根据教程重新启动容器。