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

KeyError: 'src_folder' after upgrading aerich to 0.5.4 #176

Closed
yusukefs opened this issue Jul 8, 2021 · 3 comments
Closed

KeyError: 'src_folder' after upgrading aerich to 0.5.4 #176

yusukefs opened this issue Jul 8, 2021 · 3 comments

Comments

@yusukefs
Copy link
Contributor

yusukefs commented Jul 8, 2021

When I tried to upgrade aerich from 0.5.3 to 0.5.4 and use it, I faced an error below.

Traceback (most recent call last):
  File "/usr/local/bin/aerich", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/site-packages/aerich/cli.py", line 317, in main
    cli()
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1256, in invoke
    Command.invoke(self, ctx)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/aerich/cli.py", line 41, in wrapper
    loop.run_until_complete(f(*args, **kwargs))
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.8/site-packages/aerich/cli.py", line 77, in cli
    src_folder = parser[name]["src_folder"]
  File "/usr/local/lib/python3.8/configparser.py", line 1254, in __getitem__
    raise KeyError(key)
KeyError: 'src_folder'

After reading some codes, I understood the src_folder config is missing in aerich.ini in my project and could resolve the error by adding it.
I thought it would be very helpful for users upgrading aerich to add, for example, raising an error that tell us to add the new option around here or having a default value on absent.
What do you think is the best solution?

@long2ice
Copy link
Member

long2ice commented Jul 8, 2021

Yes, we can provide a default value, could you give a PR?

@yusukefs
Copy link
Contributor Author

yusukefs commented Jul 8, 2021

Yes, I will open a PR for that!

@kingb
Copy link

kingb commented Jul 16, 2021

Is it possible to make a quick new 0.5.5 release with this fix as we're getting the same error?

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

No branches or pull requests

3 participants