SelfhostedPro / Yacht

A web interface for managing docker containers with an emphasis on templating to provide 1 click deployments. Think of it like a decentralized app store for servers that anyone can make packages for.
MIT License
3.32k stars 158 forks source link

[Bug Report] After upgrade, cannot login #422

Closed SteveDinn closed 4 weeks ago

SteveDinn commented 3 years ago

Describe the bug After upgrade, I re-create the docker container, and I'm unable to login.

To Reproduce Steps to reproduce the behavior: Not completely sure what version I was on previously, but I can no longer login upon upgrading to image selfhostedpro\yacht:latest (sha256:28505b2e5caefdf27d98e6b569f9ac63bca214defb263ede3c1e15431664acee)

Expected behavior I should be able to login using the same username & password.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

Logs

Starting yacht ... done
Attaching to yacht
yacht    | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
yacht    | [s6-init] ensuring user provided files have correct perms...exited 0.
yacht    | [fix-attrs.d] applying ownership & permissions fixes...
yacht    | [fix-attrs.d] done.
yacht    | [cont-init.d] executing container initialization scripts...
yacht    | [cont-init.d] 01-envfile: executing...
yacht    | [cont-init.d] 01-envfile: exited 0.
yacht    | [cont-init.d] 10-adduser: executing...
yacht    | usermod: no changes
yacht    |
yacht    | -------------------------------------
yacht    |           _         ()
yacht    |          | |  ___   _    __
yacht    |          | | / __| | |  /  \
yacht    |          | | \__ \ | | | () |
yacht    |          |_| |___/ |_|  \__/
yacht    |
yacht    |
yacht    | Brought to you by linuxserver.io
yacht    | -------------------------------------
yacht    |
yacht    | To support LSIO projects visit:
yacht    | https://www.linuxserver.io/donate/
yacht    | -------------------------------------
yacht    | GID/UID
yacht    | -------------------------------------
yacht    |
yacht    | User uid:    911
yacht    | User gid:    911
yacht    | -------------------------------------
yacht    |
yacht    | [cont-init.d] 10-adduser: exited 0.
yacht    | [cont-init.d] 30-config: executing...
yacht    | [cont-init.d] 30-config: exited 0.
yacht    | [cont-init.d] 31-migrate: executing...
yacht    | INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
yacht    | INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
yacht    | --- MODELS ---
yacht    | FAILED: Target database is not up to date.
yacht    | ERROR [alembic.util.messaging] Target database is not up to date.
yacht    | INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
yacht    | INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
yacht    | INFO  [alembic.runtime.migration] Running upgrade  -> 9e089dbd3a44, automated db upgrade
yacht    | --- MODELS ---
yacht    | Traceback (most recent call last):
yacht    |   File "/usr/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
yacht    |     self.dialect.do_execute(
yacht    |   File "/usr/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
yacht    |     cursor.execute(statement, parameters)
yacht    | sqlite3.OperationalError: table template_variables already exists
yacht    |
yacht    | The above exception was the direct cause of the following exception:
yacht    |
yacht    | Traceback (most recent call last):
yacht    |   File "/usr/bin/alembic", line 8, in <module>
yacht    |     sys.exit(main())
yacht    |   File "/usr/lib/python3.8/site-packages/alembic/config.py", line 581, in main
yacht    |     CommandLine(prog=prog).main(argv=argv)
yacht    |   File "/usr/lib/python3.8/site-packages/alembic/config.py", line 575, in main
yacht    |     self.run_cmd(cfg, options)
yacht    |   File "/usr/lib/python3.8/site-packages/alembic/config.py", line 552, in run_cmd
yacht    |     fn(
yacht    |   File "/usr/lib/python3.8/site-packages/alembic/command.py", line 298, in upgrade
yacht    |     script.run_env()
yacht    |   File "/usr/lib/python3.8/site-packages/alembic/script/base.py", line 489, in run_env
yacht    |     util.load_python_file(self.dir, "env.py")
yacht    |   File "/usr/lib/python3.8/site-packages/alembic/util/pyfiles.py", line 98, in load_python_file
yacht    |     module = load_module_py(module_id, path)
yacht    |   File "/usr/lib/python3.8/site-packages/alembic/util/compat.py", line 184, in load_module_py
yacht    |     spec.loader.exec_module(module)
yacht    |   File "<frozen importlib._bootstrap_external>", line 848, in exec_module
yacht    |   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
yacht    |   File "/alembic/env.py", line 93, in <module>
yacht    |     run_migrations_online()
yacht    |   File "/alembic/env.py", line 87, in run_migrations_online
yacht    |     context.run_migrations()
yacht    |   File "<string>", line 8, in run_migrations
yacht    |   File "/usr/lib/python3.8/site-packages/alembic/runtime/environment.py", line 846, in run_migrations
yacht    |     self.get_context().run_migrations(**kw)
yacht    |   File "/usr/lib/python3.8/site-packages/alembic/runtime/migration.py", line 522, in run_migrations
yacht    |     step.migration_fn(**kw)
yacht    |   File "/alembic/versions/9e089dbd3a44_automated_db_upgrade.py", line 21, in upgrade
yacht    |     op.create_table('template_variables',
yacht    |   File "<string>", line 8, in create_table
yacht    |   File "<string>", line 3, in create_table
yacht    |   File "/usr/lib/python3.8/site-packages/alembic/operations/ops.py", line 1252, in create_table
yacht    |     return operations.invoke(op)
yacht    |   File "/usr/lib/python3.8/site-packages/alembic/operations/base.py", line 373, in invoke
yacht    |     return fn(self, operation)
yacht    |   File "/usr/lib/python3.8/site-packages/alembic/operations/toimpl.py", line 101, in create_table
yacht    |     operations.impl.create_table(table)
yacht    |   File "/usr/lib/python3.8/site-packages/alembic/ddl/impl.py", line 259, in create_table
yacht    |     self._exec(schema.CreateTable(table))
yacht    |   File "/usr/lib/python3.8/site-packages/alembic/ddl/impl.py", line 141, in _exec
yacht    |     return conn.execute(construct, *multiparams, **params)
yacht    |   File "/usr/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
yacht    |     return meth(self, multiparams, params)
yacht    |   File "/usr/lib/python3.8/site-packages/sqlalchemy/sql/ddl.py", line 72, in _execute_on_connection
yacht    |     return connection._execute_ddl(self, multiparams, params)
yacht    |   File "/usr/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1068, in _execute_ddl
yacht    |     ret = self._execute_context(
yacht    |   File "/usr/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1316, in _execute_context
yacht    |     self._handle_dbapi_exception(
yacht    |   File "/usr/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1510, in _handle_dbapi_exception
yacht    |     util.raise_(
yacht    |   File "/usr/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
yacht    |     raise exception
yacht    |   File "/usr/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
yacht    |     self.dialect.do_execute(
yacht    |   File "/usr/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
yacht    |     cursor.execute(statement, parameters)
yacht    | sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) table template_variables already exists
yacht    | [SQL:
yacht    | CREATE TABLE template_variables (
yacht    |      id INTEGER NOT NULL,
yacht    |      variable VARCHAR(255) NOT NULL,
yacht    |      replacement VARCHAR(255) NOT NULL,
yacht    |      PRIMARY KEY (id)
yacht    | )
yacht    |
yacht    | ]
yacht    | (Background on this error at: http://sqlalche.me/e/13/e3q8)
yacht    | [cont-init.d] 31-migrate: exited 1.
yacht    | [cont-init.d] 32-env: executing...
yacht    | Replacing env constants in JS
yacht    | Processing /app/js/app.1d365aa7.js ...
yacht    | Processing /app/js/app.1d365aa7.js.map ...
yacht    | Processing /app/index.html ...
yacht    | [cont-init.d] 32-env: exited 0.
yacht    | [cont-init.d] 99-custom-files: executing...
yacht    | [custom-init] no custom files found exiting...
yacht    | [cont-init.d] 99-custom-files: exited 0.
yacht    | [cont-init.d] done.
yacht    | [services.d] starting services
yacht    | [services.d] done.
yacht    | INFO:     Started server process [310]
yacht    | INFO:     Waiting for application startup.
yacht    | INFO:     Application startup complete.
yacht    | INFO:     Uvicorn running on unix socket /tmp/gunicorn.sock (Press CTRL+C to quit)
^CGracefully stopping... (press Ctrl+C again to force)
Stopping yacht ... done
SelfhostedPro commented 3 years ago

Sorry for the late reply. This looks like an issue with updating the db schema for templates. It's always recommended to backup the config of Yacht before an upgrade. I may automate downloading of the backup file in the future. I'll leave it open for another month so anyone else who runs into this can let me know here but it looks to be an isolated accident.

wickedyoda commented 2 years ago

I would recommend going in and clearing your browser cache afterward, only once or twice has this happened where I was unable to login. Clearing the cache resolved the issue each time.