<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 10, 2016 at 1:56 AM, Robert Park <span dir="ltr"><<a href="mailto:robert.park@canonical.com" target="_blank">robert.park@canonical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Right, so that was a $PYTHONPATH issue indeed which I've fixed by<br>
setting this in a wrapper script:<br>
<br>
export PYTHONPATH="$SNAP/usr/lib/<wbr>python3/dist-packages:$SNAP/<wbr>src"<br>
<br>
<br>
But still gunicorn is not working. When I run it, I get this error:<br>
<br>
$ sudo quantifiedself.server<br>
[2016-10-09 16:30:13 -0700] [4365] [INFO] Starting gunicorn 19.4.5<br>
[2016-10-09 16:30:13 -0700] [4365] [INFO] Listening at:<br>
<a href="http://0.0.0.0:8080" rel="noreferrer" target="_blank">http://0.0.0.0:8080</a> (4365)<br>
[2016-10-09 16:30:13 -0700] [4365] [INFO] Using worker: sync<br>
fish: “sudo quantifiedself.server” terminated by signal SIGSYS (Bad system call)<br>
<br>
<br>
All I can find in kern.log is this, but it doesn't mean much to me:<br>
<br>
236:Oct 9 16:30:02 rouge kernel: [1793707.594342] audit: type=1400<br>
audit(1476055802.615:377): apparmor="DENIED" operation="capable"<br>
profile="snap.quantifiedself.<wbr>server" pid=4236 comm="gunicorn3"<br>
capability=1 capname="dac_override"<br>
237:Oct 9 16:30:13 rouge kernel: [1793718.438376] audit: type=1326<br>
audit(1476055813.459:378): auid=1000 uid=0 gid=0 ses=1 pid=4365<br>
comm="gunicorn3" exe="/usr/bin/python3.5" sig=31 arch=c000003e<br>
syscall=92 compat=0 ip=0x7f861dff2a47 code=0x0<br>
<br>
<br>
Anybody have any ideas how to troubleshoot this?<br></blockquote><div><br></div><div>The first trace is for apparmor, you need to have</div><div><br></div><div>capability dac_override,<br></div><div><br></div><div>in the apparmor snippet of one of the interfaces you are using.</div><div><br></div><div>The second one seems to be from seccomp when calling syscall 92, which happens to be chown. You would need to have that call in the seccomp snippet of one interface you are using.</div><div><br></div><div>Not sure if you miss some interface/connection or if these need to be added to one interface you are using.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Thanks.<br>
<br>
On Sun, Oct 2, 2016 at 11:51 AM, Robert Park <<a href="mailto:robert.park@canonical.com">robert.park@canonical.com</a>> wrote:<br>
> I've got gunicorn3 and python3-gunicorn in my stage-packages, and<br>
> gunicorn is working correctly when I run it from my app's source tree,<br>
> but when I try to snap it I get this:<br>
><br>
> Traceback (most recent call last):<br>
> File "/snap/weighttracker/x4/usr/<wbr>bin/gunicorn3", line 5, in <module><br>
> from pkg_resources import load_entry_point<br>
> File "/usr/lib/python3/dist-<wbr>packages/pkg_resources/__init_<wbr>_.py",<br>
> line 2927, in <module><br>
> @_call_aside<br>
> File "/usr/lib/python3/dist-<wbr>packages/pkg_resources/__init_<wbr>_.py",<br>
> line 2913, in _call_aside<br>
> f(*args, **kwargs)<br>
> File "/usr/lib/python3/dist-<wbr>packages/pkg_resources/__init_<wbr>_.py",<br>
> line 2940, in _initialize_master_working_set<br>
> working_set = WorkingSet._build_master()<br>
> File "/usr/lib/python3/dist-<wbr>packages/pkg_resources/__init_<wbr>_.py",<br>
> line 635, in _build_master<br>
> ws.require(__requires__)<br>
> File "/usr/lib/python3/dist-<wbr>packages/pkg_resources/__init_<wbr>_.py",<br>
> line 943, in require<br>
> needed = self.resolve(parse_<wbr>requirements(requirements))<br>
> File "/usr/lib/python3/dist-<wbr>packages/pkg_resources/__init_<wbr>_.py",<br>
> line 829, in resolve<br>
> raise DistributionNotFound(req, requirers)<br>
> pkg_resources.<wbr>DistributionNotFound: The 'gunicorn==19.4.5'<br>
> distribution was not found and is required by the application<br>
><br>
> I find this utterly bizarre because this traceback starts in<br>
> usr/bin/gunicorn3 and then it apparently fails to load itself. I guess<br>
> it's a $PYTHONPATH issue? What am I doing wrong?<br>
><br>
> <a href="https://git.launchpad.net/~robru/+git/weightloss/tree/snapcraft.yaml" rel="noreferrer" target="_blank">https://git.launchpad.net/~<wbr>robru/+git/weightloss/tree/<wbr>snapcraft.yaml</a><br>
><br>
> Thanks.<br>
><br>
> --<br>
> robru<br></blockquote><div><br></div><div>Br,</div><div>Alfonso</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
robru<br>
<br>
--<br>
Snapcraft mailing list<br>
<a href="mailto:Snapcraft@lists.snapcraft.io">Snapcraft@lists.snapcraft.io</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/snapcraft" rel="noreferrer" target="_blank">https://lists.ubuntu.com/<wbr>mailman/listinfo/snapcraft</a><br>
</font></span></blockquote></div><br></div></div>