Accidentally Bricked Odoo and can't roll back to a working system

I successfully built Odoo 18 and could access it on the bew browser.
Got a database creation denied a couple of times from the web UI, so I tried to delete postgresql in my system to “redownload and reinstall it”.
Now everything is bricked, the web ui tells me there is an internal server error, can’t use a past version on boot to solve that…

Do I need to reinstall Nixos from scratch or there is a way to save it ?

The rest of the pc works 10/10, just really wanted odoo to work after spending a week on that thing

While I’m not familiar with odoo, here are some questions which might help someone else help you.

  1. How did you build odoo, did you use the NixOS module?
  2. Did you have odoo previously installed?
  3. How did you delete postgresql?
  4. What entries show when running journalctl -u postgresql -u odoo

I appreciate the help !

Built Odoo with:
services.odoo = {
enable = true;
autoInit = true;
};

That way it has odoo, and the database(postgresql) in one place, so I didnt have to deal with postgresql myself.

I thought it was a postgresql internal error that didnt let me create a new database from the ui so I went to /var/lib/ to find postgresql.
I couldnt delete the folder there, so went a layer deeper and deleted the folder 15 (the version I assume).

Then sudo nixos-rebuild switch

Still the same creation denial, so I tried to delete the already created database from odoo web ui, succeeded in ghe deletion and it all went bad shortly after…

Edit: the reason I tried deleting postgresql that way is because doing that allowed me to “save it” for the first time, as it had internal conflict from past to new versions or something like that

Edit2: there is alot of stuff that shows up when doing the journalctl (5838 lines total)
Last one is:
relation “ir_modulr_module” does not exist
odoo tried to poll an undefined table on database odoo.

Higher up: KeyError: ‘ir.http’

Did manage to save it !
Thanks alot for
journalctl -u postgresql -u odoo , this is what saved it for me !!

Managed to google the error and stumbled upon the odoo forum about that exact problem.

Had to: sudo su - postgres 》psql 》 list

Then reset the whole database with this:
DROP DATABASE odoo WITH (FORCE);

Now I can successfully access the web ui, still need to solve that permission to create a database from ui tho… That is for another post !