ipython-notebook icon indicating copy to clipboard operation
ipython-notebook copied to clipboard

Notebook sometimes fails to start up

Open suchow opened this issue 10 years ago • 7 comments

I'm on OS X 10.9 running version 1.10 of the notebook. Sometimes, when I try to open the app, the program gives the following error:

Unable to launch iPython notebook
Server failed to start up

Other times, the notebook loads just fine.

I checked the system logs and there are many entries that show up at the time the notebook was loading:

12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny mach-lookup com.apple.ocspd
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny mach-lookup com.apple.ocspd
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny mach-lookup com.apple.ocspd
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny mach-lookup com.apple.ocspd
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny mach-lookup com.apple.ocspd
12/9/13 7:39:27.000 PM kernel[0]: Sandbox: appleeventsd(53) deny mach-lookup com.apple.ocspd
12/9/13 7:39:27.760 PM sandboxd[238]: ([53]) appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.889 PM sandboxd[238]: ([53]) appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.895 PM sandboxd[238]: ([53]) appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.935 PM sandboxd[238]: ([53]) appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.941 PM sandboxd[238]: ([53]) appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.945 PM sandboxd[238]: ([53]) appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.950 PM sandboxd[238]: ([53]) appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:27.954 PM sandboxd[238]: ([53]) appleeventsd(53) deny file-read-metadata /Library
12/9/13 7:39:28.464 PM IPython Notebook[4527]: Removing cache file /Users/admin/Library/Containers/ch.entropy.ipython-notebook/Data/.matplotlib/fontList.cache
12/9/13 7:39:43.000 PM kernel[0]: Sandbox: python(4532) deny file-read-data /opt/X11/share/fonts/TTF
12/9/13 7:39:43.000 PM kernel[0]: Sandbox: python(4532) deny file-read-data /opt/X11/share/fonts
12/9/13 7:39:45.000 PM kernel[0]: Sandbox: python(4532) deny file-read-data /opt/X11/share/fonts/TTF
12/9/13 7:39:45.000 PM kernel[0]: Sandbox: python(4532) deny file-read-data /opt/X11/share/fonts

screen shot 2013-12-09 at 7 41 02 pm

suchow avatar Dec 10 '13 00:12 suchow

Thanks for the report. Do you see any occurrences of these log entries as well?

11/3/13 12:47:55.000 PM kernel[0]: exec of /Users/liyanage/Desktop/IPython Notebook.app/Contents/Resources/virtualenv/bin/python denied since it was quarantined by Safari.app and not approved by Gatekeeper, qtn-flags was 0x00000002
11/3/13 12:47:55.531 PM IPython Notebook[6471]: Couldn't posix_spawn: error 1

Also, how long does the spinner spin approximately before the sheet appears?

liyanage avatar Dec 10 '13 01:12 liyanage

I see no occurrences of those log entries.

The spinner spins for about 15 s before the sheet appears. The arrival of the sheet comes at the same time that these messages are logged:

12/9/13 10:05:54.000 PM kernel[0]: Sandbox: python(4721) deny file-read-data /opt/X11/share/fonts/TTF
12/9/13 10:05:54.000 PM kernel[0]: Sandbox: python(4721) deny file-read-data /opt/X11/share/fonts

suchow avatar Dec 10 '13 03:12 suchow

I restarted, opened iPython Notebook, and the error appeared in the same way as before, but there were three extra lines in the log:

12/9/13 10:33:16.839 PM com.apple.SecurityServer[26]: Killing auth hosts
12/9/13 10:33:16.839 PM com.apple.SecurityServer[26]: Session 100014 destroyed
12/9/13 10:33:16.841 PM com.apple.SecurityServer[26]: Session 100019 created

suchow avatar Dec 10 '13 03:12 suchow

Thanks for this additional information.

Could you run these commands and let me know what the output looks like on your system? This assumes that you have the app in /Applications, adjust accordingly if that's not the case:

xattr -p com.apple.quarantine /Applications/IPython\ Notebook.app
xattr -p com.apple.quarantine /Applications/IPython\ Notebook.app/Contents/Resources/virtualenv/bin/python
spctl --assess /Applications/IPython\ Notebook.app
spctl --assess /Applications/IPython\ Notebook.app/Contents/Resources/virtualenv/bin/python

and lastly, could you run this command and then try launching the app again:

xattr -dr com.apple.quarantine /Applications/IPython\ Notebook.app

liyanage avatar Dec 10 '13 03:12 liyanage

