I'm moving a Quart webapp from python 3.7 to python 3.10 and I'm suddenly unable to suppress the server logs. Previously the advice from this thread:
getLogger('quart.serving').setLevel(ERROR)
and that's worked well for at least a year now. The only obvious change in my new deployment is Python 3.10; the same codebase and Quart version in Python 3.7 suppresses server logs just fine.
I've tried setting higher (CRITICAL) log levels, I tried using numbers to set it, and I verified that the logger had the correct effective level set getLogger('quart.serving').getEffectiveLevel(). Not sure what else to try.
Related
I've been using the remote-containers in VS Code to run a Python Django application successfully for a couple of months, as I have an M1 machine and it's just a nightmare trying to install all the dependencies locally, and it was working really well.
I came back to the application yesterday and now it's suddenly not working, the container seems to build without any issues and I can see it's running, and the build logs don't present any errors.
But when I try and run with or without debugging the it pops up the run tool bar (start, stop, step ect) for a second and then stops with no output or errors at all. Has anyone seen this before? or have any ideas how to try and get it running again?
Using the rebuild container and rebuild container without cache commands both seem to run without errors
I updated both VS Code and Docker to the latest version
I tried cloning the repository again
I verified that the docker image builds locally without issue
The vs code remote containers plugin seems to still be working because I tried it with a Flask application example I used before to demo the remote-containers to some colleagues and that works without issue.
EDIT
For anyone that comes across a similar thing. I think what happened was the version of python the application was using had support dropped/stopped working for the VS code extension responsible for remote containers, and that's why I could not get it running anymore. Updating the Python version (and going through the pain of also updating the dependencies that now didn't work with the newer version) got this working again.
I have a Django application deployed in Heroku, it has been deployed for months without any issue. Deployments today are suddenly failing saying Heroku doesn't support Python 3.6.10, only 3.6.11 (closest one to 3.6.10)
I have not specified a version anywhere in my app so I can only assume Django defaults to 3.6.10 or Heroku previously did, but they have abruptly stopped supporting it now.
Are there any risks in setting 3.6.11 in my runtime file so my builds work? Is there any reason it defaults to 3.6.10?
The app is in use heavily and Heroku support is awful unless you pay 1000 a month so I can't afford it to fail, and if it does, I can't revert to 3.6.10!
Thanks so much for any help
The Heroku docs say your app continues to use the same Python version as when it was first deployed. In your case, the default would have been 3.6.10 when you first deployed your app, and this is no longer available. You can explicitly upgrade to 3.6.11 by creating a runtime.txt file.
It should be safe to upgrade between Python 3.6.X versions. If you want to be sure, then you could deploy a separate app on Python 3.6.11, or create a virtualenv locally and test on Python 3.6.11.
I can only assume Django defaults to 3.6.10
Django isn't controlling the Python version that Heroku is using. Each version of Django supports a range of Python versions. Check the release notes for your version.
i have some reasons witch i am stuck to use django on windows machine. i was wondering how to configure django on a windows sesrver 2012 r2 with iis 8.5. so i followed the tutorial here.
i did what the tutorial says and it is pretty much straight forward what i am gonna do for any kind of application i want to run with iis.
but i get the following error the fastcgi process exited unexpectedly.
here is what i have provided as executable for wfastcgi module:
E:\venvs\...\Scripts\python.exe|E:\venvs\...\Lib\site-packages\wfastcgi.py
i removed the wfastcgi.py part after | from handler mapping and error changed to script processor could not find the config for fastcgi configuration and i figured out the error must be related to the wfastcgi.py file. but i could not find the issue here. so i was wondering what can be the issue? and what are my options are here.
has any one been able to use django on a windows machine?? jsut in case my python version is python 3.6
I had the exact same problem as you but managed to solve this by using Python 3.4.2 version. Follow the exact steps as described in this tutorial Django with IIS and avoid using Python 3.5 or above because it seems that there are compatibility issues. The stack I used was IIS version 10, Windows 10, Python 3.4.2 and Django 1.11.2.
Upgrading wfastcgi to the latest version
pip install wfastcgi --upgrade
solved it for me: Python 3.6.6, wfastcgi 3.0.0
In my Case I was facing the same issue i.e. enter image description here
Mine is a Django App used for APIs that queries data from back-end platforms. This issue was only for specific filters that the API was using in queries while for other values in filters it worked great.
My Config file did not have a fastCgi tag and I added below mentioned part to top of system.webServer in config file. Yes off course it gave few errors here and there corresponding to activityTimeout and requestTimeout. Tried increasing up-to 900 and 601 respectively and then it worked for me. But could not understand cause of the issue as query that API was running for which i was facing this issue was not taking that long at all. I would like to understand that.
<fastCgi>
<application fullPath="D:\Python34\python.exe|D:\Python34\Scripts\wfastcgi.py"
arguments=""
maxInstances="4"
idleTimeout="300"
activityTimeout="900"
requestTimeout="601"
instanceMaxRequests="10000"
protocol="NamedPipe"
flushNamedPipe="false">
</application>
</fastCgi>
This is an old app, running since about two years on Heroku. Now suddenly, when I deploy (standard git push), it breaks the Python interpreter, both on regular and one-off dynos. Here's what it looks like:
$ heroku run python
Running `python` attached to terminal... up, run.8338
python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
Further pushes, heroku restart, scaling the dynos to zero and back up, that all doesn't fix it.
The only changes contained in this deployment which I could imagine being related to this problem are: gevent upgraded from 0.13.6 to 1.0.1 and the introduction of a runtime.txt (before there was none, resulting in 2.7.4, now there's one for 2.7.6).
I rolled all of this back to no effect, however. In fact, I went back about 30 commits (the deployment contained maybe five) and pushed that and the app is still broken.
Rolling back with heroku rollback is the only way I've found to take the app back into a usable state. But of course that doesn't help me going forward.
What might cause this? Can I somehow rebuild my whole app environment from scratch?
EDIT 1: I opened a shell in a one-off dyno and I can see the libpython2.7.so.1.0 file there:
/ $ ls -la /app/.heroku/python/lib/libpython2.7.so.1.0
-r-x------ 1 u49295 49295 5694572 2014-06-03 23:39 /app/.heroku/python/lib/libpython2.7.so.1.0
Of course I don't know if that's where it's supposed to be.
Somehow certain apps did not upgrade properly. A temporary fix to locate the correct python library:
heroku config:set LD_LIBRARY_PATH=/app/.heroku/python/lib
Kenneth Reitz from the Python team here.
So, we're rolling out security updates to the version of Python that we have installed on our base system. Customers shouldn't be affected by this in any way, because their apps use their own version of Python, and because we set local runtime-specific (such as LD_LIBRARY_PATH) in a .profile.d scripts, outside of user-set configuration.
However, we allow power users to override these environment variables with $ heroku config. That's basically what the application was doing — although, not knowingly. This was an accidental side-effect of a much, much older Heroku. In older days, we couldn't have any runtime-specific configuration without being a part of user configuration. This is why your application had an LD_LIBRARY_PATH config set, and this is what caused this bug.
Because of this, I've disabled the overridability of LD_LIBRARY_PATH for Python apps, and all should be well moving forward.
Thanks for being a part of the gradual rollout process, and thanks for helping us get to the bottom of this regression. I'm very sorry for the inconvenience.
Are you using the default Python buildpack? Heroku is in the process of updating the Stack image, and especially if you're not using a current buildpack, there may be incompatibilities.
To see if you're using a default buildpack, run
$ heroku config | grep BUILDPACK_URL
Please contact Heroku support if you think this might be the cause.
Installed Django 1.5 python2.7 mod_wsgi and python-sql on a red hat 4 web server with apache 2.
The "It worked" page keep flipping between the correct display and "internal server error" "500"
The flip occurs very frequently when pressing F5, but not only when quickly sending a request.
I have restarted Apache, erased wsgi that was configured for python 3.2 and reconfigured and installed for 2.7. I have also tried creating a new project, mysql database, and kicking the cat < not advisable.
On the python 3.2 installation I was having problems with the admin page registrations flipping between what I had applied, and being non-existent.
This error is occurring with debug = true, no apps installed, no database configuration yet, and what I assume is a complete baseline system aside from the wsgi file which seemed to work fine for the 3.2 installation.
If you are getting issues with the Python egg cache, see the mod_wsgi documentation at:
http://code.google.com/p/modwsgi/wiki/ApplicationIssues#Access_Rights_Of_Apache_User
The reason it flicks may be because you are running a multiprocess configuration and so requests can go to different processes. That it would be different though for different processes is a bit odd, but is often explained by import order dependencies in your code where whether it works depends on the order in which URLs are visited.
Quite often such ordering issues don't show up if using Django and developing with Django developer server, because the Django development server preloads code before requests are handled. I have commented on this specific Django issue in:
http://blog.dscpl.com.au/2010/03/improved-wsgi-script-for-use-with.html
Do note that code examples in that corresponded to an old Django version so may not be appropriate to use now.