question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Proxy Error: Socket Hang up (nbgrader formgrader)

See original GitHub issue

Hi,

I seem to be getting a wierd issue with the nginx proxy and nbgrader formgrader service on jupyterhub. I used the Jupyter-deploy-teaching as a template for setting up jupyterhub and nbgrader.

The software: Jupyterhub 0.7.2 Nbgrader 0.4.0

The issue: When adding the formgrader service to jupyterhub I get this error message in the logs for jupyterhub:

[I 2017-04-27 15:52:04.583 JupyterHub log:100] 200 GET /hub/home (nabr@10.52.1.172) 11.75ms
15:52:04.586 - error: [ConfigProxy] Proxy error:  Error: socket hang up
    at createHangUpError (_http_client.js:252:15)
    at Socket.socketCloseListener (_http_client.js:284:23)
    at emitOne (events.js:101:20)
    at Socket.emit (events.js:188:7)
    at TCP._handle.close [as _onclose] (net.js:493:12)
15:52:04.589 - error: [ConfigProxy] 503 GET /user/nabr/courses?_=1493301122293
[I 2017-04-27 15:52:04.602 JupyterHub log:100] 200 GET /hub/error/503?url=%2Fuser%2Fnabr%2Fcourses%3F_%3D1493301122293 (@127.0.0.1) 8.26ms
[I 2017-04-27 15:52:05.911 JupyterHub log:100] 200 GET /hub/admin (nabr@10.52.1.172) 16.45ms
[I 2017-04-27 15:52:08.044 JupyterHub log:100] 302 GET /hub/ (nabr@10.52.1.172) 9.06ms
[I 2017-04-27 15:52:08.085 JupyterHub log:100] 200 GET /hub/api/authorizations/cookie/jupyter-hub-token-nabr/[secret] (nabr@127.0.0.1) 15.26ms
15:52:41.213 - error: [ConfigProxy] Proxy error:  Error: socket hang up
    at createHangUpError (_http_client.js:252:15)
    at Socket.socketCloseListener (_http_client.js:284:23)
    at emitOne (events.js:101:20)
    at Socket.emit (events.js:188:7)
    at TCP._handle.close [as _onclose] (net.js:493:12)
15:52:41.213 - error: [ConfigProxy] 503 GET /user/nabr/courses?_=1493301159478
[I 2017-04-27 15:52:41.218 JupyterHub log:100] 200 GET /hub/error/503?url=%2Fuser%2Fnabr%2Fcourses%3F_%3D1493301159478 (@127.0.0.1) 1.42ms
[I 2017-04-27 15:53:36.600 JupyterHub log:100] 302 GET /hub/ (nabr@10.52.1.172) 11.92ms
[I 2017-04-27 15:53:36.639 JupyterHub log:100] 200 GET /hub/api/authorizations/cookie/jupyter-hub-token-nabr/[secret] (nabr@127.0.0.1) 13.74ms

The formgrader functionality seem to work just fine, but the error is filling up my log for jupyterhub.

I added the service as follows in the jupyterhub config:

       #SummerSchool
    {
       'name': 'formgrader-SummerSchool',
       'admin': True,
       'command': ['nbgrader', 'formgrade'],
       'url': 'http://127.0.0.1:5006',
       'cwd': '/home/nabr/SummerSchool/'
    },

and have the corresponding config file set-up as

c = get_config()

###############################################################################
# Begin additions by nbgrader quickstart
###############################################################################

# You only need this if you are running nbgrader on a shared
# server set up.
c.NbGrader.course_id = "SummerSchool"

c.FormgradeApp.authenticator_class = u'nbgrader.auth.hubauth.HubAuth'
c.FormgradeApp.ip = '127.0.0.1'
c.FormgradeApp.port = 5006 #Make sure port matches with the set port on jupyterHub service

# The grader_group option is the most important option that must be specified:
# it determines who will be able to access the formgrader, and corresponds to a
# JupyterHub group (specified in the JupyterHub.load_groups config option).
c.HubAuth.grader_group = u'SummerSchool-graders'

...

If I remove the formgrader service by commenting it out and restarting jupyterhub I do not get the error anymore. But of course then formgrader does not work.

Can anyone tell me what I am doing wrong?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
jhamrickcommented, Jul 11, 2017

I do not see the error anymore, yay!

Great! I’m glad that’s resolved, then.

I had a look at the “formgrader” tab. Looks great.

Thanks!

Any way to only enable the formgrader for instructors (certain unixusers), while still having the assignment tab for all users?

Yes, you can definitely do that (though it’s a little bit of a hassle). As described here, you can selectively enable and disable certain extensions. So for example, if you’ve already run:

# install and enable all the extensions systemwide
jupyter nbextension install --system --py nbgrader --overwrite
jupyter nbextension enable --system --py nbgrader
jupyter serverextension enable --system --py nbgrader

You can then disable the formgrader extension for everybody:

jupyter nbextension disable --system formgrader/main --section=tree
jupyter serverextension disable --system nbgrader.server_extensions.formgrader

And then, as the instructor account, selectively enable it:

jupyter nbextension enable --user formgrader/main --section=tree
jupyter serverextension enable --user nbgrader.server_extensions.formgrader

I’m going to go ahead and close this issue since the proxy error is resolved now, but if you have more questions or any issues with this new version of the formgrader please feel free to open another issue!

0reactions
nabriiscommented, Jul 11, 2017

I do not see the error anymore, yay!

I had a look at the “formgrader” tab. Looks great. Any way to only enable the formgrader for instructors (certain unixusers), while still having the assignment tab for all users?

Read more comments on GitHub >

github_iconTop Results From Across the Web

NodeJS - What does "socket hang up" actually mean?
When you, as a client, send a request to a remote server, and receive no timely response. Your socket is ended which throws...
Read more >
Hang in There! (A solution to socket hang up) - Medium
This blog post will go over my process of solving the error and what the actual (and surprisingly/annoyingly) simple solution was. First thing ......
Read more >
lticontainerspawner - etc - jupyterhub_ltids_config.py
This is the address on which the proxy will bind. ... 'JUPYTERHUB_OAUTH_SCOPES' : # for "[ConfigProxy] error: 503 GET ... socket hang up"....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found