➜  ~  xattr-2.7 -p com.apple.quarantine /Applications/IPython\ Notebook.app
xattr: /Applications/IPython Notebook.app: No such xattr: com.apple.quarantine
➜  ~  xattr-2.7 -p com.apple.quarantine /Applications/IPython\ Notebook.app/Contents/Resources/virtualenv/bin/python
xattr: /Applications/IPython Notebook.app/Contents/Resources/virtualenv/bin/python: No such xattr: com.apple.quarantine
➜  ~  spctl --assess /Applications/IPython\ Notebook.app
➜  ~  spctl --assess /Applications/IPython\ Notebook.app/Contents/Resources/virtualenv/bin/python
➜  ~  xattr-2.7 -dr com.apple.quarantine /Applications/IPython\ Notebook.app
xattr: [Errno 13] Permission denied: '/Applications/IPython Notebook.app/Contents/Resources/virtualenv/.Python'
xattr: [Errno 13] Permission denied: '/Applications/IPython Notebook.app/Contents/Resources/virtualenv/include/python2.7'
xattr: [Errno 13] Permission denied: '/Applications/IPython Notebook.app/Contents/Resources/virtualenv/lib/python2.7/_abcoll.py'
xattr: [Errno 13] Permission denied: '/Applications/IPython Notebook.app/Contents/Resources/virtualenv/lib/python2.7/_weakrefset.py'
xattr: [Errno 13] Permission denied: '/Applications/IPython Notebook.app/Contents/Resources/virtualenv/lib/python2.7/abc.py'
xattr: [Errno 13] Permission denied: '/Applications/IPython Notebook.app/Contents/Resources/virtualenv/lib/python2.7/codecs.py'
xattr: [Errno 13] Permission denied: '/Applications/IPython Notebook.app/Contents/Resources/virtualenv/lib/python2.7/config'
xattr: [Errno 13] Permission denied: '/Applications/IPython Notebook.app/Contents/Resources/virtualenv/lib/python2.7/copy_reg.py'
xattr: [Errno 13] Permission denied: '/Applications/IPython Notebook.app/Contents/Resources/virtualenv/lib/python2.7/encodings'
xattr: [Errno 13] Permission denied: '/Applications/IPython Notebook.app/Contents/Resources/virtualenv/lib/python2.7/fnmatch.py'
xattr: [Errno 13] Permission denied: '/Applications/IPython Notebook.app/Contents/Resources/virtualenv/lib/python2.7/genericpath.py'
xattr: [Errno 13] Permission denied: '/Applications/IPython Notebook.app/Contents/Resources/virtualenv/lib/python2.7/lib-dynload'
xattr: [Errno 13] Permission denied: '/Applications/IPython Notebook.app/Contents/Resources/virtualenv/lib/python2.7/linecache.py'
xattr: [Errno 13] Permission denied: '/Applications/IPython Notebook.app/Contents/Resources/virtualenv/lib/python2.7/locale.py'
xattr: [Errno 13] Permission denied: '/Applications/IPython Notebook.app/Contents/Resources/virtualenv/lib/python2.7/ntpath.py'
xattr: [Errno 13] Permission denied: '/Applications/IPython Notebook.app/Contents/Resources/virtualenv/lib/python2.7/os.py'
xattr: [Errno 13] Permission denied: '/Applications/IPython Notebook.app/Contents/Resources/virtualenv/lib/python2.7/posixpath.py'
xattr: [Errno 13] Permission denied: '/Applications/IPython Notebook.app/Contents/Resources/virtualenv/lib/python2.7/re.py'
xattr: [Errno 13] Permission denied: '/Applications/IPython Notebook.app/Contents/Resources/virtualenv/lib/python2.7/sre.py'
xattr: [Errno 13] Permission denied: '/Applications/IPython Notebook.app/Contents/Resources/virtualenv/lib/python2.7/sre_compile.py'
xattr: [Errno 13] Permission denied: '/Applications/IPython Notebook.app/Contents/Resources/virtualenv/lib/python2.7/sre_constants.py'
xattr: [Errno 13] Permission denied: '/Applications/IPython Notebook.app/Contents/Resources/virtualenv/lib/python2.7/sre_parse.py'
xattr: [Errno 13] Permission denied: '/Applications/IPython Notebook.app/Contents/Resources/virtualenv/lib/python2.7/stat.py'
xattr: [Errno 13] Permission denied: '/Applications/IPython Notebook.app/Contents/Resources/virtualenv/lib/python2.7/types.py'
xattr: [Errno 13] Permission denied: '/Applications/IPython Notebook.app/Contents/Resources/virtualenv/lib/python2.7/UserDict.py'
xattr: [Errno 13] Permission denied: '/Applications/IPython Notebook.app/Contents/Resources/virtualenv/lib/python2.7/warnings.py'

suchow avatar Dec 10 '13 04:12 suchow

Thanks again. Given the output of the first commands it probably won't make a difference, but could you try re-running the last one with sudo?

sudo xattr -dr com.apple.quarantine /Applications/IPython\ Notebook.app

BTW, your snippet shows xattr-2.7 instead of just xattr. Is that how you ran it?

liyanage avatar Dec 10 '13 06:12 liyanage

When I first ran xattr, I got the message:

python version 2.7.6 can't run /usr/bin/xattr.  Try the alternative(s):

/usr/bin/xattr-2.5 (uses python 2.5)
/usr/bin/xattr-2.6 (uses python 2.6)
/usr/bin/xattr-2.7 (uses python 2.7)

Run "man python" for more information about multiple version support in
Mac OS X.

which is why I switched to xattr-2.7.

When I now run the command you suggest (but with xattr-2.7), I get no output:

➜  ~  sudo xattr-2.7 -dr com.apple.quarantine /Applications/IPython\ Notebook.app
➜  ~

suchow avatar Dec 10 '13 06:12 suchow