404 Not found in any API REST Request

45 views
Skip to first unread message

Maria Julia Lima

unread,
Aug 21, 2017, 4:50:41 PM8/21/17
to Project Jupyter
Hi

Certainly, I should be doing something wrong, but I can not access the REST API of jupyterhub. I am using the version 0.7.2 and the following configuration:

c.Authenticator.admin_users = {'admin', 'mjulia'}
c.JupyterHub.api_tokens = {
    '057d0e5a8a1b4190895834c6ad6ec01f': 'admin',
}

I get 404 error when I try to call any API request. For example:

curl -H "Authorization: Token 057d0e5a8a1b4190895834c6ad6ec01f" -H "Content-Type: application/json" -XGET http://loc01/hub/api/


I am testing in my own machine.
Is there some missing configuration or am I doing something wrong?

Thanks in advance.

-- Julia

MinRK

unread,
Aug 22, 2017, 2:52:45 AM8/22/17
to Project Jupyter

You aren’t doing anything wrong, but the root /hub/api/ endpoint is new in 0.8. You’ll have to hit something like /hub/api/users in 0.7.2. You can use the 0.7.2 version of the REST API docs to make sure you don’t get misled.

-Min


--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/253cc9b4-4f9f-4183-965f-36cbdff2a906%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Maria Julia Lima

unread,
Aug 22, 2017, 8:38:17 AM8/22/17
to Project Jupyter
Hi, Min. Thanks for your reply.

I have tried the endpoints of 0.7.2, but the problem was the same. For example:

curl -H "Authorization: Token 057d0e5a8a1b4190895834c6ad6ec01f" -H "Content-Type: application/json" -XGET http://localhost:8001/hub/api/info


curl -H "Authorization: Token 057d0e5a8a1b4190895834c6ad6ec01f" -H "Content-Type: application/json" -XGET http://localhost:8001/hub/api/users



All the requests answers 404 Not Found error.


Is there anything else that I need to check? 

I am using my own customized Authenticator and the Docker Spawner, but I don't suppose that it could be the problem.


Julia


Em terça-feira, 22 de agosto de 2017 03:52:45 UTC-3, Min RK escreveu:

You aren’t doing anything wrong, but the root /hub/api/ endpoint is new in 0.8. You’ll have to hit something like /hub/api/users in 0.7.2. You can use the 0.7.2 version of the REST API docs to make sure you don’t get misled.

-Min

On Mon, Aug 21, 2017 at 10:50 PM, Maria Julia Lima <mjuli...@gmail.com> wrote:
Hi

Certainly, I should be doing something wrong, but I can not access the REST API of jupyterhub. I am using the version 0.7.2 and the following configuration:

c.Authenticator.admin_users = {'admin', 'mjulia'}
c.JupyterHub.api_tokens = {
    '057d0e5a8a1b4190895834c6ad6ec01f': 'admin',
}

I get 404 error when I try to call any API request. For example:

curl -H "Authorization: Token 057d0e5a8a1b4190895834c6ad6ec01f" -H "Content-Type: application/json" -XGET http://loc01/hub/api/


I am testing in my own machine.
Is there some missing configuration or am I doing something wrong?

Thanks in advance.

-- Julia

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.

MinRK

unread,
Aug 26, 2017, 8:34:46 PM8/26/17
to Project Jupyter
On Tue, Aug 22, 2017 at 8:38 AM, Maria Julia Lima <mjuli...@gmail.com> wrote:
Hi, Min. Thanks for your reply.

I have tried the endpoints of 0.7.2, but the problem was the same. For example:

curl -H "Authorization: Token 057d0e5a8a1b4190895834c6ad6ec01f" -H "Content-Type: application/json" -XGET http://localhost:8001/hub/api/info


curl -H "Authorization: Token 057d0e5a8a1b4190895834c6ad6ec01f" -H "Content-Type: application/json" -XGET http://localhost:8001/hub/api/users



All the requests answers 404 Not Found error.


Is there anything else that I need to check? 

It looks like you are hitting port 8001. This is typically the internal API port of the proxy, not the Hub, so I would expect 404 there. Have you tried accessing port 8000, or the public port of the proxy if you have changed it with `JupyterHub.port`? You can also access the Hub at port 8081, if the default ports are in use.

-Min
 
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.

To post to this group, send email to jup...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages