takoyaro / db-storage1111

automatic1111's stable-diffusion-webui extension for storing images to a database
49 stars 19 forks source link

Recommended method for setting environment variables? #6

Closed bagstoper closed 8 months ago

bagstoper commented 8 months ago

Hello,

Is there a recommended way to set the environment variables? I tried adding: export DB_USER="root" <- that to my activate file in the venv folder in the stablediffusion webui folder. That doesn't seem to be working as it is not saving anything to the mongoDB.

This seems to be the only way to do it but I am not sure how to go about debugging python code in a venv to check what those values are at runtime. I just suspect they are not being read correctly (because I don't think I set them correctly.

My next troubleshooting step is to set my values statically in the storage.py file and see if I get any different results.

bagstoper commented 8 months ago

So to answer my own questions: Hard coding my values, didn't make a difference but I did notice that I had a similar error message to #4 further investigating lead my to a possible solution for that issue and mine. If using docker for you mongoDB then make sure to expose its port correctly. I used the mongoDB docker compose file, I added volumes for persistence but forgot to expose the DB port but did expose the MongoExpress port.