Re: Error with mimetype on OS-X 11 (Big Sur)

Christopher Barker <[email protected]> Fri, 7 Jan 2022 16:30:38 -0800
Newsgroups gmane.comp.python.apple
Message-ID <CALn7ch_NywKm1=SWZboUv=r9wX37Z7hahPOHZ4qNE-dLVr1jKg@mail.gmail.com>
--===============6086865541758633195==
Content-Type: multipart/alternative; boundary="00000000000017534d05d50737c8"

--00000000000017534d05d50737c8
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Thanks Jack, this sounds like a promising lead.

In this case, it seems to be PyOpenGL, ultimately loading a system dynlib.
But the broken bit may be within my control.

I=E2=80=99ll report back if I figure it out.

-CHB

On Fri, Jan 7, 2022 at 3:40 PM <[email protected]> wrote:

> I googled the "file system relative paths not allowed in hardened
> programs=E2=80=9D and the results made me remember a similar issue I have=
 seen
> recently.
>
> I was loading a dylib through ctypes, and suddenly this stopped working.
> The problem eventually turned out to be that another dylib (a dependency =
of
> the dylib I was loading) had its quarantine flag set. That was never a
> problem before, but suddenly (last summer?) it has started to be a proble=
m.
>
> The solution turned out to be to run `xattr -d com.apple.quarantine
> blablabla.dylib` on the problem library.
>
> Not sure whether this is your problem or not, but it=E2=80=99s worth a sh=
ot. If
> (big if) this is a dynamic loader problem you=E2=80=99re in for a hard ti=
me: it
> used to be possible to debug these by setting the various DYLD_ environme=
nt
> variables to =E2=80=9Clook over the shoulder=E2=80=9D of the dynamic load=
er to see what it
> is doing, but nowadays these environment variables are always cleared
> automatically (unless you have the
> com.apple.security.cs.allow-dyld-environment-variables entitlement, so if
> there=E2=80=99s a third party app somewhere in the chain that=E2=80=99s a=
 no-no).
