-
-
Notifications
You must be signed in to change notification settings - Fork 807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] - Update from nightly, corrupt installation/database #2757
Comments
It looks like your database wasn't auto-updated when you went to the newer Mealie version. I'm not sure why, it could be something Portainer is doing, but your db is missing some of the newer columns. |
that was my guess reading the logs, any way to migrate the database? Family has become really reliant on Mealie it turns out.. |
It's supposed to happen automatically when you start up the backend, so you can try restarting the container and see what happens. You can also try grabbing a backup, starting up a fresh instance (with an empty db) and then importing a backup |
tried recreating the container a few times without success. then tried a new instance, empty installation folder and tried uploading the database to that and got this error, INFO: 192.168.1.1:0 - "POST /api/admin/backups/upload HTTP/1.1" 500 Internal Server Error |
sort of at a loss here since even a new instance dont seem to work, thankfully i get a backup beforehand but that dousent really seem to be much use at the moment. Apprecate the quick responce @michael-genson and if you have any suggestions i´m all ears but it seems to be a bug with the upload migration process? |
I'll see if I can find time to try it locally and see what's up using the backup your provided. Looks like two separate issues (originally your db didn't upgrade, then your backup didn't import). Another thing you can try in the meantime is spinning up the version you had originally, restoring the db, then try upgrading again. |
Greatly appreciate that Michael, you have no idea. at a bind with the better half at the moment : |
You should be able to go back to RC1.1 without any issues (hold on the to backup just in case) |
curious, what is the link for the RC1.1, not a big github user, below is the link i use for the nightly build but not sure about the RC build/branch. image: ghcr.io/mealie-recipes/mealie:nightly |
|
Tried a fresh install with RC1.1 but i´m getting the same error when uploading the database as before. ERROR: Exception in ASGI application |
Ah, what a releaf, any idea on when that PR will be in the nightly? |
Probably within the next day or two, if someone's able to look at it and approve it |
Sorry it took a while, had some issues but finally got it working. Cant thank you enough Michael. fresh install, replace all files and the new database you attached seemed to do the trick, really appreciated. Fingers crossed the next update goes smoother. |
Glad to hear it worked!! |
I have the same issue migrating from v1.0.0beta-5 to 1.0.0-RC2 even with the latest, which modification i had to do to the db? |
Can you post your logs? |
Sorry for late answer, logs: File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/sql/elements.py", line 483, in _execute_on_connection |
I would stay on 1.0.0b5 for now and wait for #2859 to get merged. Once you can pull nightly (or any release with that PR) you should be able to either upgrade or restore from a backup |
First Check
What is the issue you are experiencing?
Used Portainer to recreate the container pulling the latest version from nightly build and i can login to Mealie and see the lists of cookbooks, but as soon as i open a recipe i get a server error.
Not sure how old the last installation was, maybe 2 months.
Tried uploading a backup that was taken just before the update but failed, resulting in another 500 code. guissing the database is mismatched from the build.
Steps to Reproduce
Update to newest nightly build from docker.
Please provide relevant logs
ERROR: 25-Nov-23 17:33:21 Unknown Error on recipe controller action
ERROR: 25-Nov-23 17:33:21 (sqlite3.OperationalError) no such column: ingredient_units_1.plural_name
�
{[SQL: SELECT recipes_ingredients.recipe_id AS recipes_ingredients_recipe_id, recipes_ingredients.id AS recipes_ingredients_id, recipes_ingredients.position AS recipes_ingredients_position, recipes_ingredients.title AS recipes_ingredients_title, recipes_ingredients.note AS recipes_ingredients_note, recipes_ingredients.unit_id AS recipes_ingredients_unit_id, recipes_ingredients.food_id AS recipes_ingredients_food_id, recipes_ingredients.quantity AS recipes_ingredients_quantity, recipes_ingredients.original_text AS recipes_ingredients_original_text, recipes_ingredients.reference_id AS recipes_ingredients_reference_id, recipes_ingredients.note_normalized AS recipes_ingredients_note_normalized, recipes_ingredients.original_text_normalized AS recipes_ingredients_original_text_normalized, recipes_ingredients.created_at AS recipes_ingredients_created_at, recipes_ingredients.update_at AS recipes_ingredients_update_at, ingredient_units_1.id AS ingredient_units_1_id, ingredient_units_1.group_id AS ingredient_units_1_group_id, ingredient_units_1.name AS ingredient_units_1_name, ingredient_units_1.plural_name AS ingredient_units_1_plural_name, ingredient_units_1.description AS ingredient_units_1_description, ingredient_units_1.abbreviation AS ingredient_units_1_abbreviation, ingredient_units_1.plural_abbreviation AS ingredient_units_1_plural_abbreviation, ingredient_units_1.use_abbreviation AS ingredient_units_1_use_abbreviation, ingredient_units_1.fraction AS ingredient_units_1_fraction, ingredient_units_1.name_normalized AS ingredient_units_1_name_normalized, ingredient_units_1.plural_name_normalized AS ingredient_units_1_plural_name_normalized, ingredient_units_1.abbreviation_normalized AS ingredient_units_1_abbreviation_normalized, ingredient_units_1.plural_abbreviation_normalized AS ingredient_units_1_plural_abbreviation_normalized, ingredient_units_1.created_at AS ingredient_units_1_created_at, ingredient_units_1.update_at AS ingredient_units_1_update_at, ingredient_food_extras_1.ingredient_food_id AS ingredient_food_extras_1_ingredient_food_id, ingredient_food_extras_1.id AS ingredient_food_extras_1_id, ingredient_food_extras_1.key_name AS ingredient_food_extras_1_key_name, ingredient_food_extras_1.value AS ingredient_food_extras_1_value, ingredient_food_extras_1.created_at AS ingredient_food_extras_1_created_at, ingredient_food_extras_1.update_at AS ingredient_food_extras_1_update_at, multi_purpose_labels_1.id AS multi_purpose_labels_1_id, multi_purpose_labels_1.name AS multi_purpose_labels_1_name, multi_purpose_labels_1.color AS multi_purpose_labels_1_color, multi_purpose_labels_1.group_id AS multi_purpose_labels_1_group_id, multi_purpose_labels_1.created_at AS multi_purpose_labels_1_created_at, multi_purpose_labels_1.update_at AS multi_purpose_labels_1_update_at, ingredient_foods_1.id AS ingredient_foods_1_id, ingredient_foods_1.group_id AS ingredient_foods_1_group_id, ingredient_foods_1.name AS ingredient_foods_1_name, ingredient_foods_1.plural_name AS ingredient_foods_1_plural_name, ingredient_foods_1.description AS ingredient_foods_1_description, ingredient_foods_1.label_id AS ingredient_foods_1_label_id, ingredient_foods_1.name_normalized AS ingredient_foods_1_name_normalized, ingredient_foods_1.plural_name_normalized AS ingredient_foods_1_plural_name_normalized, ingredient_foods_1.created_at AS ingredient_foods_1_created_at, ingredient_foods_1.update_at AS ingredient_foods_1_update_at
FROM recipes_ingredients LEFT OUTER JOIN ingredient_units AS ingredient_units_1 ON ingredient_units_1.id = recipes_ingredients.unit_id LEFT OUTER JOIN ingredient_foods AS ingredient_foods_1 ON ingredient_foods_1.id = recipes_ingredients.food_id LEFT OUTER JOIN ingredient_food_extras AS ingredient_food_extras_1 ON ingredient_foods_1.id = ingredient_food_extras_1.ingredient_food_id LEFT OUTER JOIN multi_purpose_labels AS multi_purpose_labels_1 ON multi_purpose_labels_1.id = ingredient_foods_1.label_id
WHERE recipes_ingredients.recipe_id IN (?) ORDER BY recipes_ingredients.position]
[parameters: ('d798f20834534c228f6f6a37c4752f11',)]
(Background on this error at: https://sqlalche.me/e/20/e3q8)
Traceback (most recent call last):
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1965, in _exec_single_context
self.dialect.do_execute(
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 921, in do_execute
cursor.execute(statement, parameters)
sqlite3.OperationalError: no such column: ingredient_units_1.plural_name
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/app/mealie/routes/recipe/recipe_crud_routes.py", line 286, in get_one
recipe = self.service.get_one_by_slug_or_id(slug)
File "/app/mealie/services/recipe/recipe_service.py", line 123, in get_one_by_slug_or_id
return self._get_recipe(slug_or_id, "slug")
File "/app/mealie/services/recipe/recipe_service.py", line 48, in _get_recipe
recipe = self.repos.recipes.by_group(self.group.id).get_one(data, key)
File "/app/mealie/repos/repository_generic.py", line 159, in get_one
result = self.session.execute(q).unique().scalars().one_or_none()
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/engine/result.py", line 1815, in one_or_none
return self._only_one_row(
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/engine/result.py", line 757, in _only_one_row
row: Optional[_InterimRowType[Any]] = onerow(hard_close=True)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/engine/result.py", line 1690, in _fetchone_impl
return self._real_result._fetchone_impl(hard_close=hard_close)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/engine/result.py", line 2282, in _fetchone_impl
row = next(self.iterator, _NO_ROW)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/loading.py", line 218, in chunks
post_load.invoke(context, path)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/loading.py", line 1507, in invoke
loader(
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/strategies.py", line 3196, in _load_for_path
self._load_via_parent(
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/strategies.py", line 3272, in _load_via_parent
context.session.execute(
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 2246, in execute
return self._execute_internal(
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 2141, in _execute_internal
result: Result[Any] = compile_state_cls.orm_execute_statement(
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/context.py", line 293, in orm_execute_statement
result = conn.execute(
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1412, in execute
return meth(
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/sql/elements.py", line 483, in _execute_on_connection
return connection._execute_clauseelement(
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1635, in _execute_clauseelement
ret = self._execute_context(
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1844, in _execute_context
return self._exec_single_context(
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1984, in _exec_single_context
self._handle_dbapi_exception(
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 2339, in _handle_dbapi_exception
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1965, in _exec_single_context
self.dialect.do_execute(
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 921, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such column: ingredient_units_1.plural_name
�
{[SQL: SELECT recipes_ingredients.recipe_id AS recipes_ingredients_recipe_id, recipes_ingredients.id AS recipes_ingredients_id, recipes_ingredients.position AS recipes_ingredients_position, recipes_ingredients.title AS recipes_ingredients_title, recipes_ingredients.note AS recipes_ingredients_note, recipes_ingredients.unit_id AS recipes_ingredients_unit_id, recipes_ingredients.food_id AS recipes_ingredients_food_id, recipes_ingredients.quantity AS recipes_ingredients_quantity, recipes_ingredients.original_text AS recipes_ingredients_original_text, recipes_ingredients.reference_id AS recipes_ingredients_reference_id, recipes_ingredients.note_normalized AS recipes_ingredients_note_normalized, recipes_ingredients.original_text_normalized AS recipes_ingredients_original_text_normalized, recipes_ingredients.created_at AS recipes_ingredients_created_at, recipes_ingredients.update_at AS recipes_ingredients_update_at, ingredient_units_1.id AS ingredient_units_1_id, ingredient_units_1.group_id AS ingredient_units_1_group_id, ingredient_units_1.name AS ingredient_units_1_name, ingredient_units_1.plural_name AS ingredient_units_1_plural_name, ingredient_units_1.description AS ingredient_units_1_description, ingredient_units_1.abbreviation AS ingredient_units_1_abbreviation, ingredient_units_1.plural_abbreviation AS ingredient_units_1_plural_abbreviation, ingredient_units_1.use_abbreviation AS ingredient_units_1_use_abbreviation, ingredient_units_1.fraction AS ingredient_units_1_fraction, ingredient_units_1.name_normalized AS ingredient_units_1_name_normalized, ingredient_units_1.plural_name_normalized AS ingredient_units_1_plural_name_normalized, ingredient_units_1.abbreviation_normalized AS ingredient_units_1_abbreviation_normalized, ingredient_units_1.plural_abbreviation_normalized AS ingredient_units_1_plural_abbreviation_normalized, ingredient_units_1.created_at AS ingredient_units_1_created_at, ingredient_units_1.update_at AS ingredient_units_1_update_at, ingredient_food_extras_1.ingredient_food_id AS ingredient_food_extras_1_ingredient_food_id, ingredient_food_extras_1.id AS ingredient_food_extras_1_id, ingredient_food_extras_1.key_name AS ingredient_food_extras_1_key_name, ingredient_food_extras_1.value AS ingredient_food_extras_1_value, ingredient_food_extras_1.created_at AS ingredient_food_extras_1_created_at, ingredient_food_extras_1.update_at AS ingredient_food_extras_1_update_at, multi_purpose_labels_1.id AS multi_purpose_labels_1_id, multi_purpose_labels_1.name AS multi_purpose_labels_1_name, multi_purpose_labels_1.color AS multi_purpose_labels_1_color, multi_purpose_labels_1.group_id AS multi_purpose_labels_1_group_id, multi_purpose_labels_1.created_at AS multi_purpose_labels_1_created_at, multi_purpose_labels_1.update_at AS multi_purpose_labels_1_update_at, ingredient_foods_1.id AS ingredient_foods_1_id, ingredient_foods_1.group_id AS ingredient_foods_1_group_id, ingredient_foods_1.name AS ingredient_foods_1_name, ingredient_foods_1.plural_name AS ingredient_foods_1_plural_name, ingredient_foods_1.description AS ingredient_foods_1_description, ingredient_foods_1.label_id AS ingredient_foods_1_label_id, ingredient_foods_1.name_normalized AS ingredient_foods_1_name_normalized, ingredient_foods_1.plural_name_normalized AS ingredient_foods_1_plural_name_normalized, ingredient_foods_1.created_at AS ingredient_foods_1_created_at, ingredient_foods_1.update_at AS ingredient_foods_1_update_at
FROM recipes_ingredients LEFT OUTER JOIN ingredient_units AS ingredient_units_1 ON ingredient_units_1.id = recipes_ingredients.unit_id LEFT OUTER JOIN ingredient_foods AS ingredient_foods_1 ON ingredient_foods_1.id = recipes_ingredients.food_id LEFT OUTER JOIN ingredient_food_extras AS ingredient_food_extras_1 ON ingredient_foods_1.id = ingredient_food_extras_1.ingredient_food_id LEFT OUTER JOIN multi_purpose_labels AS multi_purpose_labels_1 ON multi_purpose_labels_1.id = ingredient_foods_1.label_id
WHERE recipes_ingredients.recipe_id IN (?) ORDER BY recipes_ingredients.position]
[parameters: ('d798f20834534c228f6f6a37c4752f11',)]
(Background on this error at: https://sqlalche.me/e/20/e3q8)
INFO: 192.168.1.1:0 - "GET /api/recipes/bougatsa HTTP/1.1" 500 Internal Server Error
Mealie Version
Build
fcd4854cb87ecdc396ebf5660f3aa6ad188d3247
Deployment
Docker (Synology)
Additional Deployment Details
No response
The text was updated successfully, but these errors were encountered: