question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to invoke flask cli commands

See original GitHub issue

I’m not sure if this is a bug or a feature request but trying to invoke any flask cli commands via ‘sls wsgi command’ results in an error. It would make my life much easier if there was a way to get them working.

Traceback (most recent call last): File "/var/task/wsgi.py", line 82, in handler meta.get("data", ""), shell=True, stderr=subprocess.STDOUT File "/var/lang/lib/python3.7/subprocess.py", line 395, in check_output **kwargs).stdout File "/var/lang/lib/python3.7/subprocess.py", line 487, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command 'flask' returned non-zero exit status 127.

Cheers!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
revmischacommented, Jun 8, 2019

I can’t seem to access any custom commands either. I can’t run any flask commands.

This is my code: https://github.com/jetbridge/sls-flask

I can run flask init-db just fine, but:

⇒ sls wsgi flask -c init-db -s test
Traceback (most recent call last):
  File "/var/task/wsgi_handler.py", line 97, in handler
    obj=ScriptInfo(create_app=_create_app),
  File "/var/task/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/var/task/click/core.py", line 1132, in invoke
    cmd_name, cmd, args = self.resolve_command(ctx, args)
  File "/var/task/click/core.py", line 1188, in resolve_command
    ctx.fail('No such command "%s".' % original_cmd_name)
  File "/var/task/click/core.py", line 496, in fail
    raise UsageError(message, self)
click.exceptions.UsageError: No such command "init-db".

It would really make my life easier if this worked!

1reaction
logandkcommented, Feb 6, 2019

@shughes-uk Yeah, command line scripts from packages, such as the flask command aren’t available.

I’ll look into either:

  • Making a flask cli specific command like we have for django management commands
  • Get command line scripts into the bundle and in the PATH as well (which will probably still break in many cases due to environment differences on lambda)
Read more comments on GitHub >

github_iconTop Results From Across the Web

I can't run a flask command from the terminal - Stack Overflow
I get this error when running the command:​​ $flask db_create Error: While importing 'app', an ImportError was raised. Usage: flask [OPTIONS]  ...
Read more >
Command Line Interface — Flask Documentation (2.2.x)
Installing Flask installs the flask script, a Click command line interface, in your virtualenv. Executed from the terminal, this script gives access to ......
Read more >
Flask-Script — Flask-Script 0.4.0 documentation
The Flask-Script extension provides support for writing external scripts in Flask. This includes running a development server, a customised Python shell, ...
Read more >
Python and Flask Tutorial in Visual Studio Code
For more information, see Flask command line interface. Run the app in the debugger. Debugging gives you the opportunity to pause a running...
Read more >
Automatically Load Environment Variables in Flask
Add FLASK_APP Environment Variable. Once we've done that, we can use the Flask CLI to run the app. To run the app, use...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found