FAForever / faf-stack

Aggregate project that allows to set up and manage a complete FAF environment within minutes
16 stars 18 forks source link

faf-python-server is using non-existing user on default env #230

Closed jkrzemin closed 7 months ago

jkrzemin commented 7 months ago

I might get something wrong since I'm at the point of poking around within the repo, but it seems like really easy fix for onboarding.

I've copied the config.template directory to config directory in order to have "vanilla setup".

➜  faf-stack git:(develop) ✗ cat config.template/faf-python-server/dynamic/config.yml | grep DB_LOGIN
DB_LOGIN: "faf-python-server"
➜  faf-stack git:(develop) ✗ grep FAF_PYTHON_SERVER_USER .env 
FAF_PYTHON_SERVER_USER=root
➜  faf-stack git:(develop) ✗ ➜  faf-stack git:(develop) ✗ docker-compose up -d faf-db faf-db-migrations
Creating network "faf-stack_faf" with driver "bridge"
Creating network "faf-stack_faf-extra" with driver "bridge"
Creating network "faf-stack_default" with the default driver
Creating faf-db ... done
Creating faf-db-migrations ... done
➜  faf-stack git:(develop) ✗ docker-compose logs faf-db
Attaching to faf-db
faf-db                   | 2024-03-15 21:51:14+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.17+maria~ubu2004 started.
faf-db                   | 2024-03-15 21:51:15+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
faf-db                   | 2024-03-15 21:51:15+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.17+maria~ubu2004 started.
faf-db                   | 2024-03-15 21:51:15+00:00 [Note] [Entrypoint]: Initializing database files
faf-db                   | 2024-03-15 21:51:15 0 [Warning] 'innodb-buffer-pool-instances' was removed. It does nothing now and exists only for compatibility with old my.cnf files.
faf-db                   | 
faf-db                   | 
faf-db                   | PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
faf-db                   | To do so, start the server, then issue the following command:
faf-db                   | 
faf-db                   | '/usr/bin/mariadb-secure-installation'
faf-db                   | 
faf-db                   | which will also give you the option of removing the test
faf-db                   | databases and anonymous user created by default.  This is
faf-db                   | strongly recommended for production servers.
faf-db                   | 
faf-db                   | See the MariaDB Knowledgebase at https://mariadb.com/kb
faf-db                   | 
faf-db                   | Please report any problems at https://mariadb.org/jira
faf-db                   | 
faf-db                   | The latest information about MariaDB is available at https://mariadb.org/.
faf-db                   | 
faf-db                   | Consider joining MariaDB's strong and vibrant community:
faf-db                   | https://mariadb.org/get-involved/
faf-db                   | 
faf-db                   | 2024-03-15 21:51:18+00:00 [Note] [Entrypoint]: Database files initialized
faf-db                   | 2024-03-15 21:51:18+00:00 [Note] [Entrypoint]: Starting temporary server
faf-db                   | 2024-03-15 21:51:18+00:00 [Note] [Entrypoint]: Waiting for server startup
faf-db                   | 2024-03-15 21:51:18 0 [Note] Starting MariaDB 10.6.17-MariaDB-1:10.6.17+maria~ubu2004-log source revision 15c75ad083a55e198ae78324f22970694b72f22b as process 103
faf-db                   | 2024-03-15 21:51:18 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
faf-db                   | 2024-03-15 21:51:18 0 [Note] InnoDB: Number of pools: 1
faf-db                   | 2024-03-15 21:51:18 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
faf-db                   | 2024-03-15 21:51:18 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
faf-db                   | 2024-03-15 21:51:18 0 [Note] InnoDB: Using Linux native AIO
faf-db                   | 2024-03-15 21:51:18 0 [Note] InnoDB: Initializing buffer pool, total size = 1073741824, chunk size = 134217728
faf-db                   | 2024-03-15 21:51:18 0 [Note] InnoDB: Completed initialization of buffer pool
faf-db                   | 2024-03-15 21:51:18 0 [Note] InnoDB: 128 rollback segments are active.
faf-db                   | 2024-03-15 21:51:18 0 [Note] InnoDB: Creating shared tablespace for temporary tables
faf-db                   | 2024-03-15 21:51:18 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
faf-db                   | 2024-03-15 21:51:18 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
faf-db                   | 2024-03-15 21:51:18 0 [Note] InnoDB: 10.6.17 started; log sequence number 42474; transaction id 14
faf-db                   | 2024-03-15 21:51:18 0 [Note] Plugin 'FEEDBACK' is disabled.
faf-db                   | 2024-03-15 21:51:18 0 [Warning] 'innodb-buffer-pool-instances' was removed. It does nothing now and exists only for compatibility with old my.cnf files.
faf-db                   | 2024-03-15 21:51:18 0 [Warning] 'user' entry 'root@af7776de16b8' ignored in --skip-name-resolve mode.
faf-db                   | 2024-03-15 21:51:18 0 [Warning] 'proxies_priv' entry '@% root@af7776de16b8' ignored in --skip-name-resolve mode.
faf-db                   | 2024-03-15 21:51:18 1 [Note] Event Scheduler: scheduler thread started with id 1
faf-db                   | 2024-03-15 21:51:18 0 [Note] mariadbd: ready for connections.
faf-db                   | Version: '10.6.17-MariaDB-1:10.6.17+maria~ubu2004-log'  socket: '/run/mysqld/mysqld.sock'  port: 0  mariadb.org binary distribution
faf-db                   | 2024-03-15 21:51:19+00:00 [Note] [Entrypoint]: Temporary server started.
faf-db                   | 2024-03-15 21:51:20+00:00 [Note] [Entrypoint]: Creating database faf
faf-db                   | 2024-03-15 21:51:20+00:00 [Note] [Entrypoint]: Securing system users (equivalent to running mysql_secure_installation)
faf-db                   | 
faf-db                   | 2024-03-15 21:51:20+00:00 [Note] [Entrypoint]: Stopping temporary server
faf-db                   | 2024-03-15 21:51:20 0 [Note] mariadbd (initiated by: unknown): Normal shutdown
faf-db                   | 2024-03-15 21:51:20 0 [Note] Event Scheduler: Killing the scheduler thread, thread id 1
faf-db                   | 2024-03-15 21:51:20 0 [Note] Event Scheduler: Waiting for the scheduler thread to reply
faf-db                   | 2024-03-15 21:51:20 0 [Note] Event Scheduler: Stopped
faf-db                   | 2024-03-15 21:51:20 0 [Note] InnoDB: FTS optimize thread exiting.
faf-db                   | 2024-03-15 21:51:20 0 [Note] InnoDB: Starting shutdown...
faf-db                   | 2024-03-15 21:51:20 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
faf-db                   | 2024-03-15 21:51:20 0 [Note] InnoDB: Buffer pool(s) dump completed at 240315 21:51:20
faf-db                   | 2024-03-15 21:51:20 0 [Note] InnoDB: Removed temporary tablespace data file: "./ibtmp1"
faf-db                   | 2024-03-15 21:51:20 0 [Note] InnoDB: Shutdown completed; log sequence number 42486; transaction id 15
faf-db                   | 2024-03-15 21:51:20 0 [Note] mariadbd: Shutdown complete
faf-db                   | 
faf-db                   | 2024-03-15 21:51:20+00:00 [Note] [Entrypoint]: Temporary server stopped
faf-db                   | 
faf-db                   | 2024-03-15 21:51:20+00:00 [Note] [Entrypoint]: MariaDB init process done. Ready for start up.
faf-db                   | 
faf-db                   | 2024-03-15 21:51:20 0 [Note] Starting MariaDB 10.6.17-MariaDB-1:10.6.17+maria~ubu2004-log source revision 15c75ad083a55e198ae78324f22970694b72f22b as process 1
faf-db                   | 2024-03-15 21:51:20 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
faf-db                   | 2024-03-15 21:51:20 0 [Note] InnoDB: Number of pools: 1
faf-db                   | 2024-03-15 21:51:20 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
faf-db                   | 2024-03-15 21:51:20 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
faf-db                   | 2024-03-15 21:51:20 0 [Note] InnoDB: Using Linux native AIO
faf-db                   | 2024-03-15 21:51:20 0 [Note] InnoDB: Initializing buffer pool, total size = 1073741824, chunk size = 134217728
faf-db                   | 2024-03-15 21:51:20 0 [Note] InnoDB: Completed initialization of buffer pool
faf-db                   | 2024-03-15 21:51:20 0 [Note] InnoDB: 128 rollback segments are active.
faf-db                   | 2024-03-15 21:51:20 0 [Note] InnoDB: Creating shared tablespace for temporary tables
faf-db                   | 2024-03-15 21:51:20 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
faf-db                   | 2024-03-15 21:51:20 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
faf-db                   | 2024-03-15 21:51:20 0 [Note] InnoDB: 10.6.17 started; log sequence number 42486; transaction id 14
faf-db                   | 2024-03-15 21:51:20 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
faf-db                   | 2024-03-15 21:51:20 0 [Note] Plugin 'FEEDBACK' is disabled.
faf-db                   | 2024-03-15 21:51:20 0 [Note] InnoDB: Buffer pool(s) load completed at 240315 21:51:20
faf-db                   | 2024-03-15 21:51:20 0 [Warning] 'innodb-buffer-pool-instances' was removed. It does nothing now and exists only for compatibility with old my.cnf files.
faf-db                   | 2024-03-15 21:51:20 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
faf-db                   | 2024-03-15 21:51:20 0 [Note] Server socket created on IP: '0.0.0.0'.
faf-db                   | 2024-03-15 21:51:20 0 [Note] Server socket created on IP: '::'.
faf-db                   | 2024-03-15 21:51:20 1 [Note] Event Scheduler: scheduler thread started with id 1
faf-db                   | 2024-03-15 21:51:20 0 [Note] mariadbd: ready for connections.
faf-db                   | Version: '10.6.17-MariaDB-1:10.6.17+maria~ubu2004-log'  socket: '/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
  faf-stack git:(develop) ✗ docker-compose logs faf-db-migrations
Attaching to faf-db-migrations
faf-db-migrations        | WARNING: This version of Flyway is out of date. Upgrade to Flyway 10.10.0: https://rd.gt/3rXiSlV
faf-db-migrations        | 
faf-db-migrations        | Flyway Community Edition 9.16.1 by Redgate
faf-db-migrations        | See release notes here: https://rd.gt/416ObMi
faf-db-migrations        | 
faf-db-migrations        | Database: jdbc:mysql://faf-db/faf (MariaDB 10.6)
faf-db-migrations        | Schema history table `faf`.`flyway_schema_history` does not exist yet
faf-db-migrations        | Successfully validated 35 migrations (execution time 00:00.044s)
faf-db-migrations        | Creating Schema History table `faf`.`flyway_schema_history` ...
faf-db-migrations        | Current version of schema `faf`: << Empty Schema >>
faf-db-migrations        | Migrating schema `faf` to version "107 - baseline schema"
faf-db-migrations        | Migrating schema `faf` to version "108 - disable auto increment"
faf-db-migrations        | Migrating schema `faf` to version "109 - add weight and other params to map pool map version"
faf-db-migrations        | Migrating schema `faf` to version "110 - replay available flag"
faf-db-migrations        | Migrating schema `faf` to version "111 - leaderboard initialization"
faf-db-migrations        | Migrating schema `faf` to version "112 - map pool map version timestamp"
faf-db-migrations        | Migrating schema `faf` to version "113 - ranking table indices"
faf-db-migrations        | Migrating schema `faf` to version "114 - replay available default false"
faf-db-migrations        | Migrating schema `faf` to version "115 - drop league tables"
faf-db-migrations        | Migrating schema `faf` to version "116 - map play count trigger"
faf-db-migrations        | WARNING: DB: Trigger does not exist (SQL State:  - Error Code: 1360)
faf-db-migrations        | WARNING: DB: Unknown table 'faf.map_version_play_count' (SQL State:  - Error Code: 1051)
faf-db-migrations        | Migrating schema `faf` to version "117 - recommended maps and mods"
faf-db-migrations        | Migrating schema `faf` to version "118 - deaggregate login log"
faf-db-migrations        | WARNING: DB: Name 'id' ignored for PRIMARY key. (SQL State:  - Error Code: 1280)
faf-db-migrations        | Migrating schema `faf` to version "119 - drop version lobby"
faf-db-migrations        | Migrating schema `faf` to version "120 - gog user id"
faf-db-migrations        | Migrating schema `faf` to version "121 - matchmaker queue params"
faf-db-migrations        | Migrating schema `faf` to version "122 - achievement statistics loader slow down"
faf-db-migrations        | WARNING: DB: Event achievement_statistics_loader does not exist (SQL State:  - Error Code: 1305)
faf-db-migrations        | Migrating schema `faf` to version "123 - update time vault items"
faf-db-migrations        | Migrating schema `faf` to version "124 - coturn servers"
faf-db-migrations        | Migrating schema `faf` to version "125 - coop scenario"
faf-db-migrations        | Migrating schema `faf` to version "126 - create links table"
faf-db-migrations        | WARNING: DB: Unknown table 'faf.service_links' (SQL State:  - Error Code: 1051)
faf-db-migrations        | Migrating schema `faf` to version "127 - vault licenses"
faf-db-migrations        | WARNING: DB: Name 'license_pk' ignored for PRIMARY key. (SQL State:  - Error Code: 1280)
faf-db-migrations        | Migrating schema `faf` to version "128 - reviews average score"
faf-db-migrations        | Migrating schema `faf` to version "129 - mods repository link"
faf-db-migrations        | Migrating schema `faf` to version "130 - drop obsolete tables"
faf-db-migrations        | Migrating schema `faf` to version "131 - gdpr delete handling"
faf-db-migrations        | WARNING: DB: Name 'account_deletion_requests_pk' ignored for PRIMARY key. (SQL State:  - Error Code: 1280)
faf-db-migrations        | Migrating schema `faf` to version "132 - add tos"
faf-db-migrations        | WARNING: DB: Name 'terms_of_service_pk' ignored for PRIMARY key. (SQL State:  - Error Code: 1280)
faf-db-migrations        | Migrating schema `faf` to version "133 - login log charset uft8"
faf-db-migrations        | Migrating schema `faf` with repeatable migration "010 game featuredMods"
faf-db-migrations        | Migrating schema `faf` with repeatable migration "020 achievement definitions"
faf-db-migrations        | Migrating schema `faf` with repeatable migration "030 event definitions"
faf-db-migrations        | Migrating schema `faf` with repeatable migration "040 game validity"
faf-db-migrations        | Migrating schema `faf` with repeatable migration "050 group permission"
faf-db-migrations        | Migrating schema `faf` with repeatable migration "060 leaderboard"
faf-db-migrations        | Migrating schema `faf` with repeatable migration "070 matchmaker queue"
faf-db-migrations        | Migrating schema `faf` with repeatable migration "080 license"
faf-db-migrations        | Successfully applied 35 migrations to schema `faf`, now at version v133 (execution time 00:07.571s)

