ucphhpc / migrid-sync

MiGrid workspace where master branch is kept strictly in sync with SF upstream svn repo. Any development or experiments should use a branch. You probably want to fork your own clone or work e.g. on the edge branch if you wish to contribute.
GNU General Public License v2.0
3 stars 4 forks source link

Bootstrap sif without having a test user, will fail #8

Closed Bjarke42 closed 1 year ago

Bjarke42 commented 1 year ago

If the test user in docker-compose.yml from docker-migrid is set to not having a test user, like below. This: command: /app/docker-entry.sh -u test@dev.erda.dk -p TestPw0rd -s "sftp ftps webdavs" -k Is replaced with this: command: /app/docker-entry.sh -k

It will not be able to create MiG-users.db in state/user_db_home

Errors will be visible in log/migrid/httpd/ssl-oid-error.log example: [Mon Mar 20 13:52:47.101606 2023] [:error] [pid 25] [remote xxx:0] mod_wsgi (pid=25): Exception occurred processing WSGI script '/home/mig/mig/wsgi-bin/migwsgi.py'. [Mon Mar 20 13:52:47.101675 2023] [:error] [pid 25] [remote xxx:0] Traceback (most recent call last): [Mon Mar 20 13:52:47.101698 2023] [:error] [pid 25] [remote xxx:0] File "/home/mig/mig/wsgi-bin/migwsgi.py", line 182, in application [Mon Mar 20 13:52:47.101957 2023] [:error] [pid 25] [remote xxx:0] client_id = extract_client_id(configuration, environ) [Mon Mar 20 13:52:47.101974 2023] [:error] [pid 25] [remote xxx:0] File "/home/mig/mig/shared/httpsclient.py", line 407, in extract_client_id [Mon Mar 20 13:52:47.102189 2023] [:error] [pid 25] [remote xxx:0] lookup_dn) [Mon Mar 20 13:52:47.102203 2023] [:error] [pid 25] [remote xxx:0] File "/home/mig/mig/shared/httpsclient.py", line 167, in extract_client_oidc [Mon Mar 20 13:52:47.102226 2023] [:error] [pid 25] [remote xxx:0] login = get_oidc_user_dn(configuration, login, user_check=False) [Mon Mar 20 13:52:47.102236 2023] [:error] [pid 25] [remote xxx:0] File "/home/mig/mig/shared/useradm.py", line 1490, in get_oidc_user_dn [Mon Mar 20 13:52:47.102911 2023] [:error] [pid 25] [remote xxx:0] return get_any_oid_user_dn(configuration, login, user_check, do_lock) [Mon Mar 20 13:52:47.102928 2023] [:error] [pid 25] [remote xxx:0] File "/home/mig/mig/shared/useradm.py", line 1532, in get_any_oid_user_dn [Mon Mar 20 13:52:47.102957 2023] [:error] [pid 25] [remote xxx:0] user_map = load_user_db(db_path, do_lock=do_lock) [Mon Mar 20 13:52:47.102968 2023] [:error] [pid 25] [remote xxx:0] File "/home/mig/mig/shared/userdb.py", line 76, in load_user_db [Mon Mar 20 13:52:47.103056 2023] [:error] [pid 25] [remote xxx:0] result = load(db_path) [Mon Mar 20 13:52:47.103068 2023] [:error] [pid 25] [remote xxx:0] File "/home/mig/mig/shared/serial.py", line 103, in load [Mon Mar 20 13:52:47.103149 2023] [:error] [pid 25] [remote xxx:0] with open(path, mode) as fh: [Mon Mar 20 13:52:47.103170 2023] [:error] [pid 25] [remote xxx:0] IOError: [Errno 2] No such file or directory: '/home/mig/state/user_db_home/MiG-users.db'`

Manual fix is:

Log into docker container docker exec -it migrid /bin/bash Inside the docker container do the below command su mig -c /home/mig/mig/server/migrateusers.py

Please fix this so that we can startup a clean erda/sif with no users without having to use a manual fix.

jonasbardino commented 1 year ago

Should be fixed with svn rev 5671 a.k.a. git master rev 56c84a8018048a7672d7f88fe0af82225aee8b84 and corresponding edge+experimental revs.