Hi Graham,
Thanks for responding so quickly. I opened the shell and found that my
required packages were installed both globally and in the virtual
environment. Also, I tried running my wsgi script in python while in the
container and didn't encounter the ImportError.
Below is the full output of running the container:
[Fri Nov 20 16:48:11.816998 2015] [mpm_event:notice] [pid 19:tid
140493234792192] AH00489: Apache/2.4.17 (Unix) mod_wsgi/4.4.21
Python/2.7.10 configured -- resuming normal operations
[Fri Nov 20 16:48:11.817235 2015] [core:notice] [pid 19:tid
140493234792192] AH00094: Command line: 'httpd (mod_wsgi-express) -f
/tmp/mod_wsgi-localhost:80:0/httpd.conf -E /dev/stderr -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'
[Fri Nov 20 16:48:11.880050 2015] [wsgi:error] [pid 21:tid 140493234792192]
mod_wsgi (pid=21): Target WSGI script
'/tmp/mod_wsgi-localhost:80:0/handler.wsgi' cannot be loaded as Python
module.
[Fri Nov 20 16:48:11.880238 2015] [wsgi:error] [pid 21:tid 140493234792192]
mod_wsgi (pid=21): Exception occurred processing WSGI script
'/tmp/mod_wsgi-localhost:80:0/handler.wsgi'.
[Fri Nov 20 16:48:11.880461 2015] [wsgi:error] [pid 21:tid 140493234792192]
Traceback (most recent call last):
[Fri Nov 20 16:48:11.880616 2015] [wsgi:error] [pid 21:tid 140493234792192]
File "/tmp/mod_wsgi-localhost:80:0/handler.wsgi", line 94, in <module>
[Fri Nov 20 16:48:11.880969 2015] [wsgi:error] [pid 21:tid 140493234792192]
recorder_directory=recorder_directory)
[Fri Nov 20 16:48:11.881132 2015] [wsgi:error] [pid 21:tid 140493234792192]
File
"/usr/local/python/lib/python2.7/site-packages/mod_wsgi/server/__init__.py",
line 1267, in __init__
[Fri Nov 20 16:48:11.881925 2015] [wsgi:error] [pid 21:tid 140493234792192]
exec(code, self.module.__dict__)
[Fri Nov 20 16:48:11.882076 2015] [wsgi:error] [pid 21:tid 140493234792192]
File "/app/Middleware/c3stemserver.py", line 12, in <module>
[Fri Nov 20 16:48:11.882522 2015] [wsgi:error] [pid 21:tid 140493234792192]
from auth import AuthController, require, has_role, has_privileges
[Fri Nov 20 16:48:11.882687 2015] [wsgi:error] [pid 21:tid 140493234792192]
ImportError: No module named auth
Finally, I'm not sure if it's related, but when I ran `pip list` from the
container's shell (it logged me in as root), I got the following warning:
The directory '/var/www/.cache/pip/http' or its parent directory is not
owned by the current user and the cache has been disabled. Please check the
permissions and owner of that directory. If executing pip with sudo, you
may want sudo's -H flag.
On Friday, November 20, 2015 at 4:31:24 AM UTC-6, Graham Dumpleton wrote:
>
> Sorry for separate messages and not adding to discussion. Don't mean to
> confuse you. Best I can do right now.
>
> If your Dockerfile has USER line in it try commenting it out.
>
> This is not a permanent solution but will help isolate whether is
> permissions issue on writing to application code directory
>
> Graham
>
> On 20 Nov 2015, at 2:34 PM, Collin Jackson <[email protected]
> <javascript:>> wrote:
>
> I'm running mod-wsgi-docker:python-2.7-onbuild and have listed my
> requirements in requirements.txt. During build, I can see that the packages
> are installed properly, but when I try to run the image, it crashes on the
> first non-Standard Library import with an ImportError exception. I can't
> figure out what's happening and it's not exactly easy to poke around inside
> the container to see what's going on. I noticed that a virtual environment
> is created prior to installing the packages (here
> <https://github.com/GrahamDumpleton/mod_wsgi-docker/blob/master/2.7/build.sh#L87>),
>
> but I imagine that if this is the issue, other users would have the same
> issue. Any ideas?
>
> --
> 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] <javascript:>.
> To post to this group, send email to [email protected] <javascript:>
> .
> Visit this group at http://groups.google.com/group/modwsgi.
> For more options, visit 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 http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.