~wildeyedskies


#158 TOML error on upgrade 8 months ago

Ticket created by ~wildeyedskies on ~tsileo/microblog.pub

On the latest container I'm getting the following error

microblogpub  | Traceback (most recent call last):
microblogpub  |   File "/opt/venv/.venv/bin/alembic", line 8, in <module>
microblogpub  |     sys.exit(main())
microblogpub  |              ^^^^^^
microblogpub  |   File "/opt/venv/.venv/lib/python3.11/site-packages/alembic/config.py", line 632, in main
microblogpub  |     CommandLine(prog=prog).main(argv=argv)
microblogpub  |   File "/opt/venv/.venv/lib/python3.11/site-packages/alembic/config.py", line 626, in main
microblogpub  |     self.run_cmd(cfg, options)
microblogpub  |   File "/opt/venv/.venv/lib/python3.11/site-packages/alembic/config.py", line 603, in run_cmd
microblogpub  |     fn(
microblogpub  |   File "/opt/venv/.venv/lib/python3.11/site-packages/alembic/command.py", line 385, in upgrade
microblogpub  |     script.run_env()
microblogpub  |   File "/opt/venv/.venv/lib/python3.11/site-packages/alembic/script/base.py", line 582, in run_env
microblogpub  |     util.load_python_file(self.dir, "env.py")
microblogpub  |   File "/opt/venv/.venv/lib/python3.11/site-packages/alembic/util/pyfiles.py", line 94, in load_python_file
microblogpub  |     module = load_module_py(module_id, path)
microblogpub  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
microblogpub  |   File "/opt/venv/.venv/lib/python3.11/site-packages/alembic/util/pyfiles.py", line 110, in load_module_py
microblogpub  |     spec.loader.exec_module(module)  # type: ignore
microblogpub  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
microblogpub  |   File "<frozen importlib._bootstrap_external>", line 940, in exec_module
microblogpub  |   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
microblogpub  |   File "/app/alembic/env.py", line 6, in <module>
microblogpub  |     import app.models  # noqa: F401  # Register models
microblogpub  |     ^^^^^^^^^^^^^^^^^
microblogpub  |   File "/app/app/models.py", line 24, in <module>
microblogpub  |     from app import activitypub as ap
microblogpub  |   File "/app/app/activitypub.py", line 10, in <module>
microblogpub  |     from app import config
microblogpub  |   File "/app/app/config.py", line 164, in <module>
microblogpub  |     CONFIG = load_config()
microblogpub  |              ^^^^^^^^^^^^^
microblogpub  |   File "/app/app/config.py", line 138, in load_config
microblogpub  |     tomli.loads((ROOT_DIR / "data" / _CONFIG_FILE).read_text())
microblogpub  |   File "/opt/venv/.venv/lib/python3.11/site-packages/tomli/_parser.py", line 102, in loads
microblogpub  |     pos = key_value_rule(src, pos, out, header, parse_float)
microblogpub  |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
microblogpub  |   File "/opt/venv/.venv/lib/python3.11/site-packages/tomli/_parser.py", line 326, in key_value_rule
microblogpub  |     pos, key, value = parse_key_value_pair(src, pos, parse_float)
microblogpub  |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
microblogpub  |   File "/opt/venv/.venv/lib/python3.11/site-packages/tomli/_parser.py", line 369, in parse_key_value_pair
microblogpub  |     pos, value = parse_value(src, pos, parse_float)
microblogpub  |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
microblogpub  |   File "/opt/venv/.venv/lib/python3.11/site-packages/tomli/_parser.py", line 616, in parse_value
microblogpub  |     return parse_array(src, pos, parse_float)
microblogpub  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
microblogpub  |   File "/opt/venv/.venv/lib/python3.11/site-packages/tomli/_parser.py", line 420, in parse_array
microblogpub  |     pos, val = parse_value(src, pos, parse_float)
microblogpub  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
microblogpub  |   File "/opt/venv/.venv/lib/python3.11/site-packages/tomli/_parser.py", line 616, in parse_value
microblogpub  |     return parse_array(src, pos, parse_float)
microblogpub  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
microblogpub  |   File "/opt/venv/.venv/lib/python3.11/site-packages/tomli/_parser.py", line 420, in parse_array
microblogpub  |     pos, val = parse_value(src, pos, parse_float)
microblogpub  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
microblogpub  |   File "/opt/venv/.venv/lib/python3.11/site-packages/tomli/_parser.py", line 649, in parse_value
microblogpub  |     raise suffixed_err(src, pos, "Invalid value")
microblogpub  | tomli.TOMLDecodeError: Invalid value (at line 12, column 4)

The profile.toml is as follows

domain = "<REDACTED>"
username = "toast"
admin_password = "<REDACTED>"
name = "Toast"
summary = "photography, open source software, canard aircraft, and sometimes a scary story\n"
https = true
secret = "<REDACTED>"
trusted_hosts = ["*"]
metadata = [
  {key = "photography", value = "[pixelfed](https://pixelfed.social/i/web/profile/596930420581456102)"},
  [key = "website", value = "[quietfeathers.space](https://quietfeathers.space)"},
]