rommapp / romm

A beautiful, powerful, self-hosted rom manager
https://romm.app
GNU Affero General Public License v3.0
1.77k stars 80 forks source link

[Bug] Looping "exited with code 0" "Something went horribly wrong with our database" #927

Closed F1zzyD closed 2 months ago

F1zzyD commented 3 months ago

RomM version Version of RomM you are using Latest: 3.2.0

Describe the bug A clear and concise description of what the bug is. Docker runs a never-ending loop when attempting to start RomM, ending with ""exited with code 0" "Something went horribly wrong with our database"

To Reproduce Steps to reproduce the behavior: Load the docker.yaml with "docker compose up" or "docker compose up -d"

Expected behavior RomM loads webpage at specified port

Desktop (please complete the following information):

Additional context Add any other context about the problem here. I followed the many different guides that are posted on the website (https://romm.app/) and GitHub (https://github.com/rommapp/romm?tab=readme-ov-file#installation / https://github.com/rommapp/romm/wiki/Quick-Start-Guide) and all roads lead to this same error. I did hack something together where it started correctly with completely wrong environments, however now RomM refuses to run even after a purge. I've gone through the links that the logs give me, but all of those lead to the answer "it could be anything, check the source code". I've attached the latest revision of my compose.yaml. I have used the .env detailed in one of the guides, but that doesn't seem to make a difference.

I've never had this much trouble setting up and running a docker container before. compose.txt logs.txt

zurdi15 commented 3 months ago

If you see the logs, the previous line to the last one say Can't connect to local server through socket '/run/mysqld/mysqld.sock', that usually means that the mariadb container didn't start properly, it's not running or the RomM container can't connect to it due to docker network issues. Make sure that RomM have access to your mariadb container (check the mariadb logs), both are in the same docker network, the DB_HOST is good (you can try putting your server hostname instead of the mariadb container) and then restart the RomM container.

Apart from that, some users reported issues with the official mariadb image and got their problems fixed with the linuxserver version: https://hub.docker.com/r/linuxserver/mariadb

F1zzyD commented 2 months ago

Apart from that, some users reported issues with the official mariadb image and got their problems fixed with the linuxserver version: https://hub.docker.com/r/linuxserver/mariadb\

That's wild that we have to use a version that isn't linked here. There should be a note in the three different instructions to use linuxserver's image.

That fixed things for a moment, but now I am unable to set the DB_USER and DB_PASSWD without it saying "something went horribly wrong with our database" again. I've delete the docker images, mariadb, and attempted finding the database, but there's been no luck with the first two and there's no documentation that I have seen that points to the database created by the compose.yaml.

F1zzyD commented 2 months ago

Got it working. Hopefully if anyone stumbles upon this post these steps will help you:

Delete the corrupted docker containers created by RomM and Mariadb

Try manually deleting the container

Google Deleting Mariadb databases

The documentation needs to include use of linuxserver.io's image of Mariadb, as RomM does not function with the official image.

EDIT: Got the webui running and can log in, however RomM refuses to find any games, even after following the "recommended" filesystem layout indicted by the dev. RomM has the permissions and the config/compose are set up exactly the same, but it still refuses to look and scans indefinitely. Moved over to Gaseous-Server and it picks it up no problem. Switching to that instead. Hopefully RomM comes out with more updates.

gantoine commented 2 months ago

That's wild that we have to use a version that isn't linked here. There should be a note in the three different instructions to use linuxserver's image.

We've added a note for this in the compose, which will make it's way to the release branch on next release (shortly).

Delete the corrupted docker containers created by RomM and Mariadb

If you've use the default container names from the compose, this can be done with docker compose stop romm romm-db; docker compose rm romm romm-db. No need to navigate to /var, which requires sudo permissions to access.

I wish I could outline the steps, but I'm not sure if one (if any) actually worked

If you're using a separate mariadb instance for romm, deleting the volume with docker volume rm mysql_data (or whatever your system labeled the volume) will work.

RomM does not function with the official image

It does it most cases, I'm currently using it and have been for a while now. That being said the option is there for those who have issues with the official image.

Moved over to Gaseous-Server and it picks it up no problem

Gaseous is an awesome project, and I wish you much success with it!

F1zzyD commented 2 months ago

So after taking some time and finding out that I didn't care for Gaseious's UI compared to RomM, I sat back down and tried to figure out what was going on. Turns out it was NginX.....

So if you have NginX working with your domains make sure you have "Websocket Supports" enabled or RomM can't find games. This is totally on me and not RomM. Happy to say I'm really enjoying the experience now! Apologies!

gantoine commented 2 months ago

Glad to hear you got it working!

make sure you have "Websocket Supports" enabled

You're not the first to come across this issue, but I appreciate you updating the issue for the next person who searches for "nginx" and "websockets". When I have some time on our hands, I'm going to improve (i.e. actually write) docs on running RomM with caddy, nginx, npm, with cloudflare tunnels, tailscale, on a vps... you get the idea.

I didn't care for Gaseious's UI

If you have specific feedback on Gaseous' UI, Micheal (the dev behind the project) is very receptive to feedback, and I'm sure would appreciate hearing your thoughts.