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

Examples check is failing on CI #15985

Closed
jtpio opened this issue Mar 13, 2024 · 6 comments
Closed

Examples check is failing on CI #15985

jtpio opened this issue Mar 13, 2024 · 6 comments
Labels
maintenance status:Needs Triage Applied to new issues that need triage

Comments

@jtpio
Copy link
Member

jtpio commented Mar 13, 2024

As noticed on main with the last commit (80dd3d6): https://github.com/jupyterlab/jupyterlab/actions/runs/8262290798/job/22601316208

And recent PRs.

image

@jupyterlab-probot jupyterlab-probot bot added the status:Needs Triage Applied to new issues that need triage label Mar 13, 2024
@krassowski
Copy link
Member

The relevant part of the traceback is:

debug >> Example started!
[I 2024-03-12 17:27:02.093 ServerApp] Writing notebook-signing key to /tmp/tmpma4b4tfw/jupyter_data/notebook_secret
[E 2024-03-12 17:27:02.093 ServerApp] Uncaught exception GET /foo/api/contents/test.ipynb?type=notebook&content=1&hash=1&1710264422047 (::1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/foo/api/contents/test.ipynb?type=notebook&content=1&hash=1&1710264422047', version='HTTP/1.1', remote_ip='::1')
    Traceback (most recent call last):
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/traitlets/traitlets.py", line 632, in get
        value = obj._trait_values[self.name]
                ~~~~~~~~~~~~~~~~~^^^^^^^^^^^
    KeyError: 'secret'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/tornado/web.py", line 1790, in _execute
        result = await result
                 ^^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/jupyter_server/auth/decorator.py", line 73, in inner
        return await out
               ^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/jupyter_server/services/contents/handlers.py", line 153, in get
        model = await ensure_async(
                ^^^^^^^^^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/jupyter_core/utils/__init__.py", line 198, in ensure_async
        result = await obj
                 ^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/jupyter_server/services/contents/filemanager.py", line 918, in get
        model = await self._notebook_model(path, content=content, require_hash=require_hash)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/jupyter_server/services/contents/filemanager.py", line 867, in _notebook_model
        self.mark_trusted_cells(nb, path)
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/jupyter_server/services/contents/manager.py", line 738, in mark_trusted_cells
        trusted = self.notary.check_signature(nb)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/nbformat/sign.py", line 461, in check_signature
        signature = self.compute_signature(nb)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/nbformat/sign.py", line 436, in compute_signature
        hmac = HMAC(self.secret, digestmod=self.digestmod)
                    ^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/traitlets/traitlets.py", line 687, in __get__
        return t.cast(G, self.get(obj, cls))  # the G should encode the Optional
                         ^^^^^^^^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/traitlets/traitlets.py", line 635, in get
        default = obj.trait_defaults(self.name)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/traitlets/traitlets.py", line 1897, in trait_defaults
        return t.cast(Sentinel, self._get_trait_default_generator(names[0])(self))
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/traitlets/traitlets.py", line 1241, in __call__
        return self.func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/nbformat/sign.py", line 412, in _secret_default
        self._write_secret_file(secret)
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/nbformat/sign.py", line 423, in _write_secret_file
        with Path(self.secret_file).open("wb") as f:
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/pathlib.py", line 1044, in open
        return io.open(self, mode, buffering, encoding, errors, newline)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpma4b4tfw/jupyter_data/notebook_secret'
Uncaught exception %s
%r
[W 2024-03-12 17:27:02.100 ServerApp] wrote error: 'Unhandled error'
    Traceback (most recent call last):
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/traitlets/traitlets.py", line 632, in get
        value = obj._trait_values[self.name]
                ~~~~~~~~~~~~~~~~~^^^^^^^^^^^
    KeyError: 'secret'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/tornado/web.py", line 1790, in _execute
        result = await result
                 ^^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/jupyter_server/auth/decorator.py", line 73, in inner
        return await out
               ^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/jupyter_server/services/contents/handlers.py", line 153, in get
        model = await ensure_async(
                ^^^^^^^^^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/jupyter_core/utils/__init__.py", line 198, in ensure_async
        result = await obj
                 ^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/jupyter_server/services/contents/filemanager.py", line 918, in get
        model = await self._notebook_model(path, content=content, require_hash=require_hash)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/jupyter_server/services/contents/filemanager.py", line 867, in _notebook_model
        self.mark_trusted_cells(nb, path)
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/jupyter_server/services/contents/manager.py", line 738, in mark_trusted_cells
        trusted = self.notary.check_signature(nb)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/nbformat/sign.py", line 461, in check_signature
        signature = self.compute_signature(nb)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/nbformat/sign.py", line 436, in compute_signature
        hmac = HMAC(self.secret, digestmod=self.digestmod)
                    ^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/traitlets/traitlets.py", line 687, in __get__
        return t.cast(G, self.get(obj, cls))  # the G should encode the Optional
                         ^^^^^^^^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/traitlets/traitlets.py", line 635, in get
        default = obj.trait_defaults(self.name)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/traitlets/traitlets.py", line 1897, in trait_defaults
        return t.cast(Sentinel, self._get_trait_default_generator(names[0])(self))
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/traitlets/traitlets.py", line 1241, in __call__
        return self.func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/nbformat/sign.py", line 412, in _secret_default
        self._write_secret_file(secret)
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/nbformat/sign.py", line 423, in _write_secret_file
        with Path(self.secret_file).open("wb") as f:
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/pathlib.py", line 1044, in open
        return io.open(self, mode, buffering, encoding, errors, newline)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpma4b4tfw/jupyter_data/notebook_secret'
[E 2024-03-12 17:27:02.102 ServerApp] {
      "Host": "localhost:8888",
      "Accept": "*/*",
      "Referer": "http://localhost:8888/foo/example",
      "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/123.0.6312.4 Safari/537.36"
    }
{
  "Host": "localhost:8888",
  "Accept": "*/*",
  "Referer": "http://localhost:8888/foo/example",
  "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/123.0.6312.4 Safari/537.36"
}
[E 2024-03-12 17:27:02.102 ServerApp] 500 GET /foo/api/contents/test.ipynb?type=notebook&content=1&hash=1&1710264422047 (affba61e0f4347858d83cb5775507[974](https://github.com/jupyterlab/jupyterlab/actions/runs/8252979379/job/22573776621#step:6:975)@::1) 52.88ms referer=http://localhost:8888/foo/example
500 GET /foo/api/contents/test.ipynb?type=notebook&content=1&hash=1&17[1026](https://github.com/jupyterlab/jupyterlab/actions/runs/8252979379/job/22573776621#step:6:1027)4422047 (affba61e0f4347858d83cb5775507974@::1) 52.88ms referer=http://localhost:8888/foo/example
error >> Failed to load resource: the server responded with a status of 500 (Internal Server Error)
warning >> Showing error: Error: Unhandled error
    at ResponseError.create (http://localhost:8888/foo/static/__main__/bundle.js:130268:24)
    at async Drive.get (http://localhost:8888/foo/static/__main__/bundle.js:125862:25)
    at async Context.initialize (http://localhost:8888/foo/static/__main__/bundle.js:107651:13)
error >> Failed to initialize the context with 'notebook' for test.ipynb Error: Unhandled error
    at ResponseError.create (http://localhost:8888/foo/static/__main__/bundle.js:130268:24)
    at async Drive.get (http://localhost:8888/foo/static/__main__/bundle.js:125862:25)
    at async Context.initialize (http://localhost:8888/foo/static/__main__/bundle.js:107651:13)
F

  1) example.spec.ts:12:5 › should load the example ────────────────────────────────────────────────

    Error: Screenshot comparison failed:

      759137 pixels (ratio 0.83 of all image pixels) are different.

    Expected: /opt/hostedtoolcache/Python/3.11.8/x64/share/jupyter/lab/example_test/example.spec.ts-snapshots/example-linux.png
    Received: /opt/hostedtoolcache/Python/3.11.8/x64/share/jupyter/lab/example_test/test-results/example-should-load-the-example/example-actual.png
        Diff: /opt/hostedtoolcache/Python/3.11.8/x64/share/jupyter/lab/example_test/test-results/example-should-load-the-example/example-diff.png


      55 |         })
      56 |       )
    > 57 |       .toMatchSnapshot('example.png');
         |        ^
      58 |   }
      59 |
      60 |   expect(errorLogs).toEqual(0);

        at /opt/hostedtoolcache/Python/3.11.8/x64/share/jupyter/lab/example_test/example.spec.ts:57:8

    Error: expect(received).toEqual(expected) // deep equality

    Expected: 0
    Received: 2

      58 |   }
      59 |
    > 60 |   expect(errorLogs).toEqual(0);
         |                     ^
      61 | });
      62 |

        at /opt/hostedtoolcache/Python/3.11.8/x64/share/jupyter/lab/example_test/example.spec.ts:60:21

    attachment #1: example-expected.png (image/png) ────────────────────────────────────────────────
    example.spec.ts-snapshots/example-linux.png
    ────────────────────────────────────────────────────────────────────────────────────────────────

    attachment #2: example-actual.png (image/png) ──────────────────────────────────────────────────
    test-results/example-should-load-the-example/example-actual.png
    ────────────────────────────────────────────────────────────────────────────────────────────────

    attachment #3: example-diff.png (image/png) ────────────────────────────────────────────────────
    test-results/example-should-load-the-example/example-diff.png
    ────────────────────────────────────────────────────────────────────────────────────────────────

  1 failed
    example.spec.ts:12:5 › should load the example ─────────────────────────────────────────────────
[C 2024-03-12 17:27:04.094 ServerApp] Caught exception during the test:
Caught exception during the test:
[E 2024-03-12 17:27:04.094 ServerApp] ['npx', 'playwright', 'test'] exited with 1
['npx', 'playwright', 'test'] exited with 1
[I 2024-03-12 17:27:04.094 ServerApp] Test Complete
[C 2024-03-12 17:27:04.094 ServerApp] Exiting with 1 due to errors
Exiting with 1 due to errors

@krassowski
Copy link
Member

Also failed in the same way in https://github.com/jupyterlab/jupyterlab/actions/runs/8252979379/job/22573776621 which was a bit earlier - after merge of #15892, but on the PR it was passing.

@krassowski
Copy link
Member

It's hard to narrow down what is the faulty change in dependencies because there were lots of releases yesterday:

664c647
<   Downloading jupyter_core-5.7.1-py3-none-any.whl.metadata (3.4 kB)
---
>   Downloading jupyter_core-5.7.2-py3-none-any.whl.metadata (3.4 kB)
670c653
<   Downloading jupyterlab_server-2.25.3-py3-none-any.whl.metadata (5.9 kB)
---
>   Downloading jupyterlab_server-2.25.4-py3-none-any.whl.metadata (5.9 kB)
678c661
<   Downloading traitlets-5.14.1-py3-none-any.whl.metadata (10 kB)
---
>   Downloading traitlets-5.14.2-py3-none-any.whl.metadata (10 kB)
686c669
<   Using cached hatch-1.9.3-py3-none-any.whl.metadata (5.2 kB)
---
>   Using cached hatch-1.9.4-py3-none-any.whl.metadata (5.2 kB)
694c677
<   Downloading pytest_check_links-0.9.2-py3-none-any.whl.metadata (7.0 kB)
---
>   Downloading pytest_check_links-0.9.3-py3-none-any.whl.metadata (7.0 kB)
698c681
<   Downloading pytest_jupyter-0.9.0-py3-none-any.whl.metadata (9.3 kB)
---
>   Downloading pytest_jupyter-0.9.1-py3-none-any.whl.metadata (9.3 kB)
728c711
<   Downloading jupyter_client-8.6.0-py3-none-any.whl.metadata (8.3 kB)
---
>   Downloading jupyter_client-8.6.1-py3-none-any.whl.metadata (8.3 kB)
730c713
<   Downloading jupyter_events-0.9.0-py3-none-any.whl.metadata (5.7 kB)
---
>   Downloading jupyter_events-0.9.1-py3-none-any.whl.metadata (5.7 kB)
732c715
<   Downloading jupyter_server_terminals-0.5.2-py3-none-any.whl.metadata (5.6 kB)
---
>   Downloading jupyter_server_terminals-0.5.3-py3-none-any.whl.metadata (5.6 kB)
736c719
<   Downloading nbformat-5.9.2-py3-none-any.whl.metadata (3.4 kB)
---
>   Downloading nbformat-5.10.2-py3-none-any.whl.metadata (3.6 kB)
746c729
<   Downloading terminado-0.18.0-py3-none-any.whl.metadata (5.8 kB)
---
>   Downloading terminado-0.18.1-py3-none-any.whl.metadata (5.8 kB)
775c758
< Collecting hatchling>=1.21.0 (from hatch->jupyterlab==4.2.0a0)
---
> Collecting hatchling<1.22 (from hatch->jupyterlab==4.2.0a0)
800c783
<   Downloading comm-0.2.1-py3-none-any.whl.metadata (3.7 kB)
---
>   Downloading comm-0.2.2-py3-none-any.whl.metadata (3.7 kB)
825c808
< Collecting editables>=0.3 (from hatchling>=1.21.0->hatch->jupyterlab==4.2.0a0)
---
> Collecting editables>=0.3 (from hatchling<1.22->hatch->jupyterlab==4.2.0a0)
827c810
< Collecting pathspec>=0.10.1 (from hatchling>=1.21.0->hatch->jupyterlab==4.2.0a0)
---
> Collecting pathspec>=0.10.1 (from hatchling<1.22->hatch->jupyterlab==4.2.0a0)
829c812
< Collecting trove-classifiers (from hatchling>=1.21.0->hatch->jupyterlab==4.2.0a0)
---
> Collecting trove-classifiers (from hatchling<1.22->hatch->jupyterlab==4.2.0a0)
874c857
<   Downloading nbclient-0.9.0-py3-none-any.whl.metadata (7.8 kB)
---
>   Downloading nbclient-0.9.1-py3-none-any.whl.metadata (7.8 kB)

@krassowski
Copy link
Member

Ok, I see a plausible candidate is nbformat it jumped from 5.9.2 to 5.10.2 because the versions in the middle were not published. The nominal 5.10.0 version (https://github.com/jupyter/nbformat/blob/main/CHANGELOG.md#5100) included jupyter/nbformat#378 which might be the source of the error.

@krassowski
Copy link
Member

I opened jupyter/nbformat#396.

@krassowski
Copy link
Member

Closing as fixed with https://github.com/jupyter/nbformat/releases/tag/v5.10.3 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance status:Needs Triage Applied to new issues that need triage
Projects
None yet
Development

No branches or pull requests

2 participants