Has anybody ever snapped gunicorn?

Robert Park robert.park at canonical.com
Sun Oct 9 23:56:47 UTC 2016


Right, so that was a $PYTHONPATH issue indeed which I've fixed by
setting this in a wrapper script:

export PYTHONPATH="$SNAP/usr/lib/python3/dist-packages:$SNAP/src"


But still gunicorn is not working. When I run it, I get this error:

$ sudo quantifiedself.server
[2016-10-09 16:30:13 -0700] [4365] [INFO] Starting gunicorn 19.4.5
[2016-10-09 16:30:13 -0700] [4365] [INFO] Listening at:
http://0.0.0.0:8080 (4365)
[2016-10-09 16:30:13 -0700] [4365] [INFO] Using worker: sync
fish: “sudo quantifiedself.server” terminated by signal SIGSYS (Bad system call)


All I can find in kern.log is this, but it doesn't mean much to me:

236:Oct  9 16:30:02 rouge kernel: [1793707.594342] audit: type=1400
audit(1476055802.615:377): apparmor="DENIED" operation="capable"
profile="snap.quantifiedself.server" pid=4236 comm="gunicorn3"
capability=1  capname="dac_override"
237:Oct  9 16:30:13 rouge kernel: [1793718.438376] audit: type=1326
audit(1476055813.459:378): auid=1000 uid=0 gid=0 ses=1 pid=4365
comm="gunicorn3" exe="/usr/bin/python3.5" sig=31 arch=c000003e
syscall=92 compat=0 ip=0x7f861dff2a47 code=0x0


Anybody have any ideas how to troubleshoot this?

Thanks.

On Sun, Oct 2, 2016 at 11:51 AM, Robert Park <robert.park at canonical.com> wrote:
> I've got gunicorn3 and python3-gunicorn in my stage-packages, and
> gunicorn is working correctly when I run it from my app's source tree,
> but when I try to snap it I get this:
>
> Traceback (most recent call last):
>   File "/snap/weighttracker/x4/usr/bin/gunicorn3", line 5, in <module>
>     from pkg_resources import load_entry_point
>   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py",
> line 2927, in <module>
>     @_call_aside
>   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py",
> line 2913, in _call_aside
>     f(*args, **kwargs)
>   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py",
> line 2940, in _initialize_master_working_set
>     working_set = WorkingSet._build_master()
>   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py",
> line 635, in _build_master
>     ws.require(__requires__)
>   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py",
> line 943, in require
>     needed = self.resolve(parse_requirements(requirements))
>   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py",
> line 829, in resolve
>     raise DistributionNotFound(req, requirers)
> pkg_resources.DistributionNotFound: The 'gunicorn==19.4.5'
> distribution was not found and is required by the application
>
> I find this utterly bizarre because this traceback starts in
> usr/bin/gunicorn3 and then it apparently fails to load itself. I guess
> it's a $PYTHONPATH issue? What am I doing wrong?
>
> https://git.launchpad.net/~robru/+git/weightloss/tree/snapcraft.yaml
>
> Thanks.
>
> --
> robru



-- 
robru




More information about the Snapcraft mailing list