Django on AWS Beanstalk errors when using Postgres - python

I have an Django application using RDS Postgres on AWS Beanstalk. The Beanstalk environment does not use the default RDS setup. I have a separate RDS instance of Postgres running.
In my settings file I have the below for my database dictionary:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.environ['RDS_DB_NAME'],
'USER': os.environ['RDS_USERNAME'],
'PASSWORD': os.environ['RDS_PASSWORD'],
'HOST': os.environ['RDS_HOSTNAME'],
'PORT': os.environ['RDS_PORT'],
}
}
When I visit the environment's URL I get a 500 error. Below are the error_logs for one visit.
[Sun Dec 23 18:43:24.116897 2018] [:error] [pid 1881] [remote 172.31.30.131:0] mod_wsgi (pid=1881): Target WSGI script '/opt/python/current/app/my_app/wsgi.py' cannot be loaded as Python module.
[Sun Dec 23 18:43:24.117094 2018] [:error] [pid 1881] [remote 172.31.30.131:0] mod_wsgi (pid=1881): Exception occurred processing WSGI script '/opt/python/current/app/my_app/wsgi.py'.
[Sun Dec 23 18:43:24.117230 2018] [:error] [pid 1881] [remote 172.31.30.131:0] Traceback (most recent call last):
[Sun Dec 23 18:43:24.117313 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/opt/python/current/app/my_app/wsgi.py", line 16, in <module>
[Sun Dec 23 18:43:24.117458 2018] [:error] [pid 1881] [remote 172.31.30.131:0] application = get_wsgi_application()
[Sun Dec 23 18:43:24.117553 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/opt/python/run/venv/lib/python2.7/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
[Sun Dec 23 18:43:24.117668 2018] [:error] [pid 1881] [remote 172.31.30.131:0] django.setup(set_prefix=False)
[Sun Dec 23 18:43:24.117757 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/opt/python/run/venv/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
[Sun Dec 23 18:43:24.117899 2018] [:error] [pid 1881] [remote 172.31.30.131:0] apps.populate(settings.INSTALLED_APPS)
[Sun Dec 23 18:43:24.117971 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/opt/python/run/venv/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
[Sun Dec 23 18:43:24.118183 2018] [:error] [pid 1881] [remote 172.31.30.131:0] app_config.import_models()
[Sun Dec 23 18:43:24.118266 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/opt/python/run/venv/lib/python2.7/site-packages/django/apps/config.py", line 202, in import_models
[Sun Dec 23 18:43:24.118444 2018] [:error] [pid 1881] [remote 172.31.30.131:0] self.models_module = import_module(models_module_name)
[Sun Dec 23 18:43:24.118511 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
[Sun Dec 23 18:43:24.118625 2018] [:error] [pid 1881] [remote 172.31.30.131:0] __import__(name)
[Sun Dec 23 18:43:24.118687 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/opt/python/run/venv/lib/python2.7/site-packages/django/contrib/auth/models.py", line 4, in <module>
[Sun Dec 23 18:43:24.118874 2018] [:error] [pid 1881] [remote 172.31.30.131:0] from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
[Sun Dec 23 18:43:24.118956 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/opt/python/run/venv/lib/python2.7/site-packages/django/contrib/auth/base_user.py", line 52, in <module>
[Sun Dec 23 18:43:24.119098 2018] [:error] [pid 1881] [remote 172.31.30.131:0] class AbstractBaseUser(models.Model):
[Sun Dec 23 18:43:24.119159 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/opt/python/run/venv/lib/python2.7/site-packages/django/db/models/base.py", line 124, in __new__
[Sun Dec 23 18:43:24.120069 2018] [:error] [pid 1881] [remote 172.31.30.131:0] new_class.add_to_class('_meta', Options(meta, app_label))
[Sun Dec 23 18:43:24.120155 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/opt/python/run/venv/lib/python2.7/site-packages/django/db/models/base.py", line 325, in add_to_class
[Sun Dec 23 18:43:24.120229 2018] [:error] [pid 1881] [remote 172.31.30.131:0] value.contribute_to_class(cls, name)
[Sun Dec 23 18:43:24.120306 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/opt/python/run/venv/lib/python2.7/site-packages/django/db/models/options.py", line 214, in contribute_to_class
[Sun Dec 23 18:43:24.120597 2018] [:error] [pid 1881] [remote 172.31.30.131:0] self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
[Sun Dec 23 18:43:24.120827 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/opt/python/run/venv/lib/python2.7/site-packages/django/db/__init__.py", line 33, in __getattr__
[Sun Dec 23 18:43:24.120943 2018] [:error] [pid 1881] [remote 172.31.30.131:0] return getattr(connections[DEFAULT_DB_ALIAS], item)
[Sun Dec 23 18:43:24.121023 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/opt/python/run/venv/lib/python2.7/site-packages/django/db/utils.py", line 211, in __getitem__
[Sun Dec 23 18:43:24.121191 2018] [:error] [pid 1881] [remote 172.31.30.131:0] backend = load_backend(db['ENGINE'])
[Sun Dec 23 18:43:24.121260 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/opt/python/run/venv/lib/python2.7/site-packages/django/db/utils.py", line 115, in load_backend
[Sun Dec 23 18:43:24.121347 2018] [:error] [pid 1881] [remote 172.31.30.131:0] return import_module('%s.base' % backend_name)
[Sun Dec 23 18:43:24.121415 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
[Sun Dec 23 18:43:24.121495 2018] [:error] [pid 1881] [remote 172.31.30.131:0] __import__(name)
[Sun Dec 23 18:43:24.121550 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/opt/python/run/venv/lib/python2.7/site-packages/django/db/backends/postgresql/base.py", line 25, in <module>
[Sun Dec 23 18:43:24.121728 2018] [:error] [pid 1881] [remote 172.31.30.131:0] raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e)
[Sun Dec 23 18:43:24.121799 2018] [:error] [pid 1881] [remote 172.31.30.131:0] ImproperlyConfigured: Error loading psycopg2 module: No module named psycopg2
If I comment out my Database dictionary and visit a view that does not query the Database I get a 200 and the content as expected. If I then uncomment the Database dictionary I get a 500 no matter what view I visit.
In my requirements.txt I have Django==1.11.17 and psycopg2==2.7.5. I can see from the eb-activity.log where these are being successfully installed by PIP when the environment is created or updated.
I'm really at a loss as to what the issue could be at this point.

In the end this ended up being a Python Path issue. The solution surfaced in this comment from an article on setting up Django on EB: https://realpython.com/deploying-a-django-app-and-postgresql-to-aws-elastic-beanstalk/#comment-2849390172

Related

Target WSGI cannot be loaded as Python module

How to solve these errors ? Thank you very much for your help.
[Sat Apr 24 06:58:37.647922 2021] [:error] [pid 1430] [remote 172.31.12.184:248] mod_wsgi (pid=1430): Target WSGI script '/opt/python/current/app/greatkart/wsgi.py' cannot be loaded as Python module.
[Sat Apr 24 06:58:37.648302 2021] [:error] [pid 1430] [remote 172.31.12.184:248] File "/opt/python/current/app/greatkart/settings.py", line 120, in
[Sat Apr 24 06:58:37.648305 2021] [:error] [pid 1430] [remote 172.31.12.184:248] 'HOST': os.environ['RDS_HOSTNAME'],
wsgi.py
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'greatkart.settings')
application = get_wsgi_application()
settings.py
# Database Configuration
if 'RDS_DB_NAME' in os.environ:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.environ['RDS_DB_NAME'],
'USER': os.environ['RDS_USERNAME'],
'PASSWORD': os.environ['RDS_PASSWORD'],
'HOST': os.environ['RDS_HOSTNAME'],
'PORT': os.environ['RDS_PORT'],
}
}
requirements.txt
asgiref==3.2.10
certifi==2020.12.5
chardet==4.0.0
Django==3.1
django-admin-honeypot==1.1.0
django-admin-thumbnails==0.2.5
django-session-timeout==0.1.0
idna==2.10
Pillow==8.2.0
psycopg2-binary==2.8.6
python-decouple==3.4
pytz==2020.1
requests==2.25.1
six==1.15.0
sqlparse==0.3.1
urllib3==1.26.3
db-migrate.config
container_commands:
01_migrate:
command: "django-admin.py migrate"
leader_only: true
option_settings:
aws:elasticbeanstalk:application:environment:
DJANGO_SETTINGS_MODULE: greatkart.settings
django.config
option_settings:
"aws:elasticbeanstalk:container:python":
WSGIPath: "greatkart/wsgi.py"
"aws:elasticbeanstalk:container:python:staticfiles":
"/static/": "static/"
config.yml
branch-defaults:
main:
environment: django-env-4
group_suffix: null
environment-defaults:
django-env:
branch: null
repository: null
seast-kart-env:
branch: null
repository: null
global:
application_name: django-tutorial-4
branch: null
default_ec2_keyname: aws-eb
default_platform: Python 3.6
default_region: us-west-2
include_git_submodules: true
instance_profile: null
platform_name: null
platform_version: null
profile: eb-cli
repository: null
sc: git
workspace_type: Application
Edit :
Full Traceback
[Fri Apr 23 13:21:43.405667 2021] [suexec:notice] [pid 3188] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri Apr 23 13:21:43.420808 2021] [http2:warn] [pid 3188] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive.
[Fri Apr 23 13:21:43.420820 2021] [http2:warn] [pid 3188] AH02951: mod_ssl does not seem to be enabled
[Fri Apr 23 13:21:43.421241 2021] [lbmethod_heartbeat:notice] [pid 3188] AH02282: No slotmem from mod_heartmonitor
[Fri Apr 23 13:21:43.421281 2021] [:warn] [pid 3188] mod_wsgi: Compiled for Python/3.6.2.
[Fri Apr 23 13:21:43.421285 2021] [:warn] [pid 3188] mod_wsgi: Runtime using Python/3.6.12.
[Fri Apr 23 13:21:43.423065 2021] [mpm_prefork:notice] [pid 3188] AH00163: Apache/2.4.46 (Amazon) mod_wsgi/3.5 Python/3.6.12 configured -- resuming normal operations
[Fri Apr 23 13:21:43.423081 2021] [core:notice] [pid 3188] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Fri Apr 23 13:22:18.244515 2021] [mpm_prefork:notice] [pid 3188] AH00169: caught SIGTERM, shutting down
[Fri Apr 23 13:22:19.296214 2021] [suexec:notice] [pid 3418] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri Apr 23 13:22:19.310192 2021] [so:warn] [pid 3418] AH01574: module wsgi_module is already loaded, skipping
[Fri Apr 23 13:22:19.312609 2021] [http2:warn] [pid 3418] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive.
[Fri Apr 23 13:22:19.312621 2021] [http2:warn] [pid 3418] AH02951: mod_ssl does not seem to be enabled
[Fri Apr 23 13:22:19.313166 2021] [lbmethod_heartbeat:notice] [pid 3418] AH02282: No slotmem from mod_heartmonitor
[Fri Apr 23 13:22:19.313227 2021] [:warn] [pid 3418] mod_wsgi: Compiled for Python/3.6.2.
[Fri Apr 23 13:22:19.313232 2021] [:warn] [pid 3418] mod_wsgi: Runtime using Python/3.6.12.
[Fri Apr 23 13:22:19.315504 2021] [mpm_prefork:notice] [pid 3418] AH00163: Apache/2.4.46 (Amazon) mod_wsgi/3.5 Python/3.6.12 configured -- resuming normal operations
[Fri Apr 23 13:22:19.315522 2021] [core:notice] [pid 3418] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Fri Apr 23 13:22:22.687415 2021] [:error] [pid 3423] [remote 127.0.0.1:0] mod_wsgi (pid=3423): Target WSGI script '/opt/python/current/app/greatkart/wsgi.py' cannot be loaded as Python module.
[Fri Apr 23 13:22:22.687467 2021] [:error] [pid 3423] [remote 127.0.0.1:0] mod_wsgi (pid=3423): Exception occurred processing WSGI script '/opt/python/current/app/greatkart/wsgi.py'.
[Fri Apr 23 13:22:22.688631 2021] [:error] [pid 3423] [remote 127.0.0.1:0] Traceback (most recent call last):
[Fri Apr 23 13:22:22.688694 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "/opt/python/current/app/greatkart/wsgi.py", line 16, in <module>
[Fri Apr 23 13:22:22.688699 2021] [:error] [pid 3423] [remote 127.0.0.1:0] application = get_wsgi_application()
[Fri Apr 23 13:22:22.688706 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
[Fri Apr 23 13:22:22.688710 2021] [:error] [pid 3423] [remote 127.0.0.1:0] django.setup(set_prefix=False)
[Fri Apr 23 13:22:22.688715 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/__init__.py", line 19, in setup
[Fri Apr 23 13:22:22.688719 2021] [:error] [pid 3423] [remote 127.0.0.1:0] configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
[Fri Apr 23 13:22:22.688725 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/conf/__init__.py", line 83, in __getattr__
[Fri Apr 23 13:22:22.688733 2021] [:error] [pid 3423] [remote 127.0.0.1:0] self._setup(name)
[Fri Apr 23 13:22:22.688740 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/conf/__init__.py", line 70, in _setup
[Fri Apr 23 13:22:22.688743 2021] [:error] [pid 3423] [remote 127.0.0.1:0] self._wrapped = Settings(settings_module)
[Fri Apr 23 13:22:22.688748 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/conf/__init__.py", line 177, in __init__
[Fri Apr 23 13:22:22.688752 2021] [:error] [pid 3423] [remote 127.0.0.1:0] mod = importlib.import_module(self.SETTINGS_MODULE)
[Fri Apr 23 13:22:22.688757 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "/opt/python/run/venv/lib64/python3.6/importlib/__init__.py", line 126, in import_module
[Fri Apr 23 13:22:22.688760 2021] [:error] [pid 3423] [remote 127.0.0.1:0] return _bootstrap._gcd_import(name[level:], package, level)
[Fri Apr 23 13:22:22.688765 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "<frozen importlib._bootstrap>", line 994, in _gcd_import
[Fri Apr 23 13:22:22.688770 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "<frozen importlib._bootstrap>", line 971, in _find_and_load
[Fri Apr 23 13:22:22.688775 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
[Fri Apr 23 13:22:22.688781 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
[Fri Apr 23 13:22:22.688786 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "<frozen importlib._bootstrap_external>", line 674, in exec_module
[Fri Apr 23 13:22:22.688791 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "<frozen importlib._bootstrap_external>", line 781, in get_code
[Fri Apr 23 13:22:22.688796 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "<frozen importlib._bootstrap_external>", line 741, in source_to_code
[Fri Apr 23 13:22:22.688801 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
[Fri Apr 23 13:22:22.688815 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "/opt/python/current/app/greatkart/settings.py", line 33
[Fri Apr 23 13:22:22.688824 2021] [:error] [pid 3423] [remote 127.0.0.1:0] \xc2\xb2
[Fri Apr 23 13:22:22.688838 2021] [:error] [pid 3423] [remote 127.0.0.1:0] ^
[Fri Apr 23 13:22:22.688845 2021] [:error] [pid 3423] [remote 127.0.0.1:0] SyntaxError: invalid character in identifier
[Fri Apr 23 13:22:23.691877 2021] [:error] [pid 3423] [remote 127.0.0.1:40] mod_wsgi (pid=3423): Target WSGI script '/opt/python/current/app/greatkart/wsgi.py' cannot be loaded as Python module.
[Fri Apr 23 13:22:23.691926 2021] [:error] [pid 3423] [remote 127.0.0.1:40] mod_wsgi (pid=3423): Exception occurred processing WSGI script '/opt/python/current/app/greatkart/wsgi.py'.
[Fri Apr 23 13:22:23.692096 2021] [:error] [pid 3423] [remote 127.0.0.1:40] Traceback (most recent call last):
[Fri Apr 23 13:22:23.692152 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "/opt/python/current/app/greatkart/wsgi.py", line 16, in <module>
[Fri Apr 23 13:22:23.692157 2021] [:error] [pid 3423] [remote 127.0.0.1:40] application = get_wsgi_application()
[Fri Apr 23 13:22:23.692163 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
[Fri Apr 23 13:22:23.692167 2021] [:error] [pid 3423] [remote 127.0.0.1:40] django.setup(set_prefix=False)
[Fri Apr 23 13:22:23.692172 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/__init__.py", line 19, in setup
[Fri Apr 23 13:22:23.692176 2021] [:error] [pid 3423] [remote 127.0.0.1:40] configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
[Fri Apr 23 13:22:23.692181 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/conf/__init__.py", line 83, in __getattr__
[Fri Apr 23 13:22:23.692193 2021] [:error] [pid 3423] [remote 127.0.0.1:40] self._setup(name)
[Fri Apr 23 13:22:23.692199 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/conf/__init__.py", line 70, in _setup
[Fri Apr 23 13:22:23.692202 2021] [:error] [pid 3423] [remote 127.0.0.1:40] self._wrapped = Settings(settings_module)
[Fri Apr 23 13:22:23.692207 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/conf/__init__.py", line 177, in __init__
[Fri Apr 23 13:22:23.692211 2021] [:error] [pid 3423] [remote 127.0.0.1:40] mod = importlib.import_module(self.SETTINGS_MODULE)
[Fri Apr 23 13:22:23.692216 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "/opt/python/run/venv/lib64/python3.6/importlib/__init__.py", line 126, in import_module
[Fri Apr 23 13:22:23.692219 2021] [:error] [pid 3423] [remote 127.0.0.1:40] return _bootstrap._gcd_import(name[level:], package, level)
[Fri Apr 23 13:22:23.692224 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "<frozen importlib._bootstrap>", line 994, in _gcd_import
[Fri Apr 23 13:22:23.692229 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "<frozen importlib._bootstrap>", line 971, in _find_and_load
[Fri Apr 23 13:22:23.692234 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
[Fri Apr 23 13:22:23.692239 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
[Fri Apr 23 13:22:23.692244 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "<frozen importlib._bootstrap_external>", line 674, in exec_module
[Fri Apr 23 13:22:23.692249 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "<frozen importlib._bootstrap_external>", line 781, in get_code
[Fri Apr 23 13:22:23.692259 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "<frozen importlib._bootstrap_external>", line 741, in source_to_code
[Fri Apr 23 13:22:23.692264 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
[Fri Apr 23 13:22:23.692278 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "/opt/python/current/app/greatkart/settings.py", line 33
[Fri Apr 23 13:22:23.692288 2021] [:error] [pid 3423] [remote 127.0.0.1:40] \xc2\xb2
[Fri Apr 23 13:22:23.692304 2021] [:error] [pid 3423] [remote 127.0.0.1:40] ^
[Fri Apr 23 13:22:23.692311 2021] [:error] [pid 3423] [remote 127.0.0.1:40] SyntaxError: invalid character in identifier
[Fri Apr 23 13:22:24.695493 2021] [:error] [pid 3423] [remote 127.0.0.1:40] mod_wsgi (pid=3423): Target WSGI script '/opt/python/current/app/greatkart/wsgi.py' cannot be loaded as Python module.
Edit 2
Database config :
Database config in AWS EB

Target WSGI script '/opt/python/current/app/github/wsgi.py' cannot be loaded as Python module

I am trying for two days to deploy my django project on aws. But i am getting one error after another.
After lots of searching for answers. This is the last error that i am not able to overcome.
I am following these guides:
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html
https://www.1strategy.com/blog/2017/05/23/tutorial-django-elastic-beanstalk/
After all of it.
When i try to access my site.It shows 500 Server Error.
In Logs it Shows
Target WSGI script '/opt/python/current/app/github/wsgi.py' cannot be loaded as Python module.
Another question on net answered to comment the Database lines in settings file.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
This is my wsgi.py file
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings')
application = get_wsgi_application()
After it my site loads. But then the problem is there is not database. So it throws another error
settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details.
So now i am struck here. I have looked at every related question tried there solution but nothing is working. It is my first time trying AWS and it is turning out to be very hard. I deployed my project on heroku successfully but heroku does not support cron job and i really need something like cron job for my project.
This is my django.config in .ebextensions folder
option_settings:
"aws:elasticbeanstalk:application:environment":
DJANGO_SETTINGS_MODULE: "github.settings"
PYTHONPATH: "$PYTHONPATH"
"aws:elasticbeanstalk:container:python":
WSGIPath: "github/wsgi.py"
StaticFiles: "/static/=www/static/"
packages:
yum:
postgresql95-devel: []
After changing to WSGIPath: github.wsgi:application
The error stays the same as 500 internal error
but error in log changes so.
[Fri Sep 18 19:50:46.625700 2020] [:error] [pid 6504] [remote 127.0.0.1:0] application = get_wsgi_application()
[Fri Sep 18 19:50:46.625707 2020] [:error] [pid 6504] [remote 127.0.0.1:0] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
[Fri Sep 18 19:50:46.625711 2020] [:error] [pid 6504] [remote 127.0.0.1:0] django.setup(set_prefix=False)
[Fri Sep 18 19:50:46.625721 2020] [:error] [pid 6504] [remote 127.0.0.1:0] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
[Fri Sep 18 19:50:46.625725 2020] [:error] [pid 6504] [remote 127.0.0.1:0] apps.populate(settings.INSTALLED_APPS)
[Fri Sep 18 19:50:46.625730 2020] [:error] [pid 6504] [remote 127.0.0.1:0] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/apps/registry.py", line 114, in populate
[Fri Sep 18 19:50:46.625734 2020] [:error] [pid 6504] [remote 127.0.0.1:0] app_config.import_models()
[Fri Sep 18 19:50:46.625740 2020] [:error] [pid 6504] [remote 127.0.0.1:0] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/apps/config.py", line 211, in import_models
[Fri Sep 18 19:50:46.625743 2020] [:error] [pid 6504] [remote 127.0.0.1:0] self.models_module = import_module(models_module_name)
[Fri Sep 18 19:50:46.625749 2020] [:error] [pid 6504] [remote 127.0.0.1:0] File "/opt/python/run/venv/lib64/python3.6/importlib/__init__.py", line 126, in import_module
[Fri Sep 18 19:50:46.625753 2020] [:error] [pid 6504] [remote 127.0.0.1:0] return _bootstrap._gcd_import(name[level:], package, level)
[Fri Sep 18 19:50:46.625758 2020] [:error] [pid 6504] [remote 127.0.0.1:0] File "<frozen importlib._bootstrap>", line 994, in _gcd_import
[Fri Sep 18 19:50:46.625776 2020] [:error] [pid 6504] [remote 127.0.0.1:0] File "<frozen importlib._bootstrap>", line 971, in _find_and_load
[Fri Sep 18 19:50:46.625782 2020] [:error] [pid 6504] [remote 127.0.0.1:0] File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
665, in _load_unlocked
[Fri Sep 18 19:50:46.625816 2020] [:error] [pid 6504] [remote 127.0.0.1:0] class AbstractBaseUser(models.Model):
[Fri Sep 18 19:50:46.625832 2020] [:error] [pid 6504] [remote 127.0.0.1:0] value.contribute_to_class(cls, name)
[Fri Sep 18 19:50:46.625838 2020] [:error] [pid 6504] [remote 127.0.0.1:0] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/db/models/options.py", line 206, in contribute_to_class-- More --[Fri Sep 18 19:50:46.625859 2020] [:error] [pid 6504] [remote 127.0.0.1:0] backend = load_backend(db['ENGINE'])
[Fri Sep 18 19:50:46.625884 2020] [:error] [pid 6504] [remote 127.0.0.1:0] check_sqlite_version()
[Fri Sep 18 19:50:46.625889 2020] [:error] [pid 6504] [remote 127.0.0.1:0] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py", line 67, in check_sqlite_version-- M[Fri Sep 18 19:50:47.629796 2020] [:error] [pid 6504] [remote 127.0.0.1:28] Traceback (most recent call last):
[Fri Sep 18 19:50:47.629840 2020] [:error] [pid 6504] [remote 127.0.0.1:28] application = get_wsgi_application()
[Fri Sep 18 19:50:47.629850 2020] [:error] [pid 6504] [remote 127.0.0.1:28] django.setup(set_prefix=False)
[Fri Sep 18 19:50:47.629860 2020] [:error] [pid 6504] [remote 127.0.0.1:28] apps.populate(settings.INSTALLED_APPS)
[Fri Sep 18 19:50:47.629884 2020] [:error] [pid 6504] [remote 127.0.0.1:28] RuntimeError: populate() isn't reentrant
[Fri Sep 18 19:50:48.633315 2020] [:error] [pid 6504] [remote 127.0.0.1:28] Traceback (most recent call last):
[Fri Sep 18 19:50:48.633351 2020] [:error] [pid 6504] [remote 127.0.0.1:28] application = get_wsgi_application()
[Fri Sep 18 19:50:48.633362 2020] [:error] [pid 6504] [remote 127.0.0.1:28] django.setup(set_prefix=False)
[Fri Sep 18 19:50:48.633372 2020] [:error] [pid 6504] [remote 127.0.0.1:28] apps.populate(settings.INSTALLED_APPS)
[Fri Sep 18 19:50:48.633396 2020] [:error] [pid 6504] [remote 127.0.0.1:28] RuntimeError: populate() isn't reentrant
[Fri Sep 18 19:50:49.638585 2020] [:error] [pid 6504] [remote 127.0.0.1:32] Traceback (most recent call last):
[Fri Sep 18 19:50:49.638628 2020] [:error] [pid 6504] [remote 127.0.0.1:32] application = get_wsgi_application()
[Fri Sep 18 19:50:49.638638 2020] [:error] [pid 6504] [remote 127.0.0.1:32] django.setup(set_prefix=False)
[Fri Sep 18 19:50:49.638647 2020] [:error] [pid 6504] [remote 127.0.0.1:32] apps.populate(settings.INSTALLED_APPS)
[Fri Sep 18 19:50:49.638672 2020] [:error] [pid 6504] [remote 127.0.0.1:32] RuntimeError: populate() isn't reentrant
[Fri Sep 18 19:51:21.223059 2020] [:error] [pid 6504] [remote 172.31.2.91:32] Traceback (most recent call last):
[Fri Sep 18 19:51:21.223107 2020] [:error] [pid 6504] [remote 172.31.2.91:32] application = get_wsgi_application()
[Fri Sep 18 19:51:21.223118 2020] [:error] [pid 6504] [remote 172.31.2.91:32] django.setup(set_prefix=False)
[Fri Sep 18 19:51:21.223154 2020] [:error] [pid 6504] [remote 172.31.2.91:32] RuntimeError: populate() isn't reentrant
[Fri Sep 18 19:51:22.482909 2020] [:error] [pid 6504] [remote 172.31.2.91:32] Traceback (most recent call last):
[Fri Sep 18 19:51:22.482955 2020] [:error] [pid 6504] [remote 172.31.2.91:32] application = get_wsgi_application()
[Fri Sep 18 19:51:22.482966 2020] [:error] [pid 6504] [remote 172.31.2.91:32] django.setup(set_prefix=False)
[Fri Sep 18 19:51:22.483001 2020] [:error] [pid 6504] [remote 172.31.2.91:32] RuntimeError: populate() isn't reentrant

ImportError: The Python module 'xapian_backend' has no 'XapianEngine' class

I upgraded Django from 1.5 to 1.7 with django-haystack django-haystack==2.0.0 and xapian xapian-haystack==1.1.5b0 getting an error.
[Mon Nov 16 13:32:48.685396 2015] [wsgi:error] [pid 692193:tid 139901570070272] [remote 127.0.0.1:25439] File "/home/kbuzz/webapps/kenyabuzz/lib/python2.7/Django-1.7.10-py2.7.egg/django/dispatch/dispatcher.py", line 198, in send
[Mon Nov 16 13:32:48.685469 2015] [wsgi:error] [pid 692193:tid 139901570070272] [remote 127.0.0.1:25439] response = receiver(signal=self, sender=sender, **named)
[Mon Nov 16 13:32:48.685481 2015] [wsgi:error] [pid 692193:tid 139901570070272] [remote 127.0.0.1:25439] File "/home/kbuzz/lib/python2.7/haystack/__init__.py", line 59, in reset_search_queries
[Mon Nov 16 13:32:48.685520 2015] [wsgi:error] [pid 692193:tid 139901570070272] [remote 127.0.0.1:25439] for conn in connections.all():
[Mon Nov 16 13:32:48.685530 2015] [wsgi:error] [pid 692193:tid 139901570070272] [remote 127.0.0.1:25439] File "/home/kbuzz/lib/python2.7/haystack/utils/loading.py", line 112, in all
[Mon Nov 16 13:32:48.685597 2015] [wsgi:error] [pid 692193:tid 139901570070272] [remote 127.0.0.1:25439] return [self[alias] for alias in self.connections_info]
[Mon Nov 16 13:32:48.685608 2015] [wsgi:error] [pid 692193:tid 139901570070272] [remote 127.0.0.1:25439] File "/home/kbuzz/lib/python2.7/haystack/utils/loading.py", line 100, in __getitem__
[Mon Nov 16 13:32:48.685634 2015] [wsgi:error] [pid 692193:tid 139901570070272] [remote 127.0.0.1:25439] self._connections[key] = load_backend(self.connections_info[key]['ENGINE'])(using=key)
[Mon Nov 16 13:32:48.685644 2015] [wsgi:error] [pid 692193:tid 139901570070272] [remote 127.0.0.1:25439] File "/home/kbuzz/lib/python2.7/haystack/utils/loading.py", line 53, in load_backend
[Mon Nov 16 13:32:48.685657 2015] [wsgi:error] [pid 692193:tid 139901570070272] [remote 127.0.0.1:25439] return import_class(full_backend_path)
[Mon Nov 16 13:32:48.685666 2015] [wsgi:error] [pid 692193:tid 139901570070272] [remote 127.0.0.1:25439] File "/home/kbuzz/lib/python2.7/haystack/utils/loading.py", line 23, in import_class
[Mon Nov 16 13:32:48.685679 2015] [wsgi:error] [pid 692193:tid 139901570070272] [remote 127.0.0.1:25439] raise ImportError("The Python module '%s' has no '%s' class." % (module_path, class_name))
[Mon Nov 16 13:32:48.685695 2015] [wsgi:error] [pid 692193:tid 139901570070272] [remote 127.0.0.1:25439] ImportError: The Python module 'xapian_backend' has no 'XapianEngine' class.
UPDATE
I've tried to switch to whoosh instead of xapian but the error persists.
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'xapian_backend.XapianEngine',
'PATH': '/home/kbuzz/whoosh_index',
},
}

django module "ImportError could not import settings" ratticweb.settings

i am trying to run RatticDB Passwordtool in a Docker Container on our VPN Server. Only reachable over a specific Port and VPN.
When i try to reach the Webpanel of my App, i get the following errors from apache.
I am no Python Developer, and thats why i cant figure out, why it cant import the settings from the manage.py
Thats how my manage.py looks
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ratticweb.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
and apache2 error.log >>
[Thu Jul 16 08:26:38.326535 2015] [:error] [pid 10082:tid 140394318771968] [remote 10.150.0.6:29714] % (self.SETTINGS_MODULE, e)
[Thu Jul 16 08:26:38.326560 2015] [:error] [pid 10082:tid 140394318771968] [remote 10.150.0.6:29714] ImportError: Could not import settings 'ratticweb.settings' (Is it on sys.path? Is there an import error in the settings file?): No module named ratticweb.settings
[Thu Jul 16 08:26:39.320769 2015] [:error] [pid 10083:tid 140394276775680] [remote 10.150.0.6:10021] mod_wsgi (pid=10083): Exception occurred processing WSGI script '/opt/apps/ratticweb/wsgi.py'.
[Thu Jul 16 08:26:39.320843 2015] [:error] [pid 10083:tid 140394276775680] [remote 10.150.0.6:10021] Traceback (most recent call last):
[Thu Jul 16 08:26:39.320866 2015] [:error] [pid 10083:tid 140394276775680] [remote 10.150.0.6:10021] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 187, in __call__
[Thu Jul 16 08:26:39.321025 2015] [:error] [pid 10083:tid 140394276775680] [remote 10.150.0.6:10021] self.load_middleware()
[Thu Jul 16 08:26:39.321044 2015] [:error] [pid 10083:tid 140394276775680] [remote 10.150.0.6:10021] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 44, in load_middleware
[Thu Jul 16 08:26:39.321175 2015] [:error] [pid 10083:tid 140394276775680] [remote 10.150.0.6:10021] for middleware_path in settings.MIDDLEWARE_CLASSES:
[Thu Jul 16 08:26:39.321192 2015] [:error] [pid 10083:tid 140394276775680] [remote 10.150.0.6:10021] File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 54, in __getattr__
[Thu Jul 16 08:26:39.321296 2015] [:error] [pid 10083:tid 140394276775680] [remote 10.150.0.6:10021] self._setup(name)
[Thu Jul 16 08:26:39.321312 2015] [:error] [pid 10083:tid 140394276775680] [remote 10.150.0.6:10021] File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 49, in _setup
[Thu Jul 16 08:26:39.321340 2015] [:error] [pid 10083:tid 140394276775680] [remote 10.150.0.6:10021] self._wrapped = Settings(settings_module)
[Thu Jul 16 08:26:39.321354 2015] [:error] [pid 10083:tid 140394276775680] [remote 10.150.0.6:10021] File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 132, in __init__
[Thu Jul 16 08:26:39.321379 2015] [:error] [pid 10083:tid 140394276775680] [remote 10.150.0.6:10021] % (self.SETTINGS_MODULE, e)
[Thu Jul 16 08:26:39.321400 2015] [:error] [pid 10083:tid 140394276775680] [remote 10.150.0.6:10021] ImportError: Could not import settings 'ratticweb.settings' (Is it on sys.path? Is there an import error in the settings file?): No module named ratticweb.settings
[Thu Jul 16 08:39:35.490918 2015] [:error] [pid 10083:tid 140394411173632] [remote 10.150.0.6:31762] mod_wsgi (pid=10083): Exception occurred processing WSGI script '/opt/apps/ratticweb/wsgi.py'.
[Thu Jul 16 08:39:35.491024 2015] [:error] [pid 10083:tid 140394411173632] [remote 10.150.0.6:31762] Traceback (most recent call last):
[Thu Jul 16 08:39:35.491100 2015] [:error] [pid 10083:tid 140394411173632] [remote 10.150.0.6:31762] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 187, in __call__
[Thu Jul 16 08:39:35.491271 2015] [:error] [pid 10083:tid 140394411173632] [remote 10.150.0.6:31762] self.load_middleware()
[Thu Jul 16 08:39:35.491294 2015] [:error] [pid 10083:tid 140394411173632] [remote 10.150.0.6:31762] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 44, in load_middleware
[Thu Jul 16 08:39:35.491352 2015] [:error] [pid 10083:tid 140394411173632] [remote 10.150.0.6:31762] for middleware_path in settings.MIDDLEWARE_CLASSES:
[Thu Jul 16 08:39:35.491386 2015] [:error] [pid 10083:tid 140394411173632] [remote 10.150.0.6:31762] File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 54, in __getattr__
[Thu Jul 16 08:39:35.491444 2015] [:error] [pid 10083:tid 140394411173632] [remote 10.150.0.6:31762] self._setup(name)
[Thu Jul 16 08:39:35.491469 2015] [:error] [pid 10083:tid 140394411173632] [remote 10.150.0.6:31762] File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 49, in _setup
[Thu Jul 16 08:39:35.491506 2015] [:error] [pid 10083:tid 140394411173632] [remote 10.150.0.6:31762] self._wrapped = Settings(settings_module)
[Thu Jul 16 08:39:35.491522 2015] [:error] [pid 10083:tid 140394411173632] [remote 10.150.0.6:31762] File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 132, in __init__
[Thu Jul 16 08:39:35.491556 2015] [:error] [pid 10083:tid 140394411173632] [remote 10.150.0.6:31762] % (self.SETTINGS_MODULE, e)
[Thu Jul 16 08:39:35.491620 2015] [:error] [pid 10083:tid 140394411173632] [remote 10.150.0.6:31762] ImportError: Could not import settings 'ratticweb.settings' (Is it on sys.path? Is there an import error in the settings file?): No module named ratticweb.settings
Any idea on how to fix this?
I saw serveral Topics with this kind of Problems, but their issues had another source.
if i check the paths ... it seems fine
>>> import sys
>>> for path in sys.path: print path
...
/opt/apps
/opt/apps/manage.py
/usr/lib/python2.7
/usr/lib/python2.7/plat-x86_64-linux-gnu
/usr/lib/python2.7/lib-tk
/usr/lib/python2.7/lib-old
/usr/lib/python2.7/lib-dynload
/usr/local/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages
Ideally your project path should be in python sys path, check this out to fix this ImportError: Could not import settings

ImportError: No module named 'sysmon'

This is my first release of a new Django app on my production server. Locally it works perfectly but on my production server I get the following 500 Internal Error. I can't figure out what sysmon referees too.
from my log file:
[Thu Jun 25 06:49:11.415601 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] mod_wsgi (pid=6066): Target WSGI script '/home/ymorin007/webapps/hoozdis_com/src/hoozdis/wsgi.py' cannot be loaded as Python module.
[Thu Jun 25 06:49:11.415680 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] mod_wsgi (pid=6066): Exception occurred processing WSGI script '/home/ymorin007/webapps/hoozdis_com/src/hoozdis/wsgi.py'.
[Thu Jun 25 06:49:11.415717 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] Traceback (most recent call last):
[Thu Jun 25 06:49:11.415869 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] File "/home/ymorin007/webapps/hoozdis_com/src/hoozdis/wsgi.py", line 31, in <module>
[Thu Jun 25 06:49:11.415883 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] application = get_wsgi_application()
[Thu Jun 25 06:49:11.415971 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] File "/home/ymorin007/webapps/hoozdis_com/lib/python3.4/Django-1.8.2-py3.4.egg/django/core/wsgi.py", line 14, in get_wsgi_application
[Thu Jun 25 06:49:11.415978 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] django.setup()
[Thu Jun 25 06:49:11.416060 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] File "/home/ymorin007/webapps/hoozdis_com/lib/python3.4/Django-1.8.2-py3.4.egg/django/__init__.py", line 18, in setup
[Thu Jun 25 06:49:11.416067 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] apps.populate(settings.INSTALLED_APPS)
[Thu Jun 25 06:49:11.416220 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] File "/home/ymorin007/webapps/hoozdis_com/lib/python3.4/Django-1.8.2-py3.4.egg/django/apps/registry.py", line 85, in populate
[Thu Jun 25 06:49:11.416227 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] app_config = AppConfig.create(entry)
[Thu Jun 25 06:49:11.416341 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] File "/home/ymorin007/webapps/hoozdis_com/lib/python3.4/Django-1.8.2-py3.4.egg/django/apps/config.py", line 86, in create
[Thu Jun 25 06:49:11.416348 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] module = import_module(entry)
[Thu Jun 25 06:49:11.416455 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] File "/usr/local/lib/python3.4/importlib/__init__.py", line 109, in import_module
[Thu Jun 25 06:49:11.416462 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] return _bootstrap._gcd_import(name[level:], package, level)
[Thu Jun 25 06:49:11.416479 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
[Thu Jun 25 06:49:11.416494 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
[Thu Jun 25 06:49:11.416508 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] File "<frozen importlib._bootstrap>", line 2224, in _find_and_load_unlocked
[Thu Jun 25 06:49:11.416615 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] ImportError: No module named 'sysmon'
And also I've just notice that when restart the server I get the following error (RuntimeError: populate() isn't reentrant
):
[Thu Jun 25 08:01:43.556475 2015] [wsgi:error] [pid 6066:tid 140229247973120] [remote 127.0.0.1:160] mod_wsgi (pid=6066): Target WSGI script '/home/ymorin007/webapps/hoozdis_com/src/hoozdis/wsgi.py' cannot be loaded as Python module.
[Thu Jun 25 08:01:43.556561 2015] [wsgi:error] [pid 6066:tid 140229247973120] [remote 127.0.0.1:160] mod_wsgi (pid=6066): Exception occurred processing WSGI script '/home/ymorin007/webapps/hoozdis_com/src/hoozdis/wsgi.py'.
[Thu Jun 25 08:01:43.556611 2015] [wsgi:error] [pid 6066:tid 140229247973120] [remote 127.0.0.1:160] Traceback (most recent call last):
[Thu Jun 25 08:01:43.556685 2015] [wsgi:error] [pid 6066:tid 140229247973120] [remote 127.0.0.1:160] File "/home/ymorin007/webapps/hoozdis_com/src/hoozdis/wsgi.py", line 31, in <module>
[Thu Jun 25 08:01:43.556695 2015] [wsgi:error] [pid 6066:tid 140229247973120] [remote 127.0.0.1:160] application = get_wsgi_application()
[Thu Jun 25 08:01:43.556748 2015] [wsgi:error] [pid 6066:tid 140229247973120] [remote 127.0.0.1:160] File "/home/ymorin007/webapps/hoozdis_com/lib/python3.4/Django-1.8.2-py3.4.egg/django/core/wsgi.py", line 14, in get_wsgi_application
[Thu Jun 25 08:01:43.556757 2015] [wsgi:error] [pid 6066:tid 140229247973120] [remote 127.0.0.1:160] django.setup()
[Thu Jun 25 08:01:43.556799 2015] [wsgi:error] [pid 6066:tid 140229247973120] [remote 127.0.0.1:160] File "/home/ymorin007/webapps/hoozdis_com/lib/python3.4/Django-1.8.2-py3.4.egg/django/__init__.py", line 18, in setup
[Thu Jun 25 08:01:43.556818 2015] [wsgi:error] [pid 6066:tid 140229247973120] [remote 127.0.0.1:160] apps.populate(settings.INSTALLED_APPS)
[Thu Jun 25 08:01:43.556861 2015] [wsgi:error] [pid 6066:tid 140229247973120] [remote 127.0.0.1:160] File "/home/ymorin007/webapps/hoozdis_com/lib/python3.4/Django-1.8.2-py3.4.egg/django/apps/registry.py", line 78, in populate
[Thu Jun 25 08:01:43.556870 2015] [wsgi:error] [pid 6066:tid 140229247973120] [remote 127.0.0.1:160] raise RuntimeError("populate() isn't reentrant")
[Thu Jun 25 08:01:43.556903 2015] [wsgi:error] [pid 6066:tid 140229247973120] [remote 127.0.0.1:160] RuntimeError: populate() isn't reentrant
[Thu Jun 25 08:01:43.846673 2015] [wsgi:error] [pid 6067:tid 140229178517248] [remote 127.0.0.1:172] mod_wsgi (pid=6067): Target WSGI script '/home/ymorin007/webapps/hoozdis_com/src/hoozdis/wsgi.py' cannot be loaded as Python module.
[Thu Jun 25 08:01:43.846748 2015] [wsgi:error] [pid 6067:tid 140229178517248] [remote 127.0.0.1:172] mod_wsgi (pid=6067): Exception occurred processing WSGI script '/home/ymorin007/webapps/hoozdis_com/src/hoozdis/wsgi.py'.
[Thu Jun 25 08:01:43.846787 2015] [wsgi:error] [pid 6067:tid 140229178517248] [remote 127.0.0.1:172] Traceback (most recent call last):
[Thu Jun 25 08:01:43.846843 2015] [wsgi:error] [pid 6067:tid 140229178517248] [remote 127.0.0.1:172] File "/home/ymorin007/webapps/hoozdis_com/src/hoozdis/wsgi.py", line 31, in <module>
[Thu Jun 25 08:01:43.846850 2015] [wsgi:error] [pid 6067:tid 140229178517248] [remote 127.0.0.1:172] application = get_wsgi_application()
[Thu Jun 25 08:01:43.846881 2015] [wsgi:error] [pid 6067:tid 140229178517248] [remote 127.0.0.1:172] File "/home/ymorin007/webapps/hoozdis_com/lib/python3.4/Django-1.8.2-py3.4.egg/django/core/wsgi.py", line 14, in get_wsgi_application
[Thu Jun 25 08:01:43.846888 2015] [wsgi:error] [pid 6067:tid 140229178517248] [remote 127.0.0.1:172] django.setup()
[Thu Jun 25 08:01:43.846914 2015] [wsgi:error] [pid 6067:tid 140229178517248] [remote 127.0.0.1:172] File "/home/ymorin007/webapps/hoozdis_com/lib/python3.4/Django-1.8.2-py3.4.egg/django/__init__.py", line 18, in setup
[Thu Jun 25 08:01:43.846920 2015] [wsgi:error] [pid 6067:tid 140229178517248] [remote 127.0.0.1:172] apps.populate(settings.INSTALLED_APPS)
[Thu Jun 25 08:01:43.846946 2015] [wsgi:error] [pid 6067:tid 140229178517248] [remote 127.0.0.1:172] File "/home/ymorin007/webapps/hoozdis_com/lib/python3.4/Django-1.8.2-py3.4.egg/django/apps/registry.py", line 78, in populate
[Thu Jun 25 08:01:43.846952 2015] [wsgi:error] [pid 6067:tid 140229178517248] [remote 127.0.0.1:172] raise RuntimeError("populate() isn't reentrant")
[Thu Jun 25 08:01:43.846973 2015] [wsgi:error] [pid 6067:tid 140229178517248] [remote 127.0.0.1:172] RuntimeError: populate() isn't reentrant
Frozen modules are modules written in Python whose compiled byte-code
object is incorporated into a custom-built Python interpreter by
Python’s freeze utility. See Tools/freeze/ for now.
From https://docs.python.org/2/library/imp.html#imp.init_frozen
It looks like somewhere someone's freezing some python code and not including all the necessary bits? It's a little tricky to diagnose after that. Try looking for something called sysmon locally.

Categories