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

%nuclio build / deploy: Notebook HTTP 404 not found on JupyterHub #54

Open
yoshua0x opened this issue Aug 18, 2019 · 1 comment
Open

Comments

@yoshua0x
Copy link

Hello,

The build and deploy functions are throwing HTTP 404 errors on JupyterHub. The error is getting thrown by the notebook_file_name method when attempting to parse the notebook file URL from the iPython server.

Thanks to Yaron's assistance, a temporary work around was provided by using the filename as the parameter %nuclio build <filename>.ipynb <flags>.

def notebook_file_name(ikernel):
    """Return the full path of the jupyter notebook."""
    # Check that we're running under notebook
    if not (ikernel and ikernel.config['IPKernelApp']):
        return

    kernel_id = re.search('kernel-(.*).json',
                          ipykernel.connect.get_connection_file()).group(1)
    servers = list_running_servers()
    for srv in servers:
        query = {'token': srv.get('token', '')}
        url = urljoin(srv['url'], 'api/sessions') + '?' + urlencode(query)
        for session in json.load(urlopen(url)):
from notebook.notebookapp import list_running_servers
from urllib.parse import urljoin, urlencode
from urllib.request import urlopen
for srv in list_running_servers():
    query = {'token': srv.get('token', '')}
    url = urljoin(srv['url'], 'api/sessions') + '?' + urlencode(query)
    print(srv)
    print(url)
    print(urlopen(url).read())

returns:

{'base_url': '/user/dither/', 'hostname': '0.0.0.0', 'notebook_dir': '/home/jovyan', 'password': False, 'pid': 6, 'port': 8888, 'secure': False, 'token': '', 'url': 'http://0.0.0.0:8888/user/jdavis/'}

http://0.0.0.0:8888/user/dither/api/sessions?token=

HTTP 404 ERROR)

For reference: the suffix /user/.. is from running Jupyter via JupyterHub. We currently use the helm deployment on Kubernetes.

Package versions:
Nuclio version: 0.7.3
JupyterHub: 0.9.4
JupyterLab version: 1.0.4
Jupyter Notebook: 6.0.0

@tebeka
Copy link
Contributor

tebeka commented Sep 22, 2019

Working on this. Look at this issue but get 404 on http://127.0.0.1:60231/hub/api/oauth2/authorize..

Probably need to add some auth, will try to follow this blog post

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

No branches or pull requests

2 participants