> --
> Jack Jansen, <[email protected]>, http://www.cwi.nl/~jack
> If I can't dance I don't want to be part of your revolution -- Emma Goldm=
an
>
>
>
> > On 6 Jan 2022, at 19:57, Chris Barker via Pythonmac-SIG <
> [email protected]> wrote:
> >
> > OK,
> >
> > I've gotten a bit farther into debugging this.
> >
> > Turns out it's not about that particular error, it's probably about the
> fact that modules couldn't be loaded at start up due to security checks i=
n
> the new OS.
> >
> > We've signed the app but that's not fixing it :-(
> >
> > Starting the app at the command line at least gets me output, and I see
> a lot of errors like this:
> >
> >   File
> "PyInstaller-3.4-py3.6.egg/PyInstaller/loader/pyiboot01_bootstrap.py", li=
ne
> 149, in __init__
> >   File "ctypes/__init__.py", line 348, in __init__
> > OSError: dlopen(OpenGL, 10): no suitable image found.  Did find:
> >     file system relative paths not allowed in hardened programs
> >
> > I am really confused as to how they could disallow relative paths -- ho=
w
> else could you bundle a library?
> >
> > though maybe it's a lib outside the bundle that's using relative paths =
?
> >
> > More digging needed, but if anyone has any ideas, I'm all ears.
> >
> > Also:
> >
> > - Has anyone gotten a PyInstaller App to work on OS-X 11 ?
> >
> > - Even better, one that uses OpenGL?
> >
> > Thanks,
> >
> > -CHB
> >
> >
> >
> > On Thu, Dec 16, 2021 at 11:21 AM Chris Barker <[email protected]>
> wrote:
> > I've just got a new mac with OS-X 11.6 (still Intel).
> >
> > But when I try to run a PyInstaller built application, I get this error=
:
> >
> > No document available for {'mime': 'application/x-maproom-project-zip',
> 'loader': <maproom.loaders.project.ZipProjectLoader object at
> 0x7f9669ce6e10>, 'uri': 'template://default_project.maproom'}
> >
> > And the app won't start.
> >
> > This has worked just fine on numerous previous OS-X versions.
> >
> > I have the source code, but the developer that built it is no longer
> with us, so it'll take b e a bit to get up to speed, and I don't even kno=
w
> where to start! Is this a PyInstaller issue? or a code issue, or ???
> >
> > Hints:
> >
> > The application is called MapRoom (maproom) it works with "projects"
> that are essentially a zip file with all the info required in it.
> >
> > I think, on startup, it loads a empty default project, presumably
> "default_project.maproom"
> >
> > So I think that's where the app startup code is barfing, not having the
> mime type registered properly. But where / how am I supposed to do that?
> >
> > or maybe it's not a mime type registration issue, but simply that the
> template can't be found -- so a path issue in the App bundle??
> >
> > Anyway, I'll be digging into this deeper in the source code, but if
> anyone has seen anything like this, any hints would be appreciated!
> >
> > Thanks,
> >
> > -CHB
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > --
> >
> > Christopher Barker, Ph.D.
> > Oceanographer
> >
> > Emergency Response Division
> > NOAA/NOS/OR&R            (206) 526-6959   voice
> > 7600 Sand Point Way NE   (206) 526-6329   fax
> > Seattle, WA  98115       (206) 526-6317   main reception
> >
> > [email protected]
> >
> >
> > --
> >
> > Christopher Barker, Ph.D.
> > Oceanographer
> >
> > Emergency Response Division
> > NOAA/NOS/OR&R            (206) 526-6959   voice
> > 7600 Sand Point Way NE   (206) 526-6329   fax
> > Seattle, WA  98115       (206) 526-6317   main reception
> >
> > [email protected]
> > _______________________________________________
> > Pythonmac-SIG maillist  -  [email protected]
> > https://mail.python.org/mailman/listinfo/pythonmac-sig
> > unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG
>
> _______________________________________________
> Pythonmac-SIG maillist  -  [email protected]
> https://mail.python.org/mailman/listinfo/pythonmac-sig
> unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG
>
--=20
Christopher Barker, PhD (Chris)

Python Language Consulting
  - Teaching
  - Scientific Software Development
  - Desktop GUI and Web Development
  - wxPython, numpy, scipy, Cython

--00000000000017534d05d50737c8
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto">Thanks Jack, this sounds like a promising lead.</div><div=
 dir=3D"auto"><br></div><div dir=3D"auto">In this case, it seems to be PyOp=
enGL, ultimately loading a system dynlib. But the broken bit may be within =
my control.</div><div dir=3D"auto"><br></div><div dir=3D"auto">I=E2=80=99ll=
 report back if I figure it out.</div><div dir=3D"auto"><br></div><div dir=
=3D"auto">-CHB</div><div><br><div class=3D"gmail_quote"><div dir=3D"ltr" cl=
ass=3D"gmail_attr">On Fri, Jan 7, 2022 at 3:40 PM &lt;<a href=3D"mailto:jac=
[email protected]">[email protected]</a>&gt; wrote:<br></div><blockquote cla=
ss=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;pa=
dding-left:1ex">I googled the &quot;file system relative paths not allowed =
in hardened programs=E2=80=9D and the results made me remember a similar is=
sue I have seen recently.<br>
<br>
I was loading a dylib through ctypes, and suddenly this stopped working. Th=
e problem eventually turned out to be that another dylib (a dependency of t=
he dylib I was loading) had its quarantine flag set. That was never a probl=
em before, but suddenly (last summer?) it has started to be a problem.<br>
<br>
The solution turned out to be to run `xattr -d com.apple.quarantine blablab=
la.dylib` on the problem library.<br>
<br>
Not sure whether this is your problem or not, but it=E2=80=99s worth a shot=
. If (big if) this is a dynamic loader problem you=E2=80=99re in for a hard=
 time: it used to be possible to debug these by setting the various DYLD_ e=
nvironment variables to =E2=80=9Clook over the shoulder=E2=80=9D of the dyn=
amic loader to see what it is doing, but nowadays these environment variabl=
es are always cleared automatically (unless you have the com.apple.security=
.cs.allow-dyld-environment-variables entitlement, so if there=E2=80=99s a t=
hird party app somewhere in the chain that=E2=80=99s a no-no).<br>
--<br>
Jack Jansen, &lt;<a href=3D"mailto:[email protected]" target=3D"_blank">Ja=
[email protected]</a>&gt;, <a href=3D"http://www.cwi.nl/~jack" rel=3D"norefe=
rrer" target=3D"_blank">http://www.cwi.nl/~jack</a><br>
If I can&#39;t dance I don&#39;t want to be part of your revolution -- Emma=
 Goldman<br>
<br>
<br>
<br>
&gt; On 6 Jan 2022, at 19:57, Chris Barker via Pythonmac-SIG &lt;<a href=3D=
"mailto:[email protected]" target=3D"_blank">[email protected]=
g</a>&gt; wrote:<br>
&gt; <br>
&gt; OK,<br>
&gt; <br>
&gt; I&#39;ve gotten a bit farther into debugging this.<br>
&gt; <br>
&gt; Turns out it&#39;s not about that particular error, it&#39;s probably =
about the fact that modules couldn&#39;t be loaded at start up due to secur=
ity checks in the new OS.<br>
&gt; <br>
&gt; We&#39;ve signed the app but that&#39;s not fixing it :-( <br>
&gt; <br>
&gt; Starting the app at the command line at least gets me output, and I se=
e a lot of errors like this:<br>
&gt; <br>
&gt;=C2=A0 =C2=A0File &quot;PyInstaller-3.4-py3.6.egg/PyInstaller/loader/py=
iboot01_bootstrap.py&quot;, line 149, in __init__<br>
&gt;=C2=A0 =C2=A0File &quot;ctypes/__init__.py&quot;, line 348, in __init__=
<br>
&gt; OSError: dlopen(OpenGL, 10): no suitable image found.=C2=A0 Did find:<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0file system relative paths not allowed in hardened =
programs<br>
&gt; <br>
&gt; I am really confused as to how they could disallow relative paths -- h=
ow else could you bundle a library?<br>
&gt; <br>
&gt; though maybe it&#39;s a lib outside the bundle that&#39;s using relati=
ve paths ?<br>
&gt; <br>
&gt; More digging needed, but if anyone has any ideas, I&#39;m all ears.<br=
>
&gt; <br>
&gt; Also:<br>
&gt; <br>
&gt; - Has anyone gotten a PyInstaller App to work on OS-X 11 ?<br>
&gt; <br>
&gt; - Even better, one that uses OpenGL?<br>
&gt; <br>
&gt; Thanks,<br>
&gt; <br>
&gt; -CHB<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; On Thu, Dec 16, 2021 at 11:21 AM Chris Barker &lt;<a href=3D"mailto:ch=
[email protected]" target=3D"_blank">[email protected]</a>&gt; wrote:=
<br>
&gt; I&#39;ve just got a new mac with OS-X 11.6 (still Intel).<br>
&gt; <br>
&gt; But when I try to run a PyInstaller built application, I get this erro=
r:<br>
&gt; <br>
&gt; No document available for {&#39;mime&#39;: &#39;application/x-maproom-=
project-zip&#39;, &#39;loader&#39;: &lt;maproom.loaders.project.ZipProjectL=
oader object at 0x7f9669ce6e10&gt;, &#39;uri&#39;: &#39;template://default_=
project.maproom&#39;}<br>
&gt; <br>
&gt; And the app won&#39;t start.<br>
&gt; <br>
&gt; This has worked just fine on numerous previous OS-X versions.<br>
&gt; <br>
&gt; I have the source code, but the developer that built it is no longer w=
ith us, so it&#39;ll take b e a bit to get up to speed, and I don&#39;t eve=
n know where to start! Is this a PyInstaller issue? or a code issue, or ???=
<br>
&gt; <br>
&gt; Hints:<br>
&gt; <br>
&gt; The application is called MapRoom (maproom) it works with &quot;projec=
ts&quot; that are essentially a zip file with all the info required in it.<=
br>
&gt; <br>
&gt; I think, on startup, it loads a empty default project, presumably &quo=
t;default_project.maproom&quot;<br>
&gt; <br>
&gt; So I think that&#39;s where the app startup code is barfing, not havin=
g the mime type registered properly. But where / how am I supposed to do th=
at?<br>
&gt; <br>
&gt; or maybe it&#39;s not a mime type registration issue, but simply that =
the template can&#39;t be found -- so a path issue in the App bundle??<br>
&gt; <br>
&gt; Anyway, I&#39;ll be digging into this deeper in the source code, but i=
f anyone has seen anything like this, any hints would be appreciated!<br>
&gt; <br>
&gt; Thanks,<br>
&gt; <br>
&gt; -CHB<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt;=C2=A0 <br>
&gt; <br>
&gt; -- <br>
&gt; <br>
&gt; Christopher Barker, Ph.D.<br>
&gt; Oceanographer<br>
&gt; <br>
&gt; Emergency Response Division<br>
&gt; NOAA/NOS/OR&amp;R=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (206) 526-6=
959=C2=A0 =C2=A0voice<br>
&gt; 7600 Sand Point Way NE=C2=A0 =C2=A0(206) 526-6329=C2=A0 =C2=A0fax<br>
&gt; Seattle, WA=C2=A0 98115=C2=A0 =C2=A0 =C2=A0 =C2=A0(206) 526-6317=C2=A0=
 =C2=A0main reception<br>
&gt; <br>
&gt; <a href=3D"mailto:[email protected]" target=3D"_blank">Chris.Barke=
[email protected]</a><br>
&gt; <br>
&gt; <br>
&gt; -- <br>
&gt; <br>
&gt; Christopher Barker, Ph.D.<br>
&gt; Oceanographer<br>
&gt; <br>
&gt; Emergency Response Division<br>
&gt; NOAA/NOS/OR&amp;R=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (206) 526-6=
959=C2=A0 =C2=A0voice<br>
&gt; 7600 Sand Point Way NE=C2=A0 =C2=A0(206) 526-6329=C2=A0 =C2=A0fax<br>
&gt; Seattle, WA=C2=A0 98115=C2=A0 =C2=A0 =C2=A0 =C2=A0(206) 526-6317=C2=A0=
 =C2=A0main reception<br>
&gt; <br>
&gt; <a href=3D"mailto:[email protected]" target=3D"_blank">Chris.Barke=
[email protected]</a><br>
&gt; _______________________________________________<br>
&gt; Pythonmac-SIG maillist=C2=A0 -=C2=A0 <a href=3D"mailto:Pythonmac-SIG@p=
ython.org" target=3D"_blank">[email protected]</a><br>
&gt; <a href=3D"https://mail.python.org/mailman/listinfo/pythonmac-sig" rel=
=3D"noreferrer" target=3D"_blank">https://mail.python.org/mailman/listinfo/=
pythonmac-sig</a><br>
&gt; unsubscribe: <a href=3D"https://mail.python.org/mailman/options/Python=
mac-SIG" rel=3D"noreferrer" target=3D"_blank">https://mail.python.org/mailm=
an/options/Pythonmac-SIG</a><br>
<br>
_______________________________________________<br>
Pythonmac-SIG maillist=C2=A0 -=C2=A0 <a href=3D"mailto:Pythonmac-SIG@python=
.org" target=3D"_blank">[email protected]</a><br>
<a href=3D"https://mail.python.org/mailman/listinfo/pythonmac-sig" rel=3D"n=
oreferrer" target=3D"_blank">https://mail.python.org/mailman/listinfo/pytho=
nmac-sig</a><br>
unsubscribe: <a href=3D"https://mail.python.org/mailman/options/Pythonmac-S=
IG" rel=3D"noreferrer" target=3D"_blank">https://mail.python.org/mailman/op=
tions/Pythonmac-SIG</a><br>
</blockquote></div></div>-- <br><div dir=3D"ltr" class=3D"gmail_signature" =
data-smartmail=3D"gmail_signature"><div dir=3D"ltr">Christopher Barker, PhD=
 (Chris)<br><br> Python Language Consulting<br>=C2=A0 - Teaching<br>=C2=A0 =
- Scientific Software Development<br>=C2=A0 - Desktop GUI and Web Developme=
nt<br>=C2=A0 - wxPython, numpy, scipy, Cython<br></div></div>

--00000000000017534d05d50737c8--

--===============6086865541758633195==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Pythonmac-SIG maillist  -  [email protected]
https://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG

--===============6086865541758633195==--