labring / FastGPT

FastGPT is a knowledge-based platform built on the LLMs, offers a comprehensive suite of out-of-the-box capabilities such as data processing, RAG retrieval, and visual AI workflow orchestration, letting you easily develop and deploy complex question-answering systems without the need for extensive setup or configuration.
https://tryfastgpt.ai
Other
17.5k stars 4.7k forks source link

由于内核问题,导致PG启动失败(error: program "postgres" is needed by initdb but was not found in the same directory as "/usr/lib/postgresql/15/bin/initdb") #1061

Closed ZDF64 closed 7 months ago

ZDF64 commented 7 months ago

例行检查

你的版本

问题描述 按照docker-compose部署方法启动后,打印日志发现后台报错 pg | popen failure: Cannot allocate memory pg | initdb: error: program "postgres" is needed by initdb but was not found in the same directory as "/usr/lib/postgresql/15/bin/initdb"

这个问题导致ankane/pgvector:v0.5.0反复重启,无法正常运作 image

但同样,我在windows环境中部署则没有发生问题 FastGPT功能正常,log中也没有报错信息 复现步骤 环境:CentOS 7.9 image

预期结果

相关截图 image

c121914yu commented 7 months ago

内核太低了

ZDF64 commented 7 months ago

内核太低了

您的意思,就是系统版本太久了,是么

ZDF64 commented 7 months ago

折腾了一晚上,查阅到了相关一个资料 https://qiita.com/Y__Mori/items/51090da0fe13520ac14a 需要特殊的postgres版本,也就是postgres:15-bullseye 于是我下载了git@github.com:pgvector/pgvector.git 更改了Dockerfile ------------Dockerfile--------------

ARG PG_MAJOR=15-bullseye FROM postgres:$PG_MAJOR ARG PG_MAJOR COPY . /tmp/pgvector RUN apt-get update && \ apt-mark hold locales && \ apt-get install -y --no-install-recommends build-essential postgresql-server-dev-$PG_MAJOR && \ cd /tmp/pgvector && \ make clean && \ make OPTFLAGS="" && \ make install && \ mkdir /usr/share/doc/pgvector && \ cp LICENSE README.md /usr/share/doc/pgvector && \ rm -r /tmp/pgvector && \ apt-get remove -y build-essential postgresql-server-dev-$PG_MAJOR && \ apt-get autoremove -y && \ apt-mark unhold locales && \ rm -rf /var/lib/apt/lists/* ------------Dockerfile-------------- 重新制作镜像放到本地库 image image 然后在修改docker-compose.yml引入刚才做好的image image 之后再启动就不报错了,FastGPT也能正常登陆了 image

c121914yu commented 7 months ago

折腾了一晚上,查阅到了相关一个资料 https://qiita.com/Y__Mori/items/51090da0fe13520ac14a 需要特殊的postgres版本,也就是postgres:15-bullseye 于是我下载了git@github.com:pgvector/pgvector.git 更改了Dockerfile ------------Dockerfile--------------

ARG PG_MAJOR=15-bullseye FROM postgres:$PG_MAJOR ARG PG_MAJOR COPY . /tmp/pgvector RUN apt-get update && \ apt-mark hold locales && \ apt-get install -y --no-install-recommends build-essential postgresql-server-dev-$PG_MAJOR && \ cd /tmp/pgvector && \ make clean && \ make OPTFLAGS="" && \ make install && \ mkdir /usr/share/doc/pgvector && \ cp LICENSE README.md /usr/share/doc/pgvector && \ rm -r /tmp/pgvector && \ apt-get remove -y build-essential postgresql-server-dev-$PG_MAJOR && \ apt-get autoremove -y && \ apt-mark unhold locales && \ rm -rf /var/lib/apt/lists/* ------------Dockerfile-------------- 重新制作镜像放到本地库 image image 然后在修改docker-compose.yml引入刚才做好的image image 之后再启动就不报错了,FastGPT也能正常登陆了 image

大佬牛逼。 这个确实挺坑的,我之前 centos7 也初始化不了。 后面是找了个 unbuntu 运行后,直接把 data 目录拷贝回去,这样就不用初始化了。

c121914yu commented 5 months ago

引用之前 issue https://github.com/labring/FastGPT/issues/784

据说增加 privileged=true 也可以解决