alexbelgium / hassio-addons

My homeassistant addons
MIT License
1.36k stars 193 forks source link

🐛 [Mealie] Application fail to start #1355

Closed BigFriendlyDuck closed 1 month ago

BigFriendlyDuck commented 2 months ago

Description

Mealie won't start. Log ends with "[2024-04-26 09:04:18 +0200] [7] [ERROR] Reason: Worker failed to boot.".

Reproduction steps

1. Install from repo.
2. Click on 'Start'.
3. Watch it fail..
4. Look at log and scratch head.

Addon Logs

Traceback (most recent call last):
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/routing.py", line 732, in lifespan
    async with self.lifespan_context(app) as maybe_state:
  File "/usr/local/lib/python3.10/contextlib.py", line 199, in __aenter__
    return await anext(self.gen)
  File "/app/mealie/app.py", line 60, in lifespan_fn
    init_db.main()
  File "/app/mealie/db/init_db.py", line 101, in main
    command.upgrade(alembic_cfg, "head")
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/command.py", line 403, in upgrade
    script.run_env()
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/script/base.py", line 583, in run_env
    util.load_python_file(self.dir, "env.py")
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/util/pyfiles.py", line 95, in load_python_file
    module = load_module_py(module_id, path)
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/util/pyfiles.py", line 113, in load_module_py
    spec.loader.exec_module(module)  # type: ignore
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/app/alembic/env.py", line 81, in <module>
    run_migrations_online()
  File "/app/alembic/env.py", line 75, in run_migrations_online
    context.run_migrations()
  File "<string>", line 8, in run_migrations
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/runtime/environment.py", line 948, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/runtime/migration.py", line 615, in run_migrations
    for step in self._migrations_fn(heads, self):
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/command.py", line 392, in upgrade
    return script._upgrade_revs(revision, rev)
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/script/base.py", line 447, in _upgrade_revs
    with self._catch_revision_errors(
  File "/usr/local/lib/python3.10/contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/script/base.py", line 285, in _catch_revision_errors
    raise util.CommandError(err.args[0]) from err
alembic.util.exc.CommandError: Requested revision d7c6efd2de42 overlaps with other requested revisions 263dd6707191

[2024-04-26 09:04:16 +0200] [341] [ERROR] Traceback (most recent call last):
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/script/base.py", line 251, in _catch_revision_errors
    yield
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/script/base.py", line 459, in _upgrade_revs
    for script in reversed(list(revs))
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/script/revision.py", line 813, in iterate_revisions
    revisions, heads = fn(
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/script/revision.py", line 1493, in _collect_upgrade_revisions
    current_node_set = set(
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/script/revision.py", line 916, in _iterate_related_revisions
    raise RevisionError(
alembic.script.revision.RevisionError: Requested revision d7c6efd2de42 overlaps with other requested revisions 263dd6707191

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

Traceback (most recent call last):
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/routing.py", line 732, in lifespan
    async with self.lifespan_context(app) as maybe_state:
  File "/usr/local/lib/python3.10/contextlib.py", line 199, in __aenter__
    return await anext(self.gen)
  File "/app/mealie/app.py", line 60, in lifespan_fn
    init_db.main()
  File "/app/mealie/db/init_db.py", line 101, in main
    command.upgrade(alembic_cfg, "head")
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/command.py", line 403, in upgrade
    script.run_env()
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/script/base.py", line 583, in run_env
    util.load_python_file(self.dir, "env.py")
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/util/pyfiles.py", line 95, in load_python_file
    module = load_module_py(module_id, path)
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/util/pyfiles.py", line 113, in load_module_py
    spec.loader.exec_module(module)  # type: ignore
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/app/alembic/env.py", line 81, in <module>
    run_migrations_online()
  File "/app/alembic/env.py", line 75, in run_migrations_online
    context.run_migrations()
  File "<string>", line 8, in run_migrations
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/runtime/environment.py", line 948, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/runtime/migration.py", line 615, in run_migrations
    for step in self._migrations_fn(heads, self):
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/command.py", line 392, in upgrade
    return script._upgrade_revs(revision, rev)
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/script/base.py", line 447, in _upgrade_revs
    with self._catch_revision_errors(
  File "/usr/local/lib/python3.10/contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/script/base.py", line 285, in _catch_revision_errors
    raise util.CommandError(err.args[0]) from err
alembic.util.exc.CommandError: Requested revision d7c6efd2de42 overlaps with other requested revisions 263dd6707191

[2024-04-26 09:04:16 +0200] [342] [ERROR] Application startup failed. Exiting.
[2024-04-26 09:04:16 +0200] [341] [ERROR] Application startup failed. Exiting.
[2024-04-26 09:04:16 +0200] [342] [INFO] Worker exiting (pid: 342)
[2024-04-26 09:04:16 +0200] [341] [INFO] Worker exiting (pid: 341)
[2024-04-26 09:04:18 +0200] [7] [ERROR] Worker (pid:342) exited with code 3
[2024-04-26 09:04:18 +0200] [7] [ERROR] Worker (pid:341) was sent SIGTERM!
[2024-04-26 09:04:18 +0200] [7] [ERROR] Shutting down: Master
[2024-04-26 09:04:18 +0200] [7] [ERROR] Reason: Worker failed to boot.

Architecture

amd64

OS

Virtual Machine

YoYoost commented 1 month ago

Had the same issue, according to https://github.com/alexbelgium/hassio-addons/issues/1197 the PGID/PUID should be set to 1000. This should be converted automatically for older installs but apparently new installs use the default PGID/PUID of 0.

alexbelgium commented 1 month ago

Thanks, corrected

123marvin123 commented 1 month ago

I'm still getting the same error on a fresh install using PGID/PUID set to 1000:

INFO     2024-05-02T19:21:42 - Running upgrade ab0bae02578f -> f30cf048c228, add new webhook fields
INFO     2024-05-02T19:21:42 - Running upgrade f30cf048c228 -> 188374910655, add login_attemps and locked_at field to user table
INFO     2024-05-02T19:21:42 - Running upgrade 188374910655 -> 089bfa50d0ed, Add is_ocr_recipe column to recipes
INFO     2024-05-02T19:21:42 - Running upgrade 089bfa50d0ed -> 44e8d670719d, add extras to shopping lists, list items, and ingredient foods
INFO     2024-05-02T19:21:42 - Running upgrade 44e8d670719d -> 2ea7a807915c, add recipe_timeline_events table
INFO     2024-05-02T19:21:42 - Running upgrade 2ea7a807915c -> 1923519381ad, added recipe last made timestamp
INFO     2024-05-02T19:21:42 - Running upgrade 1923519381ad -> 167eb69066ad, add recipe_scale to shopping list item ref
INFO     2024-05-02T19:21:42 - Running upgrade 167eb69066ad -> 165d943c64ee, add related user to mealplan
INFO     2024-05-02T19:21:42 - Running upgrade 165d943c64ee -> ff5f73b01a7a, add missing foreign key and order indices
INFO     2024-05-02T19:21:44 - Running upgrade ff5f73b01a7a -> 16160bf731a0, add more indices necessary for search
INFO     2024-05-02T19:21:44 - Running upgrade 16160bf731a0 -> 5ab195a474eb, add normalized search properties
INFO     2024-05-02T19:21:44 - Running upgrade 5ab195a474eb -> b04a08da2108, added shopping list label settings
INFO     2024-05-02T19:21:45 - Running upgrade b04a08da2108 -> 38514b39a824, add auth_method to user table
INFO     2024-05-02T19:21:45 - Running upgrade 38514b39a824 -> b3dbb554ba53, postgres fuzzy search
INFO     2024-05-02T19:21:45 - Running upgrade b3dbb554ba53 -> 04ac51cbe9a4, added group slug
INFO     2024-05-02T19:21:45 - Running upgrade 04ac51cbe9a4 -> 1825b5225403, added recipe note to shopping list recipe ref
INFO     2024-05-02T19:21:45 - Running upgrade 1825b5225403 -> bcfdad6b7355, remove tool name and slug unique contraints
INFO     2024-05-02T19:21:45 - Running upgrade bcfdad6b7355 -> 0341b154f79a, added normalized unit and food names
INFO     2024-05-02T19:21:45 - Running upgrade 0341b154f79a -> dded3119c1fe, added unique constraints
INFO     2024-05-02T19:21:45 - Running upgrade dded3119c1fe -> ba1e4a6cfe99, added plural names and alias tables for foods and units
INFO     2024-05-02T19:21:46 - Running upgrade ba1e4a6cfe99 -> 2298bb460ffd, added user to shopping list
INFO     2024-05-02T19:21:46 - Running upgrade 2298bb460ffd -> 09aba125b57a, add OIDC auth method
INFO     2024-05-02T19:21:46 - Running upgrade 09aba125b57a -> d7c6efd2de42, migrate favorites and ratings to user_ratings
INFO     2024-05-02T19:21:46 - Running upgrade d7c6efd2de42 -> 7788478a0338, add group recipe actions
INFO     2024-05-02T19:21:46 - Checking for migration data fixes
INFO     2024-05-02T19:21:46 - Database contains no users, initializing...
INFO     2024-05-02T19:21:46 - Generating Default Group
INFO     2024-05-02T19:21:47 - Generating Default User
INFO     2024-05-02T19:21:47 - end: database initialization
INFO     2024-05-02T19:21:47 - -----SYSTEM STARTUP-----
INFO     2024-05-02T19:21:47 - ------APP SETTINGS------
INFO     2024-05-02T19:21:47 - {
    "theme": {
        "light_primary": "#E58325",
        "light_accent": "#007A99",
        "light_secondary": "#973542",
        "light_success": "#43A047",
        "light_info": "#1976D2",
        "light_warning": "#FF6D00",
        "light_error": "#EF5350",
        "dark_primary": "#E58325",
        "dark_accent": "#007A99",
        "dark_secondary": "#973542",
        "dark_success": "#43A047",
        "dark_info": "#1976D2",
        "dark_warning": "#FF6D00",
        "dark_error": "#EF5350"
    },
    "PRODUCTION": true,
    "BASE_URL": "http://localhost:8080",
    "STATIC_FILES": "/spa/static",
    "IS_DEMO": false,
    "HOST_IP": "*",
    "API_HOST": "0.0.0.0",
    "API_PORT": 9000,
    "API_DOCS": true,
    "TOKEN_TIME": 48,
    "LOG_CONFIG_OVERRIDE": null,
    "LOG_LEVEL": "info",
    "GIT_COMMIT_HASH": "2f4c6bd5006413f82ddcc4fc722dbf744bcd2cad",
    "ALLOW_SIGNUP": true,
    "SECURITY_MAX_LOGIN_ATTEMPTS": 5,
    "SECURITY_USER_LOCKOUT_TIME": 24,
    "DB_ENGINE": "sqlite",
    "DEFAULT_GROUP": "Home",
    "SMTP_HOST": null,
    "SMTP_PORT": "587",
    "SMTP_FROM_NAME": "Mealie",
    "SMTP_FROM_EMAIL": null,
    "SMTP_AUTH_STRATEGY": "TLS",
    "LDAP_AUTH_ENABLED": false,
    "LDAP_SERVER_URL": null,
    "LDAP_TLS_INSECURE": false,
    "LDAP_TLS_CACERTFILE": null,
    "LDAP_ENABLE_STARTTLS": false,
    "LDAP_BASE_DN": null,
    "LDAP_QUERY_BIND": null,
    "LDAP_QUERY_PASSWORD": null,
    "LDAP_USER_FILTER": null,
    "LDAP_ADMIN_FILTER": null,
    "LDAP_ID_ATTRIBUTE": "uid",
    "LDAP_MAIL_ATTRIBUTE": "mail",
    "LDAP_NAME_ATTRIBUTE": "name",
    "OIDC_AUTH_ENABLED": false,
    "OIDC_CLIENT_ID": null,
    "OIDC_CONFIGURATION_URL": null,
    "OIDC_SIGNUP_ENABLED": true,
    "OIDC_USER_GROUP": null,
    "OIDC_ADMIN_GROUP": null,
    "OIDC_AUTO_REDIRECT": false,
    "OIDC_PROVIDER_NAME": "OAuth",
    "OIDC_REMEMBER_ME": false,
    "OIDC_SIGNING_ALGORITHM": "RS256",
    "OIDC_USER_CLAIM": "email",
    "OIDC_TLS_CACERTFILE": null,
    "TESTING": false
}
[2024-05-02 19:21:47 +0200] [313] [INFO] Application startup complete.
[2024-05-02 19:21:47 +0200] [7] [ERROR] Worker (pid:313) was sent SIGTERM!
[2024-05-02 19:21:47 +0200] [7] [ERROR] Shutting down: Master
[2024-05-02 19:21:47 +0200] [7] [ERROR] Reason: Worker failed to boot.

Edit: It does startup normally after the first crash

Mccoys88 commented 1 month ago

I had the same problem, but tried uninstalling and deleting Mealie files via 'filebrowser' and reinstalling, and it worked.

Found the solution in this thread: https://github.com/alexbelgium/hassio-addons/issues/1358#issuecomment-2080463049

github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

skank01 commented 1 month ago

Just installed this. When starting i checked config and PGID/PUID was set to 1000:

Starting: Worker failed to boot

Edit: After second start, its okay and running

github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.