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

Unclear error messages from alembic when base cannot find 'migrations' directory. #663

Closed
novafacing opened this issue Feb 24, 2020 · 9 comments
Labels
bug Something isn't working migration environment

Comments

@novafacing
Copy link
Contributor

I have a pull request ready to fix this.

It's a very simple issue, when I run some flask stuff from the wrong directory, calling upgrade() in flask_migrate tries to use alembic to obtain the 'migrations' directory. Unfortunately the error message when it cannot find 'migrate' is pretty unclear if it ends up printing a relative path (in my case the path was simply '.') you'll see an error message like:

alembic.util.exc.CommandError: Path doesn't exist: 'migrations'. Please use the 'init' command to create a new scripts folder.

novafacing added a commit to novafacing/alembic that referenced this issue Feb 24, 2020
@sqla-tester
Copy link
Collaborator

Rowan Hart has proposed a fix for this issue in the master branch:

Fixes #663. Clarified an error message on failure to find 'migrations' path. https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/1740

@zzzeek
Copy link
Member

zzzeek commented Feb 24, 2020

yeah "migrations" is not a "path" exactly is it

@zzzeek zzzeek added bug Something isn't working migration environment labels Feb 24, 2020
@novafacing
Copy link
Contributor Author

It should be a path, I haven’t seen any options for the dir. argument to that function to be a URI or anything different

@zzzeek
Copy link
Member

zzzeek commented Feb 24, 2020

there's a way it can be a setuptools resource path I think and also someone wants to make the whole thing work without filesystems at all but that's not happening right now.

@novafacing
Copy link
Contributor Author

Ah gotcha, I hadn't noticed that. Making it all work with no fs sounds like quite an undertaking but also a pretty cool idea!

@sqla-tester
Copy link
Collaborator

Rowan Hart has proposed a fix for this issue in the master branch:

Clarified an error message on failure to find 'migrations' path. https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/1740

@zzzeek
Copy link
Member

zzzeek commented Feb 25, 2020

thanks!

@mwiks-dev
Copy link

What was the suggested solution?

@CaselIT
Copy link
Member

CaselIT commented May 11, 2022

A clearer error message was added. You can refer to the linked commit

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

No branches or pull requests

5 participants