chroma
chroma copied to clipboard
duckdb.IOException: IO Error: Can't find the home directory at ''
client = chromadb.Client(Settings(
chroma_db_impl="duckdb+parquet",
persist_directory="/home/chromadb"
))
if i start the app with supervisorctl, there is an error:
File "/usr/local/lib/python3.8/site-packages/chromadb/db/duckdb.py", line 50, in __init__
self._conn.execute("INSTALL 'json';")
duckdb.IOException: IO Error: Can't find the home directory at ''
Specify a home directory using the SET home_directory='/path/to/dir' option.
Exception ignored in: <function PersistentDuckDB.__del__ at 0x7f467e032790>
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/chromadb/db/duckdb.py", line 436, in __del__
self.persist()
File "/usr/local/lib/python3.8/site-packages/chromadb/db/duckdb.py", line 390, in persist
self._conn.execute(
duckdb.IOException: IO Error: Cannot open file "None/chroma-embeddings.parquet": No such file or directory
@harry0703 does the home
directory already exist on your machine?
@harry0703 does the
home
directory already exist on your machine? thank you for your reply.
yes, the home directory is exist.
If i run the app in working dir, it works well.
cd /home/www/chatbot
nohup /usr/local/bin/uvicorn --host 0.0.0.0 main:app --port 4003 --workers 1 > /var/log/supervisor/chatbot.log 2>&1 &
but it doesn't work in supervisord
[program:chatbot]
process_name=chatbot
directory=/home/www/chatbot
command=/usr/local/bin/uvicorn --host 0.0.0.0 main:app --port 4003 --workers 1
numprocs=1
user=root
autostart=true
autorestart=true
redirect_stderr=true
stopasgroup=true
killasgroup=true
stopsignal=INT
stdout_logfile=/var/log/supervisor/chatbot.log
below is my python code:
class ChromaUtils:
def __init__(self, persist_directory: str = 'chromadb', embedding_function: Callable = None):
# os.putenv('home_directory', persist_directory)
# # duckdb.IOException: IO Error: Can't find the home directory at ''
# # Specify a home directory using the SET home_directory='/path/to/dir' option.
# os.environ['home_directory'] = persist_directory
self._collection_name_posts = 'posts'
self._collection_name_prompts = 'prompts'
self.client = chromadb.Client(Settings(
chroma_db_impl="duckdb+parquet",
persist_directory=persist_directory # Optional, defaults to .chromadb/ in the current directory
))
self.collection_posts = self.client.get_or_create_collection(name=self._collection_name_posts, embedding_function=embedding_function)
self.collection_prompts = self.client.get_or_create_collection(name=self._collection_name_prompts, embedding_function=embedding_function)
i'm having the same issue
With the launch of Chroma 0.4
- duckdb is no longer a dependency and this should be fixed!