InvokeAI icon indicating copy to clipboard operation
InvokeAI copied to clipboard

[bug]: Issues with the database maintenance script, invokeai.yaml settings ignored

Open mcbexx opened this issue 1 year ago • 2 comments

Is there an existing issue for this problem?

  • [X] I have searched the existing issues

Operating system

Windows

GPU vendor

Nvidia (CUDA)

GPU model

No response

GPU VRAM

No response

Version number

4.0.4

Browser

Firefox 124.0.2

Python dependencies

No response

What happened

Started the DB Maintenance script, wanted a) to remove orphaned files and b) rebuild the database with 3 images I accidentally deleted from the gallery and restored from the Windows Recycle Bin.

Upon running the script to remove orphaned images, ALL images were removed from my boards and galleries.

After some prodding around, I noticed that

  • the Database Maintenance script still launches as "for Invoke AI 3.0.0 +"
  • script says

The invokeai.yaml file was found but is missing the db_dir setting! Defaulting to databases The invokeai.yaml file was found but is missing the outdir setting! Defaulting to outputs Found invokeai.yaml file at H:\InvokeAI\invokeai.yaml: Database : H:\InvokeAI\databases\invokeai.db - Exists! Outputs : H:\InvokeAI\outputs\images- Exists!

Im my invoke.yaml, only the DB path was present, I manually added outputs_dir:

After running the script once and after all files were pruned, the database was empty, so I grabbed the one from the backup folder (good call to create one automatically, unironically thanks) and replaced the existing one.

Upon launching the Web GUI, I got an error message that invokeai.db could not be created as it already existed (in \invokeAI\databases), so I deleted it (still had the backup in the backup folder) and launched invokeai.bat again. This time, it lauched - but now it created an additional folder and put the invokeai.db file there. The full path to the db file now is \invokeai\databases\invokeai.db\invokeai.db whereas I'm pretty sure before it was \invokeai\databases\invokeai.db

Now I copied the backup file over as \invokeai\databases\invokeai.db\invokeai.db, relaunched the GUI and, thankfully, all images were back in their corresponding boards.

Still can't seem to run the Database Maintenance script though, as it still claims the output_dir and db_dir are not set and it reverts to the default settings (as quoted above)

This is my invokeai.yaml file

`# Internal metadata - do not edit: schema_version: 4.0.0

Put user settings here:

db_dir: H:\InvokeAI\databases\invokeai.db
outputs_dir: K:_Stable Diffusion Output Archive_Outputs ram: 8.0`

What you expected to happen

I expected the DB Maintenance script to acknowledge and use the settings I put in my invokeai.yaml file and not revert to its default directories, which did not contain the necessary and correct information and therefore pruned my gallery of all images, as they were considered orphaned.

How to reproduce the problem

No response

Additional context

No response

Discord username

No response

mcbexx avatar Apr 09 '24 22:04 mcbexx

Yikes, sorry about this. It's the same root cause as #6103.

psychedelicious avatar Apr 19 '24 00:04 psychedelicious

Thanks for acknowledging. I simply just won't use the script for the time being. As I said, good thing there's an automatic database backup to fall back to. Maybe you could for the time being add an entry to the troubleshooting pages in case someone else runs into the issue and thinks their images are gone?

mcbexx avatar Apr 19 '24 01:04 mcbexx