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

fix: Fix config bug in alembic #1873

Merged
merged 1 commit into from
Oct 12, 2024
Merged

fix: Fix config bug in alembic #1873

merged 1 commit into from
Oct 12, 2024

Conversation

mattzh72
Copy link
Collaborator

Description

Found a bug where the incorrect config object was being used:

(letta-py3.12) mattzhou@Matts-MacBook-Pro MemGPT % poetry run alembic upgrade head   

Initializing database...
None
Traceback (most recent call last):
  File "/Users/mattzhou/Library/Caches/pypoetry/virtualenvs/letta-Mdwnr1Ge-py3.12/bin/alembic", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/mattzhou/Library/Caches/pypoetry/virtualenvs/letta-Mdwnr1Ge-py3.12/lib/python3.12/site-packages/alembic/config.py", line 636, in main
    CommandLine(prog=prog).main(argv=argv)
  File "/Users/mattzhou/Library/Caches/pypoetry/virtualenvs/letta-Mdwnr1Ge-py3.12/lib/python3.12/site-packages/alembic/config.py", line 626, in main
    self.run_cmd(cfg, options)
  File "/Users/mattzhou/Library/Caches/pypoetry/virtualenvs/letta-Mdwnr1Ge-py3.12/lib/python3.12/site-packages/alembic/config.py", line 603, in run_cmd
    fn(
  File "/Users/mattzhou/Library/Caches/pypoetry/virtualenvs/letta-Mdwnr1Ge-py3.12/lib/python3.12/site-packages/alembic/command.py", line 406, in upgrade
    script.run_env()
  File "/Users/mattzhou/Library/Caches/pypoetry/virtualenvs/letta-Mdwnr1Ge-py3.12/lib/python3.12/site-packages/alembic/script/base.py", line 582, in run_env
    util.load_python_file(self.dir, "env.py")
  File "/Users/mattzhou/Library/Caches/pypoetry/virtualenvs/letta-Mdwnr1Ge-py3.12/lib/python3.12/site-packages/alembic/util/pyfiles.py", line 95, in load_python_file
    module = load_module_py(module_id, path)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mattzhou/Library/Caches/pypoetry/virtualenvs/letta-Mdwnr1Ge-py3.12/lib/python3.12/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 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/Users/mattzhou/MemGPT/alembic/env.py", line 18, in <module>
    config.set_main_option("sqlalchemy.url", "sqlite:///" + os.path.join(config.recall_storage_path, "sqlite.db"))
                                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Config' object has no attribute 'recall_storage_path'

Testing

Ran poetry run alembic upgrade head locally to ensure that error no longer pops up.

@mattzh72 mattzh72 changed the title finish fix: Fix config bug in alembic Oct 12, 2024
Copy link
Collaborator

@sarahwooders sarahwooders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@mattzh72 mattzh72 merged commit a91c94c into main Oct 12, 2024
15 of 16 checks passed
@cpacker cpacker deleted the matt-fix-alembic branch October 16, 2024 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants