种地 发表于 2025-4-15 00:38:42

dify 1.0 报错FATAL: data directory “/var/lib/postgresql/data/pgdata“ has invalid p

Windows下Docker  dify 安装报错

FATAL:  data directory "/var/lib/postgresql/data/pgdata" has invalid permissions
https://i-blog.csdnimg.cn/direct/ce21128b4e54464b8c5b5a308ce6527b.png
两个容器没有起来,看一下日记:

https://i-blog.csdnimg.cn/direct/7f9e0f4d249c4ef292cca364142eb00e.png
2025-03-05 17:29:59 initdb: removing contents of data directory "/var/lib/postgresql/data/pgdata"
2025-03-05 17:31:01 2025-03-05 09:31:01.111 UTC FATAL:  data directory "/var/lib/postgresql/data/pgdata" has invalid permissions
2025-03-05 17:31:01 2025-03-05 09:31:01.111 UTC DETAIL:  Permissions should be u=rwx (0700) or u=rwx,g=rx (0750).
2025-03-05 17:31:01 child process exited with exit code 1
2025-03-05 17:31:01 initdb: removing contents of data directory "/var/lib/postgresql/data/pgdata"
2025-03-05 17:32:02 creating subdirectories ... ok
2025-03-05 17:32:02 selecting dynamic shared memory implementation ... posix
2025-03-05 17:32:02 selecting default max_connections ... 20
2025-03-05 17:32:02 selecting default shared_buffers ... 400kB
2025-03-05 17:32:02 selecting default time zone ... UTC
2025-03-05 17:32:02 creating configuration files ... ok
2025-03-05 17:32:02 2025-03-05 09:32:02.874 UTC FATAL:  data directory "/var/lib/postgresql/data/pgdata" has invalid permissions
2025-03-05 17:32:02 2025-03-05 09:32:02.874 UTC DETAIL:  Permissions should be u=rwx (0700) or u=rwx,g=rx (0750).
2025-03-05 17:32:02 child process exited with exit code 1
2025-03-05 17:32:02 initdb: removing contents of data directory "/var/lib/postgresql/data/pgdata"
2025-03-05 17:32:03 running bootstrap script ... 

发现目次权限问题;

目次的当前权限设置
PostgreSQL 对其数据目次有严格的权限要求。通常,数据目次应该归 postgres 用户和组所有,并且权限应该设置为 700(即只有所有者有读、写和执行权限)。
假如权限设置不正确,你需要进行调整。
1.修改dify/docker/docker-compose.yaml配置文件

https://i-blog.csdnimg.cn/direct/6fd9d0f58c7c43029fcdad72c1d92944.png
   
[*] 改成:
[*] volumes:
- /volumes/db/data:/var/lib/postgresql/data
https://i-blog.csdnimg.cn/direct/92d29c652da94540ba7dc5c52a8d71d9.png

然后继续执行:

E:\deepseek\dify-1.0.0\docker>docker compose up -d
再看都已经好了

https://i-blog.csdnimg.cn/direct/5bb9c83b9b8f4f28aa827fba44d0f74c.png

这时候发现还不行
https://i-blog.csdnimg.cn/direct/6f4149e08b8640f6bda908cc37dfa379.png
docker-plugin_daemon-1 也在报错

https://i-blog.csdnimg.cn/direct/0472a1e14aee40348c34d78069bac472.png

修改 docker-compose.yaml 中  docker-plugin_daemon-1 的配置

   - ./volumes/plugin_daemon:/app/storage
修改为:
- /volumes/plugin_daemon:/app/storage
然后再执行下令跟新
   E:\deepseek\dify-1.0.0\docker>docker compose up -d
https://i-blog.csdnimg.cn/direct/161dba8daf5143ac98c69335174f5a3d.png
已经没有了报错日记


https://i-blog.csdnimg.cn/direct/ab2f0ba73eca42528aa66068b64e65da.png
这时候再访问:发现已经好了Difyhttps://csdnimg.cn/release/blog_editor_html/release2.3.8/ckeditor/plugins/CsdnLink/icons/icon-default.png?t=P1C7http://localhost/install https://i-blog.csdnimg.cn/direct/51661f9f2faa4e969288eb30b898c226.png

注册之后发现已经好了

https://i-blog.csdnimg.cn/direct/9169ed6178f44ff592a1461a7c1cea78.png



免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: dify 1.0 报错FATAL: data directory “/var/lib/postgresql/data/pgdata“ has invalid p