Skip to content
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

🐛 [Mealie] Mealie not recognising login details #1580

Open
Valve90210 opened this issue Sep 20, 2024 · 18 comments
Open

🐛 [Mealie] Mealie not recognising login details #1580

Valve90210 opened this issue Sep 20, 2024 · 18 comments
Labels
bug Something isn't working

Comments

@Valve90210
Copy link

Description

I've just tried to look on Mealie and was presented with the Login page with a message that it looks like my first time logging in.

Entered my user details and was told they were incorrect. I tried a second user I have setup and that failed too. I've tried resetting the password but can see in the log in HA that it thinks neither user exists.

Looking in File Editor in HA I can see there are two user folders in the "/homeassistant/addons_config/mealie_data" folder, along with folders for Backups, Groups and logs etc. Though none of them seem to have been written to since 9th August this year.

But I've also noticed a folder dated today called db21ed7f_mealie which doesn't show anything when I try to select it in File Editor.

I realised Filebrowser would probably be more useful to seeing what is in different folders etc but I'm having the exact same issue with the Filebrowser addon too...

Reproduction steps

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

Addon Logs

DATA_DIR=/config
PGID=1000
PUID=1000
certfile=fullchain.pem
keyfile=privkey.pem
ssl=false
[16:48:59] INFO: No config.yaml found in /config/addons_config/mealie/config.yaml, using default parameters
Permissions adapted
[16:48:59] INFO: Starting nginx
[16:48:59] INFO: Starting app
INFO     2024-09-20T16:49:26 - Started server process [7]
INFO     2024-09-20T16:49:26 - Waiting for application startup.
INFO     2024-09-20T16:49:26 - start: database initialization
INFO     2024-09-20T16:49:26 - Database connection established.
INFO     2024-09-20T16:49:26 - Context impl SQLiteImpl.
INFO     2024-09-20T16:49:26 - Will assume non-transactional DDL.
INFO     2024-09-20T16:49:26 - Checking for migration data fixes
INFO     2024-09-20T16:49:27 - end: database initialization
INFO     2024-09-20T16:49:27 - -----SYSTEM STARTUP-----
INFO     2024-09-20T16:49:27 - ------APP SETTINGS------
INFO     2024-09-20T16:49:27 - {
    "TESTING": false,
    "PRODUCTION": true,
    "LOG_CONFIG_OVERRIDE": null,
    "LOG_LEVEL": "info",
    "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"
    },
    "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,
    "GIT_COMMIT_HASH": "0d06494bbfc62fc8a1771a85fd308190891d6167",
    "ALLOW_SIGNUP": true,
    "DAILY_SCHEDULE_TIME": "23:45",
    "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_GROUPS_CLAIM": "groups",
    "OIDC_TLS_CACERTFILE": null,
    "OPENAI_BASE_URL": null,
    "OPENAI_API_KEY": null,
    "OPENAI_MODEL": "gpt-4o",
    "OPENAI_ENABLE_IMAGE_SERVICES": true,
    "OPENAI_WORKERS": 2,
    "OPENAI_SEND_DATABASE_DATA": true,
    "OPENAI_REQUEST_TIMEOUT": 60,
    "WORKER_PER_CORE": 1,
    "UVICORN_WORKERS": 1
}
INFO     2024-09-20T16:49:27 - Daily tasks scheduled for 2024-09-20 22:45:00+00:00
INFO     2024-09-20T16:49:27 - Application startup complete.
INFO     2024-09-20T16:49:27 - Uvicorn running on http://0.0.0.0:9000 (Press CTRL+C to quit)
INFO     2024-09-20T16:49:56 - [127.0.0.1:39322] 200 OK "GET /api/app/about HTTP/1.1"

Architecture

No response

OS

No response

@Valve90210 Valve90210 added the bug Something isn't working label Sep 20, 2024
@alexbelgium
Copy link
Owner

Hi, that's strange nothing changed why filebrowser. It has been stable for quite some time, as I blocked updates to an incompatibility of recent versions with ingress.

Could you please try to refresh your add-on repositories, uninstall and reinstall the add-on? If you're database was still v1 it should work and retake the link with your previous mealie folders in /homeassistant/addons_config/mealie_data

@ryan7273
Copy link

