I want to use python3.4 in my project, but i was getting error:
!!! UNABLE to load uWSGI plugin: ./python34_plugin.so: undefined symbol: spool_request !!!
I have the file in the dir, but it just don't working.
uwsgi
#mysite_uwsgi.ini file
[uwsgi]
# Django-related settings
# the base directory (full path)
chdir = /data/mysite/project
# Django's wsgi file
wsgi-file = /data/mysite/project/mysite/wsgi.py
# the virtualenv (full path)
home = /data/mysite/venv/pt3
# master
master = True
plugins-dir = /usr/lib/uwsgi/plugins
plugins = python34
# maximum number of worker processes
processes = 5
# the socket
socket = /tmp/mysite.sock
# ... with appropriate permissions - may be needed
chmod-socket = 666
# clear environment on exit
vacuum = true
# account to start process
uid = root
gid = root
# Output messages to log
daemonize=/var/log/uwsgi/mysite.log
PS. Sorry for my english
You've probably used different uWSGI build profiles or source code versions to build your python plugin and uwsgi binary.
To fix that issue, clone source code of uWSGI version that you want to use and compile it and proper plugin:
make buildprofile
PYTHON=python3.4 ./uwsgi --build-plugin "plugins/python python34"
After doing that, stop all uWSGI servers in your system, replace uWSGI binary in your system with freshly build one, replace plugin for python 3.4 with fresh one and start uWSGI again.
Related
I am attempting to configure a flask website on Ubuntu 18.04 using python3.8. I am following a few tutorials for configuring everything but I have hit a stopping point when I encounter the following error in /var/log/apache2/error.log
[Sat Feb 08 18:29:08.089321 2020] [wsgi:warn] [pid 16992:tid 140217694870464] (2)No such file or directory: mod_wsgi (pid=16992): Unable to stat Python home Xeplin/venv. Python interpreter may not be able to be initialized correctly. Verify the supplied path and access permissions for whole of the path.
Python path configuration:
PYTHONHOME = 'Xeplin/venv'
PYTHONPATH = (not set)
program name = 'python3'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = '/usr/bin/python3'
sys.base_prefix = 'Xeplin/venv'
sys.base_exec_prefix = 'Xeplin/venv'
sys.executable = '/usr/bin/python3'
sys.prefix = 'Xeplin/venv'
sys.exec_prefix = 'Xeplin/venv'
sys.path = [
'Xeplin/venv/lib/python38.zip',
'Xeplin/venv/lib/python3.8',
'Xeplin/venv/lib/python3.8/lib-dynload',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'
I have found a lot of unique answers for similar situations but none of them seem to eliminate this error.
I have attempted opening all permissions on the virtual env, opening permissions on my entire folder structure, and a few other things that I essentially copy and pasted from various stackoverflow threads.
This is my first time doing all of this so I am not sure what files are relevant for fixing this issue. I will provide a few things here.
tail /etc/apache2/mods-available/wsgi.conf
#The WSGILazyInitialization directives sets whether or not the Python
#interpreter is preinitialised within the Apache parent process or whether
#lazy initialisation is performed, and the Python interpreter only
#initialised in the Apache server processes or mod_wsgi daemon processes
#after they have forked from the Apache parent process.
#WSGILazyInitialization On|Off
</IfModule>
WSGIPythonHome "/home/ubuntu/Xeplin/venv"
(I have added the python home here. Rest of the file is default)
cat /etc/apache2/mods-available/wsgi.load
LoadModule wsgi_module "/usr/lib/apache2/modules/mod_wsgi-py38.cpython-38-x86_64-linux-gnu.so"
If previous debugging efforts may impact my getting of this error, I previously had to install mod_wsgi which failed when my virtual env was active but worked after deactivating. After running python3.8 -m pip install mod_wsgi outside my venv I was able to run pip install mod_wsgi inside the env. I found that peculiar so I am mentioning it here.
I have been trying to install Regulatory Sequence Analysis Tools (RSAT) on my stand alone computer. The OS is Ubuntu latest version. I am new to it too. While downloading some necessary PERL modules I get this error:
"Proxy must be specified as absolute URI; '192.168.3.10' is not at /usr/share/perl/5.26/CPAN/FTP.pm line 355.
makefiles/install_rsat.mk:256: recipe for target 'perl_modules_install' failed
make: * [perl_modules_install] Error 255**"
Tried solving it with "perl -MCPAN -eshell" but same error pops out. Please help me .
Your help will be very appreciated
It looks like your CPAN proxy is misconfigured. It should be an absolute URL (as the error message says) not just an IP address. http://192.168.3.10/ will probably work (but you might need to add a port number too).
Do you have any suggestions that would make the error message clearer?
I ran into similar issue. Solved it by removing all configured proxies from CPAN and then using environment proxy.
You can remove configured proxies from cpan using following commands either on cpan or perl -MCPAN -e shell -
o conf http_proxy ""
o conf ftp_proxy ""
o conf proxy_user ""
o conf proxy_pass ""
o conf commit
q
And then configure required environment proxy. Example - export http_proxy=http://proxyserver:8080 for Linux or set http_proxy=http://proxyserver:8080 for Windows
Now you should be able to install required modules cpan[6]> install LWP
I have created an API using FLASK which I am trying to deploy on a linux server by creating a systemd service.
I have used direnv to setup input parameters to the app like database connections. Below is what the file looks like :
The uwsgi config is as below :
The systemd file has the following entries:
I get the follwing error in my uwsgi logs whenever I try to reach the service on my browser :
--- no python application found, check your startup logs for errors ---
[pid: 23791|app: -1|req: -1/3] 192.168.9.180 () {44 vars in 719 bytes} [Thu Oct 11 14:35:09 2018] GET / => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (1 switches on core 0)
My understanding is the ExecStart command in the systemd file is not able to invoke the direnv set variables , hence i added the ExecStartPre entry but even does not seem to work.
Any hints/ideas are appreciated.
Note: The application is accessible without errors when I run the uwsgi via command line from my python virtual environment :
uwsgi --socket 0.0.0.0:5000 --protocol=http -w app:app
i have a few advises that may help you, probably only the first one is the one you need...
1) Either move all your env variable defined in direnv to the systemd unit as Environment or move them into a special file (similar to the you already have) without the "source activate" line and the export, and then pass that file as EnvironmentFile , this is the doc for that https://www.freedesktop.org/software/systemd/man/systemd.exec.html#Environment
2) Your ExecStartPre does nothing really, even tho you do "cd" into the path, that is lost and is not persistent. you should remove it.
3) By setting your PATH to only that path, you are restricting your self, i would recommend see the value of your current PATH and then set it to that value. but otherwise at least add "/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin". now spoiler alert, you probably dont need to set it.
4) put the socket in /run//socket.socket directory and let systemd manage your /run/<yourapp> with RuntimeDirectory directive.
good luck!
I have set up a uwsgi service on a ubuntu 12.04.
Here is the custom config file I am using:
[uwsgi]
# this is the path to the virtualenv
home = /var/www/api/webservice/current/
# this will point to the same file
paste = config:/var/www/api/webservice/production.ini
socket = /tmp/my_api.socket
gid = www-data
uid = www-data
logdate = true
master = true
harakiri = 30
limit-as = 1536
reload-on-as = 1200
no-orphans = true
log-x-forwarded-for = true
threads = 15
workers = 2
stats = /tmp/my_api_stats.socket
listen = 400
When I run sudo service uwsgi start I get "Fail".
But the log in /var/log/uwsgi/app/my_api.log doesn't show any error message.
How can I debug this ?
As a debug step, you could examine your ExecStart command from /etc/systemd/system unit configuration for uwsgi service. Try running that command and see, if there is some more information about the error.
By the way, are you sure your logfile /var/log/uwsgi/app/my_api.log is the one, where the logs are written to? Of course, that could be default, but if it is not, you should have the logto=/path/to/the/log option in your config.
If you are using debian based linux os, you will find log for you app by default in /var/log/uwsgi/app/log.
I also had hard time, while debugging the reason for the failure of starting of uwsgi service.
For me uwsgi --ini this_config_file.ini worked fine, but service uwsgi start was failing without giving much information.
Maybe uwsgi --ini this_config_file.ini will help you debug it?
I am trying to use gunicorn with pyramid.
I installed gunicorn 18 into pyramid 1.5 dedicated virtualenv,
and after activating it, I start gunicorn_paster, but it stops at once with an error :
(venv) gunicorn_paster development.ini
Error: waitress
What this error means ?
I tried --debug but it did not give me more clues.
--preload does not work neither.
'pserve development.ini' or mod_wsgi works well, so my virtualenv should be OK.
You need a configuration file.
#gunicorn_conf.py
import os
def numCPUs():
if not hasattr(os, "sysconf"):
raise RuntimeError("No sysconf detected.")
return os.sysconf("SC_NPROCESSORS_ONLN")
workers = numCPUs() * 2 + 1
bind = "127.0.0.1:8001"
pidfile = "/tmp/gunicorn-app.pid"
backlog = 2048
logfile = "/var/log/gunicorn-app.log"
loglevel = "info"
Then launch as shown (note gunicorn_conf.py needs to be in same dir as development.ini)
gunicorn --paste development.ini
You can leave your development.ini as it is, no need to edit.
I Found the problem : I just had to deactivate/activate again the virtualenv after gunicorn install to have it work.
What server setting does your development.ini have ? By default, it might be using waitress. Kindly check the ini file configuration.
Try this:
# ini file
[server:main]
use = egg:gunicorn#main
host = 0.0.0.0
port = 5000