But when I try to bring up faf-python-server service:


➜  faf-stack git:(develop) ✗ docker-compose up faf-python-server
Creating faf-python-server ... done
Attaching to faf-python-server
faf-python-server        | INFO     Mar 15  21:54:29 root                           Lobby v1.14.0 (Python 3.10.13) on linux named faf-python-server
faf-python-server        | INFO     Mar 15  21:54:29 root                           Using prometheus on port: 8011
faf-python-server        | INFO     Mar 15  21:54:29 root                           Event loop: <uvloop.Loop running=True closed=False debug=False>
faf-python-server        | INFO     Mar 15  21:54:29 HealthServer                   Health server listening on http://192.168.48.3:2000
faf-python-server        | INFO     Mar 15  21:54:29 ControlServer                  Control server listening on http://192.168.48.3:4000
faf-python-server        | DEBUG    Mar 15  21:54:29 LobbyServer                    Initializing 14 services
faf-python-server        | INFO     Mar 15  21:54:29 ConfigurationService           Configuration service initialized
faf-python-server        | DEBUG    Mar 15  21:54:29 ConfigurationService           ConfigurationService initialized in 0.00 seconds
faf-python-server        | WARNING  Mar 15  21:54:29 GeoIpService                   GEO_IP_LICENSE_KEY not set! Unable to download GeoIP database!
faf-python-server        | DEBUG    Mar 15  21:54:29 tzlocal                        /etc/timezone found, contents:
faf-python-server        |  Etc/UTC
faf-python-server        | 
faf-python-server        | DEBUG    Mar 15  21:54:29 tzlocal                        /etc/localtime found
faf-python-server        | DEBUG    Mar 15  21:54:29 tzlocal                        2 found:
faf-python-server        |  {'/etc/timezone': 'Etc/UTC', '/etc/localtime is a symlink to': 'Etc/UTC'}
faf-python-server        | DEBUG    Mar 15  21:54:29 GeoIpService                   GeoIpService initialized in 0.00 seconds
faf-python-server        | DEBUG    Mar 15  21:54:29 ViolationService               ViolationService initialized in 0.00 seconds
faf-python-server        | DEBUG    Mar 15  21:54:29 AchievementService             AchievementService initialized in 0.00 seconds
faf-python-server        | DEBUG    Mar 15  21:54:29 EventService                   EventService initialized in 0.00 seconds
faf-python-server        | DEBUG    Mar 15  21:54:29 GameStatsService               GameStatsService initialized in 0.00 seconds
faf-python-server        | DEBUG    Mar 15  21:54:29 BroadcastService               BroadcastService initialized in 0.00 seconds
faf-python-server        | DEBUG    Mar 15  21:54:29 PartyService                   PartyService initialized in 0.00 seconds
faf-python-server        | DEBUG    Mar 15  21:54:29 ConfigurationService           Refreshing configuration variables
faf-python-server        | ERROR    Mar 15  21:54:30 asyncio                        Future exception was never retrieved
faf-python-server        | future: <Future finished exception=gaierror(-2, 'Name or service not known')>
faf-python-server        | socket.gaierror: [Errno -2] Name or service not known
faf-python-server        | Traceback (most recent call last):
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 145, in __init__
faf-python-server        |     self._dbapi_connection = engine.raw_connection()
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 3293, in raw_connection
faf-python-server        |     return self.pool.connect()
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 452, in connect
faf-python-server        |     return _ConnectionFairy._checkout(self)
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 1269, in _checkout
faf-python-server        |     fairy = _ConnectionRecord.checkout(pool)
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 716, in checkout
faf-python-server        |     rec = pool._do_get()
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/pool/impl.py", line 169, in _do_get
faf-python-server        |     with util.safe_reraise():
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py", line 146, in __exit__
faf-python-server        |     raise exc_value.with_traceback(exc_tb)
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/pool/impl.py", line 167, in _do_get
faf-python-server        |     return self._create_connection()
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 393, in _create_connection
faf-python-server        |     return _ConnectionRecord(self)
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 678, in __init__
faf-python-server        |     self.__connect()
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 902, in __connect
faf-python-server        |     with util.safe_reraise():
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py", line 146, in __exit__
faf-python-server        |     raise exc_value.with_traceback(exc_tb)
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 898, in __connect
faf-python-server        |     self.dbapi_connection = connection = pool._invoke_creator(self)
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/create.py", line 645, in connect
faf-python-server        |     return dialect.connect(*cargs, **cparams)
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 616, in connect
faf-python-server        |     return self.loaded_dbapi.connect(*cargs, **cparams)
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/dialects/mysql/aiomysql.py", line 264, in connect
faf-python-server        |     await_only(creator_fn(*arg, **kw)),
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 130, in await_only
faf-python-server        |     return current.driver.switch(awaitable)  # type: ignore[no-any-return]
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 195, in greenlet_spawn
faf-python-server        |     value = await result
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/aiomysql/connection.py", line 75, in _connect
faf-python-server        |     await conn._connect()
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/aiomysql/connection.py", line 540, in _connect
faf-python-server        |     await self._request_authentication()
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/aiomysql/connection.py", line 844, in _request_authentication
faf-python-server        |     auth_packet = await self._read_packet()
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/aiomysql/connection.py", line 652, in _read_packet
faf-python-server        |     packet.raise_for_error()
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
faf-python-server        |     err.raise_mysql_exception(self._data)
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
faf-python-server        |     raise errorclass(errno, errval)
faf-python-server        | pymysql.err.OperationalError: (1045, "Access denied for user 'faf-python-server'@'192.168.48.3' (using password: YES)")
faf-python-server        | 
faf-python-server        | The above exception was the direct cause of the following exception:
faf-python-server        | 
faf-python-server        | Traceback (most recent call last):
faf-python-server        |   File "/code/main.py", line 208, in <module>
faf-python-server        |     exit_code = asyncio.run(main())
faf-python-server        |   File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
faf-python-server        |     return loop.run_until_complete(main)
faf-python-server        |   File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
faf-python-server        |   File "/code/main.py", line 110, in main
faf-python-server        |     await instance.start_services()
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/server/asyncio_extensions.py", line 205, in wrapped
faf-python-server        |     return await function(obj, *args, **kwargs)
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/server/__init__.py", line 222, in start_services
faf-python-server        |     await asyncio.gather(*[
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/server/__init__.py", line 215, in initialize
faf-python-server        |     await service.initialize()
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/server/game_service.py", line 75, in initialize
faf-python-server        |     await self.initialise_game_counter()
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/server/game_service.py", line 83, in initialise_game_counter
faf-python-server        |     async with self._db.acquire() as conn:
faf-python-server        |   File "/usr/local/lib/python3.10/contextlib.py", line 199, in __aenter__
faf-python-server        |     return await anext(self.gen)
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/ext/asyncio/engine.py", line 1061, in begin
faf-python-server        |     async with conn:
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/ext/asyncio/base.py", line 125, in __aenter__
faf-python-server        |     return await self.start(is_ctxmanager=True)
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/ext/asyncio/engine.py", line 270, in start
faf-python-server        |     await greenlet_spawn(self.sync_engine.connect)
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 200, in greenlet_spawn
faf-python-server        |     result = context.throw(*sys.exc_info())
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 3269, in connect
faf-python-server        |     return self._connection_cls(self)
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 147, in __init__
faf-python-server        |     Connection._handle_dbapi_exception_noconnection(
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 2431, in _handle_dbapi_exception_noconnection
faf-python-server        |     raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 145, in __init__
faf-python-server        |     self._dbapi_connection = engine.raw_connection()
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 3293, in raw_connection
faf-python-server        |     return self.pool.connect()
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 452, in connect
faf-python-server        |     return _ConnectionFairy._checkout(self)
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 1269, in _checkout
faf-python-server        |     fairy = _ConnectionRecord.checkout(pool)
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 716, in checkout
faf-python-server        |     rec = pool._do_get()
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/pool/impl.py", line 169, in _do_get
faf-python-server        |     with util.safe_reraise():
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py", line 146, in __exit__
faf-python-server        |     raise exc_value.with_traceback(exc_tb)
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/pool/impl.py", line 167, in _do_get
faf-python-server        |     return self._create_connection()
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 393, in _create_connection
faf-python-server        |     return _ConnectionRecord(self)
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 678, in __init__
faf-python-server        |     self.__connect()
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 902, in __connect
faf-python-server        |     with util.safe_reraise():
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py", line 146, in __exit__
faf-python-server        |     raise exc_value.with_traceback(exc_tb)
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 898, in __connect
faf-python-server        |     self.dbapi_connection = connection = pool._invoke_creator(self)
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/create.py", line 645, in connect
faf-python-server        |     return dialect.connect(*cargs, **cparams)
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 616, in connect
faf-python-server        |     return self.loaded_dbapi.connect(*cargs, **cparams)
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/dialects/mysql/aiomysql.py", line 264, in connect
faf-python-server        |     await_only(creator_fn(*arg, **kw)),
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 130, in await_only
faf-python-server        |     return current.driver.switch(awaitable)  # type: ignore[no-any-return]
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 195, in greenlet_spawn
faf-python-server        |     value = await result
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/aiomysql/connection.py", line 75, in _connect
faf-python-server        |     await conn._connect()
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/aiomysql/connection.py", line 540, in _connect
faf-python-server        |     await self._request_authentication()
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/aiomysql/connection.py", line 844, in _request_authentication
faf-python-server        |     auth_packet = await self._read_packet()
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/aiomysql/connection.py", line 652, in _read_packet
faf-python-server        |     packet.raise_for_error()
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
faf-python-server        |     err.raise_mysql_exception(self._data)
faf-python-server        |   File "/usr/local/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
faf-python-server        |     raise errorclass(errno, errval)
faf-python-server        | sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (1045, "Access denied for user 'faf-python-server'@'192.168.48.3' (using password: YES)")
faf-python-server        | (Background on this error at: https://sqlalche.me/e/20/e3q8)
➜  faf-stack git:(develop) ✗ 

Seems like easy fix.

Sheikah45 commented 7 months ago

The migrations do not create any of the users. The users are created by the scripts/init-db.sh which needs to be run the first time you create the db. Did you do this?

jkrzemin commented 7 months ago

I've dug it out like 5 min after creating the issue and I'm wandering about 2 questions:

Brutus5000 commented 7 months ago

I'm not sure why it is run as root. I remember there are some permission issue if you don't that I could not explain and didn't bother to explain.

The scripts are not containers because they are not part of the regular application stack. They are just used to bootstrap either the integration test setup or developer environments.