I experienced a similar problem this week. In my case it was because I have a postgres backend and mealie stopped reading environment variables correctly (#1558). It created a brand new default database and presented me with the new install screen.

@Valve90210
Copy link
Author

Hi

Sorry for the delay in coming back to you, I've been crazy busy and not had a chance to look at this.

I went to the addons and noticed there was an update for Mealie, so I tried updating but got an error when trying to start the addon...

So I uninstalled and reinstalled mealie but when trying to start it I'm getting the same error as I was when I updated.

This is the log.

module = load_module_py(module_id, path)

File "", line 241, in _call_with_frames_removed
File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/util/pyfiles.py", line 113, in load_module_py
File "/app/alembic/env.py", line 81, in
spec.loader.exec_module(module) # type: ignore
run_migrations_online()
File "", line 883, in exec_module
File "/app/alembic/env.py", line 75, in run_migrations_online
context.run_migrations()
File "", line 8, in run_migrations
File "", line 241, in _call_with_frames_removed
File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/runtime/environment.py", line 946, in run_migrations
File "/app/alembic/env.py", line 81, in
self.get_context().run_migrations(**kw)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/runtime/migration.py", line 616, in run_migrations
run_migrations_online()
File "/app/alembic/env.py", line 75, in run_migrations_online
context.run_migrations()
File "", line 8, in run_migrations
File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/runtime/environment.py", line 946, in run_migrations
self.get_context().run_migrations(**kw)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/runtime/migration.py", line 616, in run_migrations
for step in self._migrations_fn(heads, self):
File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/command.py", line 395, in upgrade
return script._upgrade_revs(revision, rev)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/script/base.py", line 446, 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 282, in _catch_revision_errors
raise util.CommandError(resolution) from re
alembic.util.exc.CommandError: Can't locate revision identified by 'feecc8ffb956'

ERROR 2024-09-24T12:39:07 - Application startup failed. Exiting.
for step in self._migrations_fn(heads, self):
File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/command.py", line 395, in upgrade
return script._upgrade_revs(revision, rev)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/script/base.py", line 446, 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 282, in _catch_revision_errors
raise util.CommandError(resolution) from re
alembic.util.exc.CommandError: Can't locate revision identified by 'feecc8ffb956'

ERROR 2024-09-24T12:39:07 - Application startup failed. Exiting.
/etc/cont-init.d/00-banner.sh: executing


Add-on: Mealie
Mealie is a self hosted recipe manager and meal planner built in Vue

Add-on version: v1.12.0-2
You are running the latest version of this add-on.
System: Home Assistant OS 13.1 (amd64 / generic-x86-64)
Home Assistant Core: 2024.9.2
Home Assistant Supervisor: 2024.09.1

Please, share the above information when looking for help
or support in, e.g., GitHub, forums

Provided by: https://github.com/alexbelgium/hassio-addons

Defining permissions for main user :
User UID: 1000
User GID : 1000

/etc/cont-init.d/00-global_var.sh: executing
ALLOW_SIGNUP='true'
DATA_DIR='/config/addons_config/mealie_data'
PGID='1000'
PUID='1000'
certfile='fullchain.pem'
keyfile='privkey.pem'
ssl='false'
Timezone set from Etc/UTC to Europe/London
/etc/cont-init.d/01-config_yaml.sh: executing
Setting permissions for the config.yaml directory

Load environment variables from /config/addons_config/mealie/config.yaml if existing
If accessing the file with filebrowser it should be mapped to /homeassistant/addons_config/mealie/config.yaml

Wiki here on how to use : github.com/alexbelgium/hassio-addons/wiki/Add‐ons-feature-:-add-env-variables

... no env variables found, exiting
/etc/cont-init.d/01-custom_script.sh: executing
Execute /homeassistant/addons_config/mealie/mealie.sh if existing
Wiki here : github.com/alexbelgium/hassio-addons/wiki/Add-ons-feature-:-customisation
/etc/cont-init.d/31-nginx.sh: executing
[12:39:16] INFO: Exporting variables
ALLOW_SIGNUP=true
DATA_DIR=/config/addons_config/mealie_data
PGID=1000
PUID=1000
certfile=fullchain.pem
keyfile=privkey.pem
ssl=false
[12:39:17] INFO: config.yaml found in /config/addons_config/mealie/config.yaml, exporting variables
Permissions adapted
[12:39:17] INFO: Starting nginx
[12:39:17] INFO: Starting app

@rfeldt
Copy link

rfeldt commented Sep 25, 2024

I have exatcly the same issue. Loginscreen says it seems to be my first login, and will not accept valid login info or password reset.

@minmaxat
Copy link

i solved this via completly uninstall, delete the files on HA (had some files in the config (homeassistant) folder and some in the /addon_config) then restart HA, reinstall Mealie, start Mealie one time (now the files located config (homeassistant), then replaced the files from a former backup - then everything is working again. Little tricky as i think some update change the file location and back again.

Copy link
Contributor

github-actions bot commented Oct 6, 2024

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.

@github-actions github-actions bot added the stale Element will be closed automatically label Oct 6, 2024
@alexbelgium
Copy link
Owner

Hopefully the new version should solve once and for all the issue as it is now on 2.0 beta

@github-actions github-actions bot removed the stale Element will be closed automatically label Oct 13, 2024
@rfeldt
Copy link

rfeldt commented Oct 14, 2024

2.0 beta did not fix problem. Still same login screen. Seems like first login and will not accept login credentials. I have not tried to reinstall, but that seems to fix it?

@Jaykurb
Copy link

Jaykurb commented Oct 14, 2024

I upgraded from v1.12.0-2 > v2.0-beta and got the same outcome. Had to restore backup.

@Valve90210
Copy link
Author

I updated to the Beta 2 and it was working fine but just noticed it's updated to Beta 4 and this is happening again now.

@alexbelgium
Copy link
Owner

Hi, only difference between beta 2 and beta 4 is where the config is stored. If you have an issue, it's perhaps because there were some erroneous files in /config already.

The solution : go in the Filebrowser addon, open the path /config/db21ed7f_mealie, move everything there in a new folder named old. Go then in the path /homeassistant/addons_config/mealie_data and remove the file named migrated.

Once you'll restart, it will see that the file named migrated is not there and will perform again the migration to the new /config path.

Here is the explanation :
Previous logic :

  • Paths within container :
    • Data: /config/addons_config/mealie_data
    • Injector script: /config/addons_autoscripts/mealie.sh
    • Env file : /config/addons_autoscripts/mealie/config.yaml
  • Paths from HA (for example with Filebrowser) :
    • Data: /homeassistant/addons_config/mealie_data
    • Injector script: /homeassistant/addons_autoscripts/mealie.sh
    • Env file : /homeassistant/addons_autoscripts/mealie/config.yaml
  • Addon option : DATA_DIR="/config/addons_config/mealie_data"

New logic :

  • Paths within container :
    • Data: /config
    • Injector script: /config/mealie.sh
    • Env file : /config/config.yaml
  • Paths from HA (for example with Filebrowser) :
    • Data: /addon_configs/db21ed7f_mealie
    • Injector script: /addon_configs/db21ed7f_mealie/mealie.sh
    • Env file : /addon_configs/db21ed7f_mealie/config.yaml
  • Previous files backup (will not be used anymore thanks to the "Migrated file" that is now in their folder) :
    • Data: /homeassistant/addons_config/mealie_data
    • Injector script: /homeassistant/addons_autoscripts/mealie.sh
    • Env file : /homeassistant/addons_autoscripts/mealie/config.yaml
  • Addon option : DATA_DIR="/config"

Migration is done automatically, and previous files are still accessible at their previous place but a text file "migrated" was added to show that they were migrated and won't be used again. The DATA_DIR variable is changed from the default of "/config/addons_config/mealie_data" to "/config". If it was manually changed from the default, it should be changed manually also.

@alexbelgium
Copy link
Owner

The current status of the addon is expected to be final in terms of structure : all config should now be in the /config folder, which allows backup and is aligned with homeassistant best practices, and the database is migrated to 2.0

The only change I expect in near future is implementation of Ingress.

Thanks all for your patience! It was not easy, and I'm sorry for any data loss that you incurred (or the wrath of your significant other if some recipes were lost).

@Valve90210
Copy link
Author

Just given your solution a go and I seem to be back up and running nicely, all my recipes are there an my log in details are working.

Really appreciate all the work you do on these addons!!

@Jaykurb
Copy link

Jaykurb commented Oct 15, 2024

Thank you @alexbelgium!! I had a duplicate Mealie installation inside my original installation. All sorted now. Been looking forward to this version. Households feature is finally here!!

Copy link
Contributor

github-actions bot commented Nov 3, 2024

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.

@github-actions github-actions bot added the stale Element will be closed automatically label Nov 3, 2024
@alexbelgium
Copy link
Owner

Ingress is now implemented! Please let me know how that goes

@ryan7273
Copy link

ryan7273 commented Nov 7, 2024

Ingress is working very well and Mealie is still reading my config file correctly. Thanks for all the work you're putting into this!

@alexbelgium
Copy link
Owner

Thanks very much! Glad it works, it should now be very stable

@github-actions github-actions bot removed the stale Element will be closed automatically label Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants