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

[BUG] - Migration from V1.3.2 to V1.4.0 #3423

Closed
5 of 6 tasks
dhenry123 opened this issue Apr 4, 2024 · 7 comments · Fixed by #3424
Closed
5 of 6 tasks

[BUG] - Migration from V1.3.2 to V1.4.0 #3423

dhenry123 opened this issue Apr 4, 2024 · 7 comments · Fixed by #3424
Labels
bug Something isn't working triage

Comments

@dhenry123
Copy link

First Check

  • This is not a feature request.
  • I added a very descriptive title to this issue (title field is above this).
  • I used the GitHub search to find a similar issue and didn't find it.
  • I searched the Mealie documentation, with the integrated search.
  • I already read the docs and didn't find an answer.
  • This issue can be replicated on the demo site (https://demo.mealie.io/).

What is the issue you are experiencing?

After migrate my container from v1.3.2 to V1.4.0, service doesn't boot. Sql error on data migration
Back to V1.3.2 successfully...

Steps to Reproduce

Container is installed in kubernetes cluster
Update manifest (container tag: v1.4.0)
Worker download image
Worker start image
Crash
Worker rollback
Service up (v1.3.2)

Please provide relevant logs

Traceback (most recent call last):
  File "/app/mealie/db/init_db.py", line 119, in <module>
    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 25, in <module>
    config.set_main_option("sqlalchemy.url", settings.DB_URL)
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/config.py", line 272, in set_main_option
    self.set_section_option(self.config_ini_section, name, value)
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/alembic/config.py", line 299, in set_section_option
    self.file_config.set(section, name, value)
  File "/usr/local/lib/python3.10/configparser.py", line 1206, in set
    super().set(section, option, value)
  File "/usr/local/lib/python3.10/configparser.py", line 896, in set
    value = self._interpolation.before_set(self, section, option,
  File "/usr/local/lib/python3.10/configparser.py", line 403, in before_set
    raise ValueError("invalid interpolation syntax in %r at "
ValueError: invalid interpolation syntax in 'postgresql://xxxxxx@xxxxxxxxxx:xxx/xxxxxxxxxxx' at position 26

Mealie Version

hkotel/mealie:v1.4.0-arm64

Deployment

Docker (Linux)

Additional Deployment Details

Posgresql V16.2-1

@dhenry123 dhenry123 added bug Something isn't working triage labels Apr 4, 2024
@michael-genson
Copy link
Collaborator

Likely a duplicate of #3418. Do you have % characters in your postgres password? If yes, you need to escape them with a double percent (e.g. abc%123 --> abc%%123). Please see #3418 for more details.

@AverageMarcus
Copy link
Contributor

I'm having this same issue but I don't have a % in my password. I have several other special chars in my password but according to #3418 it should just be % that is effected?

@michael-genson
Copy link
Collaborator

@AverageMarcus
Copy link
Contributor

URL encoding the whole password didn't work ("bad password") so I suspect its specific characters :(

@AverageMarcus
Copy link
Contributor

Based on the log message (which prints out the password 😬) it looks like at the point its failing the password has been url-encoded already as I see all spacial characters replaced in the postgres URL.

The URL, with encoding, is valid when I use it with psql.

Interestingly, if I put in a bad password I get a log error saying the password is incorrect but if I use the correct one I get this interpolation issue. So I guess in the code it first does successfully use the password to connect to the database but there's a problem in the migration part perhaps?

@michael-genson
Copy link
Collaborator

Hmm, it's possible that the URL encoded password is invalid somehow (i.e. one of the characters that's getting URL encoded creates a string postgres doesn't like). I believe someone is looking into a PR to fix the issue in general, though.

In the meantime, I would recommend changing your postgres password, or staying on 1.3 until we're able to fix it.

@AverageMarcus
Copy link
Contributor

I changed my password and removed any special characters that required URL encoding (things like -, _ and . are still ok without encoding) and that's sorted it for me. Not ideal but managable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants