Code Monkey home page Code Monkey logo

Comments (19)

zurdi15 avatar zurdi15 commented on May 27, 2024 1

Hi! from which repository you pulled the image? We recently moved to a new location (rommapp)[https://hub.docker.com/layers/rommapp/romm].

That bug is fixed in the 3.0.3 version in that new location

from romm.

Dreadlocke12 avatar Dreadlocke12 commented on May 27, 2024 1

I am now working with my phone so copy paste as you noticed is a bit tricky. I will adapt the docker compose this evening and retest it. Thanks for the fast reply

from romm.

gantoine avatar gantoine commented on May 27, 2024 1

Looks like the romm user inside the container is missing a lot of permissions.

Yes that was a mistake we made by including USER romm in the Dockerfile, that's been removed on master and will be fixed in 3.1!

from romm.

Dreadlocke12 avatar Dreadlocke12 commented on May 27, 2024 1

So with the docker compose file up i made it run again. This https://github.com/rommapp/romm/blob/3.0.3/examples/docker-compose.example.yml did not work for me unfortunately. I assume due to the missing redis docker image.

The permissions i solved for now by using chmod o+rwx /older

I am not sure if this is as well the most secure way ro do this but it works now

from romm.

Dreadlocke12 avatar Dreadlocke12 commented on May 27, 2024

Ok i changed it to rommapp/romm but it still does not work and shows me

PermissionError: [Errno 13] Permission denied: '/romm/logs/20240326_112216.log'
ERROR: [init][2024-03-26 11:22:16] Something went horribly wrong with our database
Traceback (most recent call last):
File "/backend/bin/alembic", line 8, in
sys.exit(main())
^^^^^^
File "/backend/lib/python3.11/site-packages/alembic/config.py", line 641, in main
CommandLine(prog=prog).main(argv=argv)
File "/backend/lib/python3.11/site-packages/alembic/config.py", line 631, in main
self.run_cmd(cfg, options)
File "/backend/lib/python3.11/site-packages/alembic/config.py", line 608, in run_cmd
fn(
File "/backend/lib/python3.11/site-packages/alembic/command.py", line 403, in upgrade
script.run_env()
File "/backend/lib/python3.11/site-packages/alembic/script/base.py", line 583, in run_env
util.load_python_file(self.dir, "env.py")
File "/backend/lib/python3.11/site-packages/alembic/util/pyfiles.py", line 95, in load_python_file
module = load_module_py(module_id, path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/backend/lib/python3.11/site-packages/alembic/util/pyfiles.py", line 113, in load_module_py
spec.loader.exec_module(module) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/backend/alembic/env.py", line 6, in
from config.config_manager import ConfigManager
File "/backend/config/config_manager.py", line 22, in
from logger.logger import log
File "/backend/logger/logger.py", line 28, in
file_handler = logging.FileHandler(logs_file)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/logging/init.py", line 1181, in init
StreamHandler.init(self, self._open())
^^^^^^^^^^^^
File "/usr/lib/python3.11/logging/init.py", line 1213, in _open
return open_func(self.baseFilename, self.mode,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

When trying to collect display the logs. I would not know how to adjust the permissions though.

from romm.

gantoine avatar gantoine commented on May 27, 2024

Can you try stopping romm, rm the container, delete any old romm images from docker, then in your docker-compose pin it to 3.0.3, and start it again? You may have an old version cached.

from romm.

Dreadlocke12 avatar Dreadlocke12 commented on May 27, 2024

Removed everything all Containers images and as well all folders created and tried with latest as well with 3.0.3 but the result is the same

from romm.

gantoine avatar gantoine commented on May 27, 2024

can you post your docker-compose? and what does your setup look like (os, etc)?

from romm.

Dreadlocke12 avatar Dreadlocke12 commented on May 27, 2024

rsion: "3"
volumes:
mysql_data:
services:
romm:
image: rommapp/romm:3.0.3
container_name: romm
environment:
- ROMM_DB_DRIVER=mariadb # mariadb | sqlite (default: sqlite)
# [Optional] Only required if using MariaDB as the database
- DB_HOST=romm_db
- DB_PORT=3306
- DB_USER=romm-user
- DB_NAME=romm # Should match the MYSQL_DATABASE value in the mariadb container
- DB_PASSWD=
- CLIENT_ID=***
- CLIENT_SECRET=***
# [Optional - WIP] Use SteamGridDB as a source for covers
# - STEAMGRIDDB_API_KEY=
# [Optional] Will enable user management and require authentication to access the interface (disab>
- ROMM_AUTH_ENABLED=true # default: false
- ROMM_AUTH_SECRET_KEY= # Generate>
- ROMM_AUTH_USERNAME= # default: admin
- ROMM_AUTH_PASSWORD= # default: admin
# [Optional] Only required if authentication is enabled
- ENABLE_EXPERIMENTAL_REDIS=true # default: false
- REDIS_HOST=redis # default: localhost
- REDIS_PORT=6379 # default: 6379
#- REDIS_PASSWORD= # [Optional] Support for secured redis
# [Optional] Will enable asynchronous tasks (all disabled by default)
- ENABLE_RESCAN_ON_FILESYSTEM_CHANGE=true # Runs a quick scan on the library when a file is added >
- RESCAN_ON_FILESYSTEM_CHANGE_DELAY=5 # Delay in seconds before running the quick scan (default: 5)
- ENABLE_SCHEDULED_RESCAN=true # Runs a quick scan on the library at a given time
- SCHEDULED_RESCAN_CRON=0 3 * * * # Cron expression for the scheduled scan (default: 0 3 * * * - A>
- ENABLE_SCHEDULED_UPDATE_SWITCH_TITLEDB=true # Updates the Switch TitleDB database at a given time
- SCHEDULED_UPDATE_SWITCH_TITLEDB_CRON=0 4 * * * # Cron expression for the scheduled update (defau>
- ENABLE_SCHEDULED_UPDATE_MAME_XML=true # Updates the MAME XML database at a given time
- SCHEDULED_UPDATE_MAME_XML_CRON=0 5 * * * # Cron expression for the scheduled update (default: 0 >
volumes:
- "/media/Spiele/Emulatoren/:/romm/library"
- "/home/admin/docker/romM/resources:/romm/resources" # [Optional] Path where roms metadata (cover>
- "/home/admin/docker/romM/config.yml:/romm/config.yml" # [Optional] Path where config is stored
- "/home/admin/docker/romM/database/:/romm/database" # [Optional] Only needed if ROMM_DB_DRIVER=sq>
- "/home/admin/docker/romM/logs/:/romm/logs" # [Optional] Path where logs are stored
ports:
- 80:8080
depends_on:
- romm_db
restart: "unless-stopped"
romm_db:
image: mariadb:latest
container_name: romm_db
environment:
- MYSQL_ROOT_PASSWORD=
- MYSQL_DATABASE=romm
- MYSQL_USER=romm-user
- MYSQL_PASSWORD=
volumes:
- mysql_data:/var/lib/mysql # Can also be mounted locally
ports:
- 3306:3306
restart: "unless-stopped"

[Optional] Only required if experimental Redis is enabled

redis:
image: redis:alpine
container_name: redis
restart: unless-stopped
ports:
- 6379:6379

from romm.

Dreadlocke12 avatar Dreadlocke12 commented on May 27, 2024

It runs on an lxc container and os is ubuntu

from romm.

gantoine avatar gantoine commented on May 27, 2024

ok so first off your compose it fairly out of date, you should adapt it to the latest example, which is much more simplified https://github.com/rommapp/romm/blob/3.0.3/examples/docker-compose.example.yml

what are the permissions of the /home/admin/docker/romM/logs/ folder?

from romm.

zurdi15 avatar zurdi15 commented on May 27, 2024
  • CLIENT_ID=***
  • CLIENT_SECRET=***

I edited your comment because you had your IGDB credentials in plain text

from romm.

Dreadlocke12 avatar Dreadlocke12 commented on May 27, 2024

The permissions are set to root:root

from romm.

gantoine avatar gantoine commented on May 27, 2024

Ok that might be why, you should loosen the perms a bit, or just don't mount that volume if you don't need to access logs regularly.

from romm.

Dreadlocke12 avatar Dreadlocke12 commented on May 27, 2024

Ok so i checked it with the suggested compose file and adjusted the permissions like this

drwxr-xrwx 6 admin admin 4096 Mar 26 15:01 .
drwxr-xr-x 4 root root 4096 Mar 26 13:19 ..
drwxr-xrwx 2 admin admin 4096 Mar 26 13:20 config.yml
drwxr-xrwx 2 admin admin 4096 Mar 26 13:20 database
-rw-r--rwx 1 admin admin 1699 Mar 26 15:01 docker-compose.yml
drwxr-xrwx 2 root root 4096 Mar 26 15:02 logs
drwxr-xrwx 2 admin admin 4096 Mar 26 13:20 resources

so the logs folder permissions are gone but now it seems some issue with the db access:

mariadb.OperationalError: Access denied for user 'admin'@'172.18.0.3' (using password: YES)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/backend/bin/alembic", line 8, in
sys.exit(main())
^^^^^^
File "/backend/lib/python3.11/site-packages/alembic/config.py", line 641, in main
CommandLine(prog=prog).main(argv=argv)
File "/backend/lib/python3.11/site-packages/alembic/config.py", line 631, in main
self.run_cmd(cfg, options)
File "/backend/lib/python3.11/site-packages/alembic/config.py", line 608, in run_cmd
fn(
File "/backend/lib/python3.11/site-packages/alembic/command.py", line 403, in upgrade
script.run_env()
File "/backend/lib/python3.11/site-packages/alembic/script/base.py", line 583, in run_env
util.load_python_file(self.dir, "env.py")
File "/backend/lib/python3.11/site-packages/alembic/util/pyfiles.py", line 95, in load_python_file
module = load_module_py(module_id, path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/backend/lib/python3.11/site-packages/alembic/util/pyfiles.py", line 113, in load_module_py
spec.loader.exec_module(module) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/backend/alembic/env.py", line 86, in
run_migrations_online()
File "/backend/alembic/env.py", line 71, in run_migrations_online
with engine.connect() as connection:
^^^^^^^^^^^^^^^^
File "/backend/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 3279, in connect
return self._connection_cls(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/backend/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 147, in init
Connection._handle_dbapi_exception_noconnection(
File "/backend/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2443, in _handle_dbapi_exception_noconnection
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File "/backend/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 145, in init
self._dbapi_connection = engine.raw_connection()
^^^^^^^^^^^^^^^^^^^^^^^
File "/backend/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 3303, in raw_connection
return self.pool.connect()
^^^^^^^^^^^^^^^^^^^
File "/backend/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 449, in connect
return _ConnectionFairy._checkout(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/backend/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 1263, in _checkout
fairy = _ConnectionRecord.checkout(pool)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/backend/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 712, in checkout
rec = pool._do_get()
^^^^^^^^^^^^^^
File "/backend/lib/python3.11/site-packages/sqlalchemy/pool/impl.py", line 179, in _do_get
with util.safe_reraise():
File "/backend/lib/python3.11/site-packages/sqlalchemy/util/langhelpers.py", line 146, in exit
raise exc_value.with_traceback(exc_tb)
File "/backend/lib/python3.11/site-packages/sqlalchemy/pool/impl.py", line 177, in _do_get
return self._create_connection()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/backend/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 390, in _create_connection
return _ConnectionRecord(self)
^^^^^^^^^^^^^^^^^^^^^^^
File "/backend/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 674, in init
self.__connect()
File "/backend/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 900, in __connect
with util.safe_reraise():
File "/backend/lib/python3.11/site-packages/sqlalchemy/util/langhelpers.py", line 146, in exit
raise exc_value.with_traceback(exc_tb)
File "/backend/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 896, in __connect
self.dbapi_connection = connection = pool._invoke_creator(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/backend/lib/python3.11/site-packages/sqlalchemy/engine/create.py", line 643, in connect
return dialect.connect(*cargs, **cparams)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/backend/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 616, in connect
return self.loaded_dbapi.connect(*cargs, **cparams)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/backend/lib/python3.11/site-packages/mariadb/init.py", line 146, in connect
connection = connectionclass(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/backend/lib/python3.11/site-packages/mariadb/connections.py", line 85, in init
super().init(*args, **kwargs)
sqlalchemy.exc.OperationalError: (mariadb.OperationalError) Access denied for user 'admin'@'172.18.0.3' (using password: YES)
(Background on this error at: https://sqlalche.me/e/20/e3q8)
ERROR: [init][2024-03-26 15:02:46] Something went horribly wrong with our database

I checked it a few times and the password is exactly the same in DB_PASSWD as in MYSQL_PASSWORD. Same as the username has been adjusted.

from romm.

gantoine avatar gantoine commented on May 27, 2024

At this point I'd recommend reverting to 3.0.1 until 3.1 is released.

from romm.

sondregronas avatar sondregronas commented on May 27, 2024

Looks like the romm user inside the container is missing a lot of permissions. The container won't start with the logs folder as a mapped volume, and it doesn't seem to have permission interact with the docker volumes either.

Logs from a fresh install (pruned all volumes etc)

INFO:     [RomM][2024-03-26 17:56:22] Connecting to redis...
INFO:     [RomM][2024-03-26 17:56:23] Twitch token fetched!
INFO:     [RomM][2024-03-26 17:57:47] Found 21 platforms in file system
INFO:     [RomM][2024-03-26 17:57:47] ยท n64
INFO:     [RomM][2024-03-26 17:57:48]   Identified as Nintendo 64 ๐ŸŽฎ
INFO:     [RomM][2024-03-26 17:57:48]   42 roms found
INFO:     [RomM][2024-03-26 17:57:48]    ยท Super Mario 64
INFO:     [RomM][2024-03-26 17:57:49]      Identified as Super Mario 64 ๐Ÿ‘พ
ERROR:    [RomM][2024-03-26 17:57:49] [Errno 13] Permission denied: '/romm/resources/n64'

The scan ends here

compose.yml

volumes:
  mysql_data:
  romm_resources:
  romm_redis_data:
services:
  romm:
    image: rommapp/romm:latest
    container_name: romm
    environment:
      - DB_HOST=romm_db
      - DB_PORT=3306
      - DB_USER=<redacted>
      - DB_NAME=<redacted>
      - DB_PASSWD=<redacted>
      # Metadata
      - IGDB_CLIENT_ID=${IGDB_CLIENT_ID}
      - IGDB_CLIENT_SECRET=${IGDB_CLIENT_SECRET}
      # Cron jobs
      - ENABLE_RESCAN_ON_FILESYSTEM_CHANGE=true
      - RESCAN_ON_FILESYSTEM_CHANGE_DELAY=5
      - ENABLE_SCHEDULED_RESCAN=true
      - SCHEDULED_RESCAN_CRON=0 3 * * *
      - ENABLE_SCHEDULED_UPDATE_SWITCH_TITLEDB=true
      - SCHEDULED_UPDATE_SWITCH_TITLEDB_CRON=0 4 * * *
      - ENABLE_SCHEDULED_UPDATE_MAME_XML=true
      - SCHEDULED_UPDATE_MAME_XML_CRON=0 5 * * *
      - ROMM_AUTH_SECRET_KEY=${ROMM_AUTH_SECRET_KEY}
    volumes:
      - romm_resources:/romm/resources
      - romm_redis_data:/redis-data
      - "/mnt/NAS-Games/:/romm/library:ro"
      - "./assets:/romm/assets"
      - "./config:/romm/config"
#      - "./logs:/romm/logs"
    ports:
      - 8080:8080
    restart: "unless-stopped"
    depends_on:
      - romm_db
  romm_db:
    image: mariadb:latest
    container_name: romm_db
    environment:
      - MYSQL_ROOT_PASSWORD=<redacted>
      - MYSQL_DATABASE=<redacted>
      - MYSQL_USER=<redacted>
      - MYSQL_PASSWORD=<redacted>
    volumes:
      - mysql_data:/var/lib/mysql
    restart: "unless-stopped"
c15264a4d0b2:/romm$ whoami
romm
c15264a4d0b2:/romm$ touch assets/test
touch: assets/test: Permission denied
c15264a4d0b2:/romm$ ls -la
total 24
drwxrwxrwx    1 romm     romm          4096 Mar 26 17:55 .
drwxr-xr-x    1 root     root          4096 Mar 26 17:55 ..
drwxr-xr-x    2 root     root          4096 Mar 26 17:55 assets
drwxr-xr-x    2 root     root          4096 Mar  9 14:04 config
drwxrwxrwx    2 romm     romm             0 Mar 20 13:30 library
drwxr-xr-x    2 romm     romm          4096 Mar 26 17:56 logs
drwxr-xr-x    2 root     root          4096 Mar 26 17:55 resources

from romm.

javijuji avatar javijuji commented on May 27, 2024

Running into the same issue. Tried recreating the container with the newest .yml and having the same errors

from romm.

gantoine avatar gantoine commented on May 27, 2024

The 3.1 release in a few days will fix this issue, keep an eye out for RC.1 if you want to try it sooner.

from romm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.