- psycopg2.errors.FeatureNotSupported: extension “vector” is not available
默认的pg镜像不带有向量扩展,可选择另一个镜像
1docker run --name postgres-vector -p 25432:5432 -e POSTGRES_PASSWORD=postgres -d pgvector/pgvector:pg16
然后进入psql,执行
12\c dify或你自己的数据库名称CREATE EXTENSION "vector"; - ImportError: cannot import name ‘default_tfidf’ from ‘jieba.analyse’
1poetry run python -m pip install jieba --upgrade --force-reinstall - indexing_status始终为waiting即文档处于排队中的状态,注意要开启异步任务:
1poetry run python -m celery -A app.celery worker -P gevent -c 1 --loglevel INFO -Q dataset,generation,mail,ops_trace,app_deletion - psycopg2.errors.InsufficientPrivilege: permission denied to create extension “vector”
HINT: Must be superuser to create this extension.
如提示所述,需要将用户权限设置为超级管理员 - sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedColumn) column “source_url” of relation “upload_files” does not exist
以上为知识库通过 API 导入时的报错,应为跨版本新增字段所致,此为临时解决方案:
1ALTER TABLE upload_files ADD source_url VARCHAR(255)