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.

Issue with uWSGI example after code refactoring

See original GitHub issue

After upgrading PowerDNS-Admin today from a codebase before the refactoring I can’t start the application via uwsgi anymore. The Wiki example has mount = /pdns=run.py which I think should now be mount = /pdns=powerdnsadmin:app but my service refuses to start and gives the following error:

unable to load app 0 (mountpoint='/pdns') (callable not found or import error)

Does anyone have a pointer what the mount directive should look like with the new code structure? Or am I maybe searching for the wrong thing and this is connected with the additional FLASK_APP and FLASK_CONFIG environment variables that uwsgi needs to access but can’t?

Thanks in advance!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
eht16commented, Mar 4, 2020

Please forget the script I posted, it doesn’t work properly as on each request, the app is completely started again.

The proper way to start PDNSA using uwsgi is: wsgi ... --mount /='powerdnsadmin:create_app()' No additional script is necessary, create_app() is already there.

1reaction
eht16commented, Mar 3, 2020

Put the following glue code in a run_uwsgi.py:

#!/usr/bin/env python3

from powerdnsadmin import create_app


# ----------------------------------------------------------------------
def main(*args, **kwargs):
    app = create_app()
    return app(*args, **kwargs)

And then use mount = /pdns=run_uwsgi:main.

Read more comments on GitHub >

github_iconTop Results From Across the Web

uwsgi + nginx... mistake after mistake in options - Stack Overflow
Just use a Systemd service per app. Install uWSGI into the virtualenv your app is in, not system-wide. If you can trust all...
Read more >
Flask application + uwsgi: SSL SYSCALL EOF detected error
When we turn lazy apps on the ssl syscall issue disappears. Any assistance figuring this out would be greatly appreciated. Versions. OS: RHEL ......
Read more >
We'll Do It Live: Updating Machine Learning Models on Flask ...
This post details a simple design pattern using Flask, uWSGI, middleware, and process locks to update your API while it is live and...
Read more >
The Art of Graceful Reloading — uWSGI 2.0 documentation
When triggered, it will restart one worker at time, and the following worker is not reloaded until the previous one is ready to...
Read more >
Install and configure uwsgi in Emperor mode - Puppet Forge
puppet-uwsgi. A puppet module for installing and managing uWSGI (in emperor mode) ... uwsgi::app: example: uid: example gid: example.
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