# Weird version info when calling hub info endpoint

**URL:** <https://discourse.jupyter.org/t/weird-version-info-when-calling-hub-info-endpoint/33305>\
**Category:** JupyterHub\
**Created:** [February 27, 2025, 6:03pm UTC](https://discourse.jupyter.org/t/weird-version-info-when-calling-hub-info-endpoint/33305 "2025-02-27T18:03:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mindtoeye](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/mindtoeye/32/9588_2.png) [@Mindtoeye](https://discourse.jupyter.org/u/Mindtoeye)\
**Post date:** [February 27, 2025, 6:03pm UTC](https://discourse.jupyter.org/t/weird-version-info-when-calling-hub-info-endpoint/33305/1 "2025-02-27T18:03:29Z")

</div>

For reasons we’re using jupyter hub 4.0.2 (for now, upgrading very soon). I can confirm this by running:

`docker images`

Which gives me:

`jupyterhub/jupyterhub 4.0.2 50546f1e39c8 18 months ago 330MB`

However, when I call the info endpoint: /hub/api/info on the container that was created from that image I get this:

```auto
{
  "version": "5.2.1"
}

```

It is extremely likely I’m doing something wrong, but it would be really helpful if someone can help me figure how where the mismatch is happening.

---

<div class="post-metadata">

**Author:** ![manics](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/manics/32/85_2.png) [@manics](https://discourse.jupyter.org/u/manics)\
**Post date:** [February 27, 2025, 7:05pm UTC](https://discourse.jupyter.org/t/weird-version-info-when-calling-hub-info-endpoint/33305/2 "2025-02-27T19:05:14Z")

</div>

It looks fine to me:

`podman run -it --rm -p8000:8000 jupyterhub/jupyterhub:4.0.2 jupyterhub --JupyterHub.authenticator_class=dummy --JupyterHub.spawner_class=simple --Authenticator.admin_users=test`

Login as `test`, create a token, make an API call:  
`curl -H'Authorization: Bearer TOKEN' http://localhost:8000/hub/api/info`

```json
{"version": "4.0.2", "python": "3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0]", "sys_executable": "/usr/bin/python3", "spawner": {"class": "jupyterhub.spawner.SimpleLocalProcessSpawner", "version": "4.0.2"}, "authenticator": {"class": "jupyterhub.auth.DummyAuthenticator", "version": "4.0.2"}}

```

Are you sure you’re not running something else?

---

<div class="post-metadata">

**Author:** ![Mindtoeye](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/mindtoeye/32/9588_2.png) [@Mindtoeye](https://discourse.jupyter.org/u/Mindtoeye)\
**Post date:** [February 27, 2025, 7:30pm UTC](https://discourse.jupyter.org/t/weird-version-info-when-calling-hub-info-endpoint/33305/3 "2025-02-27T19:30:00Z")

</div>

I think I’m one step closer to why this is happening. Not sure how to fix it.

We use a custom Dockerfile for the hub. In that file we start with:

`FROM jupyterhub/jupyterhub:4.0.2`

The offending line seems to be:

`RUN python3 -m pip install --no-cache-dir dockerspawner`

This action has as a side-effect that it installs the latest jupyterhub code and will uninstall all of the 4.0.2 version code.

Is there any way I can lock down my dockerspawner version and ideally one that matches the hub 4.0.2 version?

---

<div class="post-metadata">

**Author:** ![minrk](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/minrk/32/13_2.png) [@minrk](https://discourse.jupyter.org/u/minrk)\
**Post date:** [March 4, 2025, 9:40am UTC](https://discourse.jupyter.org/t/weird-version-info-when-calling-hub-info-endpoint/33305/4 "2025-03-04T09:40:54Z")

</div>

Are you sure you don’t have `--upgrade` anywhere in your pip install args, env, or config? Because the dockerfile:

```docker
FROM jupyterhub/jupyterhub:4.0.2
RUN python3 -m pip install --no-cache-dir dockerspawner

```

does not result in upgrading jupyterhub. But adding `--upgrade` to that would.

You can _enforce_ that no packages are upgraded by applying a [constraints file](https://pip.pypa.io/en/stable/user_guide/#constraints-files), created from the packages already installed:

```dockerfile
FROM jupyterhub/jupyterhub:4.0.2
RUN pip list --format=freeze > /tmp/freeze.txt \
 && pip install --constraint /tmp/freeze.txt --no-cache-dir dockerspawner \
 && rm /tmp/freeze.txt

```

but this does not (today) result in any change from the first example.

---

<div class="post-metadata">

**Author:** ![Mindtoeye](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/mindtoeye/32/9588_2.png) [@Mindtoeye](https://discourse.jupyter.org/u/Mindtoeye)\
**Post date:** [March 4, 2025, 12:23pm UTC](https://discourse.jupyter.org/t/weird-version-info-when-calling-hub-info-endpoint/33305/5 "2025-03-04T12:23:55Z")

</div>

This is the content of my Dockerfile:

```auto
FROM jupyterhub/jupyterhub:4.0.2

# hadolint ignore=DL3013
RUN python3 -m pip install --no-cache-dir \
    jupyter-cjk-xelatex \
    dockerspawner \
    jupyterhub-nativeauthenticator \
    jupyterhub-jwtauthenticator \
    jupyterhub-dummyauthenticator       

ADD jupyterhub_config.py /srv/jupyterhub/

ADD jwtauthenticator.py /usr/local/lib/python3.10/dist-packages/jwtauthenticator/

CMD ["jupyterhub", "-f", "/srv/jupyterhub/jupyterhub_config.py"]

```

---

<div class="post-metadata">

**Author:** ![mahendrapaipuri](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/mahendrapaipuri/32/6800_2.png) [@mahendrapaipuri](https://discourse.jupyter.org/u/mahendrapaipuri)\
**Post date:** [March 4, 2025, 12:54pm UTC](https://discourse.jupyter.org/t/weird-version-info-when-calling-hub-info-endpoint/33305/6 "2025-03-04T12:54:18Z")

</div>

This comes from [nativeauthenticator](https://github.com/jupyterhub/nativeauthenticator/blob/f800bd3190b6b2cb71f17d11d11b98c314cb53b5/setup.py#L30) which requires JupyterHub \>= 4.1.x. So, it upgrades your JupyterHub to 5.x I assume. Pinning `nativeautentictor` to [v.1.20](https://github.com/jupyterhub/nativeauthenticator/tree/1.2.0) should fix the issue!

---

<div class="post-metadata">

**Author:** ![Mindtoeye](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/mindtoeye/32/9588_2.png) [@Mindtoeye](https://discourse.jupyter.org/u/Mindtoeye)\
**Post date:** [March 4, 2025, 1:01pm UTC](https://discourse.jupyter.org/t/weird-version-info-when-calling-hub-info-endpoint/33305/7 "2025-03-04T13:01:59Z")

</div>

Can confirm! I’m getting the correct version now. Thanks!
