Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build errors #442

Merged
merged 10 commits into from
Feb 21, 2016
Merged

Fix build errors #442

merged 10 commits into from
Feb 21, 2016

Conversation

jhamrick
Copy link
Member

This should fix the build errors that are occuring on master currently... the issues were:

  1. Related to moving the celltoolbar menu into the View menu in the notebook.
  2. Fixing the JupyterHub cookie bug (Unset all login cookies jupyterhub/jupyterhub#290) in more recent JupyterHub releases.
  3. Making sure JupyterHub is installed on Python 3.5.
  4. Removing os.setpgrp() from the fake spawner, because it doesn't work on Travis.

This also splits the javascript tests into two separate groups, one for the formgrader and one for the nbextensions, which should hopefully make restarting tests a little less cumbersome.

@jhamrick jhamrick added this to the 0.3.0 milestone Feb 21, 2016
@jhamrick
Copy link
Member Author

Sigh, there is still an issue with the JupyterHub tests that I can't figure out. @minrk, do you have any ideas? The error looks like this:

20:04:59.912 - info: [ConfigProxy] Proxying http://*:8000 to http://localhost:8081
20:04:59.914 - info: [ConfigProxy] Proxy API at http://localhost:8001/api/routes
[FormgradeApp | INFO] Proxying /hub/nbgrader/course123ABC --> http://localhost:9000
[FormgradeApp | INFO] Serving MathJax from /home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/notebook/static/components/MathJax/MathJax.js
[FormgradeApp | INFO] Form grader running at http://localhost:9000/
[FormgradeApp | INFO] Use Control-C to stop this server
PASSED
nbgrader/tests/formgrader/test_auth_failures.py::TestAuthFailures::test_login[BadHubAuthManager] [FormgradeApp | INFO] 302 GET /hub/nbgrader/course123ABC/ (127.0.0.1) 0.93ms
[E 2016-02-21 20:05:11.050 JupyterHub user:192] Unhandled error starting foobar's server: Exception occurred in preexec_fn.
[E 2016-02-21 20:05:11.056 JupyterHub web:1524] Uncaught exception POST /hub/login?next=%2Fhub%2Fnbgrader%2Fcourse123ABC (127.0.0.1)
    HTTPServerRequest(protocol='http', host='localhost:8000', method='POST', uri='/hub/login?next=%2Fhub%2Fnbgrader%2Fcourse123ABC', version='HTTP/1.1', remote_ip='127.0.0.1', headers={'Connection': 'close', 'Host': 'localhost:8000', 'Origin': 'http://localhost:8000', 'Accept-Encoding': 'gzip, deflate', 'Referer': 'http://localhost:8000/hub/login?next=/hub/nbgrader/course123ABC', 'Content-Type': 'application/x-www-form-urlencoded', 'Content-Length': '25', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'X-Forwarded-Port': '8000', 'X-Forwarded-Proto': 'http', 'Accept-Language': 'en-US,*', 'X-Forwarded-For': '127.0.0.1', 'User-Agent': 'Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.0.0 Safari/538.1'})
    Traceback (most recent call last):
      File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/tornado/web.py", line 1445, in _execute
        result = yield result
      File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/jupyterhub/handlers/login.py", line 72, in post
        yield self.spawn_single_user(user)
      File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/jupyterhub/handlers/base.py", line 296, in spawn_single_user
        yield gen.with_timeout(timedelta(seconds=self.slow_spawn_timeout), f)
      File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/jupyterhub/user.py", line 202, in spawn
        raise e
      File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/jupyterhub/user.py", line 183, in spawn
        yield gen.with_timeout(timedelta(seconds=spawner.start_timeout), f)
      File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/jupyterhub/spawner.py", line 412, in start
        start_new_session=True, # don't forward signals
      File "/opt/python/3.4.2/lib/python3.4/subprocess.py", line 858, in __init__
        restore_signals, start_new_session)
      File "/opt/python/3.4.2/lib/python3.4/subprocess.py", line 1457, in _execute_child
        raise child_exception_type(err_msg)
    subprocess.SubprocessError: Exception occurred in preexec_fn.

[E 2016-02-21 20:05:11.073 JupyterHub log:99] {
      "Connection": "close",
      "Host": "localhost:8000",
      "Origin": "http://localhost:8000",
      "Accept-Encoding": "gzip, deflate",
      "Referer": "http://localhost:8000/hub/login?next=/hub/nbgrader/course123ABC",
      "Content-Type": "application/x-www-form-urlencoded",
      "Content-Length": "25",
      "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
      "X-Forwarded-Port": "8000",
      "X-Forwarded-Proto": "http",
      "Accept-Language": "en-US,*",
      "X-Forwarded-For": "127.0.0.1",
      "User-Agent": "Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.0.0 Safari/538.1"
    }
[E 2016-02-21 20:05:11.073 JupyterHub log:100] 500 POST /hub/login?next=%2Fhub%2Fnbgrader%2Fcourse123ABC (@127.0.0.1) 57.95ms
FAILED[FormgradeApp | CRITICAL] received signal 15, stopping
[C 2016-02-21 20:05:21.905 JupyterHub app:1084] Received SIGTERM, shutting down

In other words, it's giving that Exception occurred in preexec_fn error. I've only really seen that with SudoSpawner before, which I am not using here. I am using a custom fake spawner though for running tests, which is:

class FakeUserSpawner(LocalProcessSpawner):

    def user_env(self, env):
        env['USER'] = self.user.name
        env['HOME'] = os.getcwd()
        env['SHELL'] = '/bin/bash'
        return env

    def make_preexec_fn(self, name):
        home = os.getcwd()
        def preexec():
            # don't forward signals
            os.setpgrp()
            # start in the cwd
            os.chdir(home)
        return preexec

This spawner works fine locally, and used to work fine on Travis. So I'm kind of stumped on what the issue is. Do you have any insights?

@jhamrick
Copy link
Member Author

Hmmm, I wonder if this could be due to a change on Travis. In the logs it says it doesn't allow use of setuid and setguid. Perhaps calling os.setpgrp() could be causing issues...

@minrk
Copy link
Member

minrk commented Feb 21, 2016

That's possible, I'll see if I can figure our what's up in the morning.

@jhamrick
Copy link
Member Author

@minrk Thanks! I tried removing os.setpgrp() and that seems to have helped... so maybe I will actually have this fixed by the time it's morning for you :-)

@jhamrick
Copy link
Member Author

Yaay, it passes!

jhamrick added a commit that referenced this pull request Feb 21, 2016
@jhamrick jhamrick merged commit 55f76d2 into jupyter:master Feb 21, 2016
@jhamrick jhamrick deleted the fix-build-errors branch February 21, 2016 22:01
@minrk
Copy link
Member

minrk commented Feb 22, 2016

Glad you found it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants