> On 23 Aug 2016, at 12:20 AM, 'Danny' via modwsgi <[email protected]> 
> wrote:
> 
> I ran the update, but there still seems to be a problem, although a different 
> one.
> 
> $ ./manage.py runmodwsgi --log-to-terminal
> Successfully ran command.
> Server URL         : http://localhost:8000/
> Server Root        : /tmp/mod_wsgi-localhost:8000:501
> Server Conf        : /tmp/mod_wsgi-localhost:8000:501/httpd.conf
> Error Log File     : /dev/stderr (warn)
> Request Capacity   : 5 (1 process * 5 threads)
> Request Timeout    : 60 (seconds)
> Startup Timeout    : 15 (seconds)
> Queue Backlog      : 100 (connections)
> Queue Timeout      : 45 (seconds)
> Server Capacity    : 20 (event/worker), 20 (prefork)
> Server Backlog     : 500 (connections)
> Locale Setting     : en_US.UTF-8
> [Mon Aug 22 07:47:21.316329 2016] [mpm_event:notice] [pid 21136:tid 
> 140623639619328] AH00489: Apache/2.4.12 (Unix) mod_wsgi/4.5.6 Python/3.5.2 
> configured -- resuming normal operations
> [Mon Aug 22 07:47:21.316454 2016] [core:notice] [pid 21136:tid 
> 140623639619328] AH00094: Command line: 'httpd (mod_wsgi-express)  -f 
> /tmp/mod_wsgi-localhost:8000:501/httpd.conf -D 
> MOD_WSGI_MPM_ENABLE_EVENT_MODULE -D MOD_WSGI_MPM_EXISTS_EVENT_MODULE -D 
> MOD_WSGI_MPM_EXISTS_WORKER_MODULE -D MOD_WSGI_MPM_EXISTS_PREFORK_MODULE -D 
> FOREGROUND'
> [Mon Aug 22 07:47:21.675068 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328] mod_wsgi (pid=21139): Target WSGI script 
> '/tmp/mod_wsgi-localhost:8000:501/handler.wsgi' cannot be loaded as Python 
> module.
> [Mon Aug 22 07:47:21.675190 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328] mod_wsgi (pid=21139): Exception occurred processing WSGI 
> script '/tmp/mod_wsgi-localhost:8000:501/handler.wsgi'.
> [Mon Aug 22 07:47:21.677587 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328] Traceback (most recent call last):
> [Mon Aug 22 07:47:21.677687 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328]   File "/tmp/mod_wsgi-localhost:8000:501/handler.wsgi", line 
> 94, in <module>
> [Mon Aug 22 07:47:21.677697 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328]     recorder_directory=recorder_directory)
> [Mon Aug 22 07:47:21.677709 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328]   File 
> "/opt/Envs/guidewire/lib/python3.5/site-packages/mod_wsgi/server/__init__.py",
>  line 1348, in __init__
> [Mon Aug 22 07:47:21.677716 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328]     exec(code, self.module.__dict__)
> [Mon Aug 22 07:47:21.677727 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328]   File "/opt/Projects/guidewire/config/wsgi.py", line 31, in 
> <module>
> [Mon Aug 22 07:47:21.677733 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328]     application = get_wsgi_application()
> [Mon Aug 22 07:47:21.677744 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328]   File 
> "/opt/Envs/guidewire/lib/python3.5/site-packages/django/core/wsgi.py", line 
> 13, in get_wsgi_application
> [Mon Aug 22 07:47:21.677750 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328]     django.setup(set_prefix=False)
> [Mon Aug 22 07:47:21.677760 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328]   File 
> "/opt/Envs/guidewire/lib/python3.5/site-packages/django/__init__.py", line 
> 22, in setup
> [Mon Aug 22 07:47:21.677767 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328]     configure_logging(settings.LOGGING_CONFIG, 
> settings.LOGGING)
> [Mon Aug 22 07:47:21.677778 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328]   File 
> "/opt/Envs/guidewire/lib/python3.5/site-packages/django/conf/__init__.py", 
> line 53, in __getattr__
> [Mon Aug 22 07:47:21.677784 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328]     self._setup(name)
> [Mon Aug 22 07:47:21.677794 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328]   File 
> "/opt/Envs/guidewire/lib/python3.5/site-packages/django/conf/__init__.py", 
> line 41, in _setup
> [Mon Aug 22 07:47:21.677800 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328]     self._wrapped = Settings(settings_module)
> [Mon Aug 22 07:47:21.677811 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328]   File 
> "/opt/Envs/guidewire/lib/python3.5/site-packages/django/conf/__init__.py", 
> line 97, in __init__
> [Mon Aug 22 07:47:21.677817 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328]     mod = importlib.import_module(self.SETTINGS_MODULE)
> [Mon Aug 22 07:47:21.677909 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328]   File 
> "/opt/Envs/guidewire/lib/python3.5/importlib/__init__.py", line 126, in 
> import_module
> [Mon Aug 22 07:47:21.677920 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328]     return _bootstrap._gcd_import(name[level:], package, 
> level)
> [Mon Aug 22 07:47:21.677934 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328]   File "<frozen importlib._bootstrap>", line 986, in 
> _gcd_import
> [Mon Aug 22 07:47:21.677947 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328]   File "<frozen importlib._bootstrap>", line 969, in 
> _find_and_load
> [Mon Aug 22 07:47:21.677959 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328]   File "<frozen importlib._bootstrap>", line 944, in 
> _find_and_load_unlocked
> [Mon Aug 22 07:47:21.677971 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328]   File "<frozen importlib._bootstrap>", line 222, in 
> _call_with_frames_removed
> [Mon Aug 22 07:47:21.677983 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328]   File "<frozen importlib._bootstrap>", line 986, in 
> _gcd_import
> [Mon Aug 22 07:47:21.677995 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328]   File "<frozen importlib._bootstrap>", line 969, in 
> _find_and_load
> [Mon Aug 22 07:47:21.678007 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328]   File "<frozen importlib._bootstrap>", line 944, in 
> _find_and_load_unlocked
> [Mon Aug 22 07:47:21.678019 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328]   File "<frozen importlib._bootstrap>", line 222, in 
> _call_with_frames_removed
> [Mon Aug 22 07:47:21.678031 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328]   File "<frozen importlib._bootstrap>", line 986, in 
> _gcd_import
> [Mon Aug 22 07:47:21.678042 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328]   File "<frozen importlib._bootstrap>", line 969, in 
> _find_and_load
> [Mon Aug 22 07:47:21.678054 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328]   File "<frozen importlib._bootstrap>", line 956, in 
> _find_and_load_unlocked
> [Mon Aug 22 07:47:21.678090 2016] [wsgi:error] [pid 21139:tid 
> 140623639619328] ImportError: No module named 'config'
> [Mon Aug 22 07:47:42.378005 2016] [mpm_event:notice] [pid 21136:tid 
> 140623639619328] AH00492: caught SIGWINCH, shutting down gracefully
> Segmentation fault
> 
> I get the error immediately after running the command. Before even trying to 
> load a page in my browser.
> 
> I think I am properly configured because if I do a simple mod_wsgi-express I 
> get:
> 
> (guidewire)$ mod_wsgi-express start-server
> Server URL         : http://localhost:8000/
> Server Root        : /tmp/mod_wsgi-localhost:8000:501
> Server Conf        : /tmp/mod_wsgi-localhost:8000:501/httpd.conf
> Error Log File     : /tmp/mod_wsgi-localhost:8000:501/error_log (warn)
> Request Capacity   : 5 (1 process * 5 threads)
> Request Timeout    : 60 (seconds)
> Startup Timeout    : 15 (seconds)
> Queue Backlog      : 100 (connections)
> Queue Timeout      : 45 (seconds)
> Server Capacity    : 20 (event/worker), 20 (prefork)
> Server Backlog     : 500 (connections)
> Locale Setting     : en_US.UTF-8
> 
> and the homepage serves just fine. I am running this within a 
> virtualenvwrapper virtualenv. and have enviroment variables set in 
> postactivate.py
> 
> Trying to start my django project is likewise a problem. This works just 
> fine. 
> 
> $ mod_wsgi-express start-server --log-to-terminal --url-alias /static 
> staticfiles --application-type module config.wsgi
> Server URL         : http://localhost:8000/
> Server Root        : /tmp/mod_wsgi-localhost:8000:501
> Server Conf        : /tmp/mod_wsgi-localhost:8000:501/httpd.conf
> Error Log File     : /dev/stderr (warn)
> Request Capacity   : 5 (1 process * 5 threads)
> Request Timeout    : 60 (seconds)
> Startup Timeout    : 15 (seconds)
> Queue Backlog      : 100 (connections)
> Queue Timeout      : 45 (seconds)
> Server Capacity    : 20 (event/worker), 20 (prefork)
> Server Backlog     : 500 (connections)
> Locale Setting     : en_US.UTF-8
> [Mon Aug 22 08:03:29.621506 2016] [mpm_event:notice] [pid 21464:tid 
> 140254695110400] AH00489: Apache/2.4.12 (Unix) mod_wsgi/4.5.6 Python/3.5.2 
> configured -- resuming normal operations
> [Mon Aug 22 08:03:29.621631 2016] [core:notice] [pid 21464:tid 
> 140254695110400] AH00094: Command line: 'httpd (mod_wsgi-express)  -f 
> /tmp/mod_wsgi-localhost:8000:501/httpd.conf -D 
> MOD_WSGI_MPM_ENABLE_EVENT_MODULE -D MOD_WSGI_MPM_EXISTS_EVENT_MODULE -D 
> MOD_WSGI_MPM_EXISTS_WORKER_MODULE -D MOD_WSGI_MPM_EXISTS_PREFORK_MODULE -D 
> FOREGROUND'
> 
> but (and I must admit, I don't really understand how to use the arguments of 
> runmodwsgi_...
> 
> $ ./manage.py runmodwsgi --log-to-terminal --url-alias /static staticfiles  
> --entry-point config.wsgiSuccessfully ran command.

The --url-alias /static staticfiles  --entry-point config.wsgi options wouldn’t 
have been required, but did highlight an issue with converting from optparse to 
argparse on the fly.

Latest of develop branch should address this last issue.

Am not sure about the inability to import config module just yet. I can’t see 
how the fix I have made could address that.

You said you had environment variables set by the virtual environment 
activation. What were they for? Are you setting DJANGO_SETTING_MODULES from 
postactivate.py?

Anyway, give the fix a try and will then try and sort out module not being 
found.

Graham

> Traceback (most recent call last):
>   File "./manage.py", line 10, in <module>
>     execute_from_command_line(sys.argv)
>   File 
> "/opt/Envs/guidewire/lib/python3.5/site-packages/django/core/management/__init__.py",
>  line 367, in execute_from_command_line
>     utility.execute()
>   File 
> "/opt/Envs/guidewire/lib/python3.5/site-packages/django/core/management/__init__.py",
>  line 359, in execute
>     self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "/opt/Envs/guidewire/lib/python3.5/site-packages/django/core/management/base.py",
>  line 305, in run_from_argv
>     self.execute(*args, **cmd_options)
>   File 
> "/opt/Envs/guidewire/lib/python3.5/site-packages/django/core/management/base.py",
>  line 356, in execute
>     output = self.handle(*args, **options)
>   File 
> "/opt/Envs/guidewire/lib/python3.5/site-packages/mod_wsgi/server/management/commands/runmodwsgi.py",
>  line 103, in handle
>     'start-server', args, options)
>   File 
> "/opt/Envs/guidewire/lib/python3.5/site-packages/mod_wsgi/server/__init__.py",
>  line 2594, in _cmd_setup_server
>     options['entry_point'] = os.path.abspath(args[0])
>   File "/opt/Envs/guidewire/lib/python3.5/posixpath.py", line 357, in abspath
>     if not isabs(path):
>   File "/opt/Envs/guidewire/lib/python3.5/posixpath.py", line 64, in isabs
>     return s.startswith(sep)
> AttributeError: 'list' object has no attribute 'startswith'
> 
> I'm sure I misusing some stuff here, but please let me know what I can do to 
> help
> Danny
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "modwsgi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> Visit this group at https://groups.google.com/group/modwsgi 
> <https://groups.google.com/group/modwsgi>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to