-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
bug: default settings value always overides postgres configuration when using server #1362
Comments
had the same problem, setting these env variable worked for me MEMGPT_PG_DB |
Ok, thanks, that helps a lot. I'll have to figure out where those get imported in.. I think I'll work on a change to only do the substitution if those values are set. |
uggh.. my solution is a bit more hacky than what it already is. Since tests may rely upon a default being returned by setting.memgpt_pg_uri and I didn't see an easy way to make it NOT return the default, then I added a new property called setting.memgpt_pg_uri_no_default and it only returns a uri if the environment variables are set. Otherwise, it returns None and the config file uri continues to be used and not overwritten. |
This issue has been automatically closed due to 60 days of inactivity. |
https://github.com/cpacker/MemGPT/blob/7e5cf3e17093bc516f7947fba3dc4fcd0172a403/memgpt/server/server.py#L218
I don't understand why this routine is here because it appears to just override any configuration settings entered in by
memgpt configure
with what's insettings
but it never gets initialized with anything other than hardcoded default memgpt_pg_uri of:postgresql+pg8000://memgpt:memgpt@localhost:5432/memgpt
.You can test this by using postgres docker and in set the configuration set the connection string as follows:
? Enter postgres connection string (e.g. postgresql+pg8000://{user}:{password}@{ip}:5432/{database}): postgresql+pg8000://memgpt:memgpt@localhost:8888/memgpt
To verify its written, check the config file:
cat ~/.memgpt/config
Run the server with
memgpt server
and connection will be refused by the server because the connection string will be overwritten with a port of 5432, and then the config file gets saved!Run:
cat ~/.memgpt/config
and you'll see the 5432 has been written in place of 8888.
I tracked it down to the referenced routine, it just seems maybe it's something unfinished?
The text was updated successfully, but these errors were encountered: