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

No longer able to fetch manifest.json #20984

Open
jsaarija opened this issue Sep 6, 2024 · 2 comments
Open

No longer able to fetch manifest.json #20984

jsaarija opened this issue Sep 6, 2024 · 2 comments
Labels

Comments

@jsaarija
Copy link

jsaarija commented Sep 6, 2024

Explain what happens

I'm fetching manifest.json in my Cockpit package code according to related documentation:

fetch('./manifest.json')
    .then(response => {
        if (response.status === 200) {
            response.json().then((json: any) => {
                cockpitManifest = json;
                isInitialized = true;
                isInitializing = false;
            });
        } else {
            throw new Error('Failed downloading manifest.json');
        }
    });

This used to work fine in Cockpit 264 (Ubuntu 20.04.6 LTS) but now in 314 (Ubuntu 24.04.1 LTS) trying to fetch manifest.json fails with 404 and returns a "Not found" HTML page instead:

image

image

Fetching any other files from the same directory works fine with no issues whatsoever. Likewise fetching ../manifests.json or ../manifests.js work both just fine.

Is there something I'm possibly missing here, or has something broken or changed in fetching manifest.json files directly and possibly not reflected in the documentation?

Version of Cockpit

314

Where is the problem in Cockpit?

None

Server operating system

Ubuntu

Server operating system version

24.04.1 LTS

What browsers are you using?

Chrome

System log

Sep 06 16:26:08 local-ubuntu24 cockpit-tls[4412]: cockpit-tls: gnutls_handshake failed: A TLS fatal alert has been received.
Sep 06 16:26:08 local-ubuntu24 cockpit-tls[4412]: cockpit-tls: gnutls_handshake failed: A TLS fatal alert has been received.
Sep 06 16:26:08 local-ubuntu24 cockpit-tls[4412]: cockpit-tls: gnutls_handshake failed: A TLS fatal alert has been received.
Sep 06 16:26:09 local-ubuntu24 cockpit-tls[4412]: cockpit-tls: gnutls_handshake failed: A TLS fatal alert has been received.
Sep 06 16:26:09 local-ubuntu24 cockpit-tls[4412]: cockpit-tls: gnutls_handshake failed: A TLS fatal alert has been received.
Sep 06 16:26:09 local-ubuntu24 cockpit-tls[4412]: cockpit-tls: gnutls_handshake failed: A TLS fatal alert has been received.
Sep 06 16:26:09 local-ubuntu24 cockpit-tls[4412]: cockpit-tls: gnutls_handshake failed: A TLS fatal alert has been received.
Sep 06 16:26:09 local-ubuntu24 cockpit-tls[4412]: cockpit-tls: gnutls_handshake failed: A TLS fatal alert has been received.
Sep 06 16:26:09 local-ubuntu24 cockpit-tls[4412]: cockpit-tls: gnutls_handshake failed: A TLS fatal alert has been received.
Sep 06 16:26:09 local-ubuntu24 cockpit-tls[4412]: cockpit-tls: gnutls_handshake failed: A TLS fatal alert has been received.
Sep 06 16:26:09 local-ubuntu24 cockpit-tls[4412]: cockpit-tls: gnutls_handshake failed: A TLS fatal alert has been received.
Sep 06 16:26:09 local-ubuntu24 cockpit-tls[4412]: cockpit-tls: gnutls_handshake failed: A TLS fatal alert has been received.
Sep 06 16:26:09 local-ubuntu24 cockpit-tls[4412]: cockpit-tls: gnutls_handshake failed: A TLS fatal alert has been received.
Sep 06 16:26:09 local-ubuntu24 cockpit-tls[4412]: cockpit-tls: gnutls_handshake failed: A TLS fatal alert has been received.
Sep 06 16:26:09 local-ubuntu24 cockpit-tls[4412]: cockpit-tls: gnutls_handshake failed: A TLS fatal alert has been received.
Sep 06 16:26:09 local-ubuntu24 cockpit-tls[4412]: cockpit-tls: gnutls_handshake failed: A TLS fatal alert has been received.
Sep 06 16:26:09 local-ubuntu24 cockpit-tls[4412]: cockpit-tls: gnutls_handshake failed: A TLS fatal alert has been received.
Sep 06 16:26:09 local-ubuntu24 cockpit-tls[4412]: cockpit-tls: gnutls_handshake failed: A TLS fatal alert has been received.
Sep 06 16:26:10 local-ubuntu24 cockpit-tls[4412]: cockpit-tls: gnutls_handshake failed: A TLS fatal alert has been received.
Sep 06 16:26:10 local-ubuntu24 cockpit-tls[4412]: cockpit-tls: gnutls_handshake failed: A TLS fatal alert has been received.
Sep 06 16:26:13 local-ubuntu24 sudo[143474]: <user name> : TTY=pts/1 ; PWD=/home ; USER=root ; COMMAND=/usr/bin/journalctl --since -10m
Sep 06 16:26:13 local-ubuntu24 sudo[143474]: pam_unix(sudo:session): session opened for user root(uid=0) by <user name>(uid=1001)
@jsaarija jsaarija added the bug label Sep 6, 2024
@jelly
Copy link
Member

jelly commented Sep 9, 2024

What's the use case for fetching the manifest? If you have access to the window.cockpit object you can query the manifests there as window.cockpit.manifests.

The Python bridge removed manifest.json and replaced it with manifests.js.

@jsaarija
Copy link
Author

jsaarija commented Sep 9, 2024

In my use case I often have several copies of the same package installed in a Cockpit environment -- say, for example, that I have packages package-dev and package-prod in this case and they really only differentiate by the contents of their manifest.json file and the directory they're in. I've used the manifest file to have instance-specific attributes (such as a relevant backend server port number for either prod or dev) that each instance of the package has been able to read by just handily reading its own manifest.json file. Reading these same values from manifests.js (or manifests.json) does not seem to be very straightforward, though, as it seems there's no easy way for the package to know which manifest it actually needs to read when there's multiple copies of it installed in Cockpit.

This is a bit of legacy code from the earliest days of the package and these days the package code itself already reads a separate configuration JSON file for other use cases, so I believe I can just move the custom fields that are now in manifest.json to over there instead. However if this deprecation of loading the manifest.json directly is intended behavior then the documentation should probably be updated?

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

No branches or pull requests

2 participants