-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Gradio static files do not follow the root_path behind a Jupyter proxy on k8s #7317
Comments
@louisbrulenaudet could you please try installing this version of
|
@abidlabs Does it make sense that 3.50.2 had no k8 issue but 4.16+ does. But only 4.18.0 had the reverse proxy issue. I'm worried that the PR solved the recent regression from 4.17.0->4.18.0, but not this one. |
To be honest I'm not totally sure. I have not tested on a k8 cluster. However, I did fix an issue related to |
Hi @abidlabs, @pseudotensor, First of all, I'd like to thank you for your help. I've just tried version 4.19.0 released today and the problem persists. Looking through the element inspector, it turns out that the index.css and theme.css files don't have the right path. These are respectively :
The code remains the same. I remain at your disposal for further investigations and thank you in advance for your help. Yours sincerely |
Ok reopening this issue and looking into it! |
@abidlabs - Any updates? Currently i need to stay on 4.16. The error came with 4.18. |
Hi folks, looking into this issue. First of all, could someone test with the latest version of
and let me know if the issue persists? We've made some fixes to how the root path is resolved, although I suspect it might not be a complete fix just yet. |
@abidlabs - is it the same like 4.20.1 on PyPi? I used this just now as it's easier to deploy. Result is as shown in the picture. |
@skye0402 they're actually different versions. There's a fix to the root url on Can I ask, what is the correct url for your gradio app? I.e. what url is it being served on, if not https://apascalingtest-service:8020? |
@abidlabs thank you for working on this! I have used the link you provided and rebuilt the image just to be sure I don't miss anything. Indeed, it is unchanged, please see the screenshot. Url of the app is https://scalingtest.c-290ae5b.kyma.shoot.live.k8s-hana.ondemand.com - it runs behind an approuter, so a pod accepts the request from the above url and forwards it to the pod that runs the gradio app. That pod has that internal hostname that you saw from the screenshot (https://apascalingtest-service:8020/) - all of that works wonderfully until 4.16/4.17. |
Thanks @skye0402 for the details! Can you tell us a bit more about this approuter? What library / framework are you using? Trying to understand what could cause this issue. One workaround we could do is to let users manually specify the full The problem, of course, is that if your URL changes, you'd have to reset the parameter / env variable. Just wondering, would this be useful for your use case? Same question for you: @pseudotensor @louisbrulenaudet |
One other request, please: could you try installing And then visit your Gradio app, and look at the logs that are printed to the terminal on the machine running the Gradio app? I've added a few lines that should print something like:
and can you tell me what you see? |
@abidlabs certainly! The approuter is https://www.npmjs.com/package/@sap/approuter Here is the result using the gradio with logging:
I'm not an expert but I think this looks promising! 😃
... meaning every 3 lines are output when refreshing the page from the browser. |
Thanks @skye0402 this is very helpful, and we should be able to issue a fix using the |
@skye0402 (or @pseudotensor @louisbrulenaudet) would you be able to try the PR again and let me know if Gradio apps are working for you now? You can install:
|
@abidlabs Magnificent! That's a job well done (and I can upgrade to latest Gradio soon). Below is the same app as screenshot like before (but working this time). Thank you very much! |
Thanks for all your help! |
I still have this problem on version 4.44.1. If I set [...]
<script type="module" crossorigin src="./assets/index-df998e04.js"></script>
<link rel="stylesheet" href="./assets/index-1ebe9c14.css"> |
Describe the bug
Hi everyone,
I am experiencing a problem when running Gradio 4.16.0 behind a Jupyter proxy on a k8s cluster specifying a root_path, static files do not follow this path and my browser console returns a 404 error.
Below is the code:
The link is still accessible and the components can be viewed without style.
Thank you in advance, I remain at your disposal for any clarification.
Best regards,
Louis
Have you searched existing issues? 🔎
Reproduction
Screenshot
No response
Logs
No response
System Info
Severity
Blocking usage of gradio
The text was updated successfully, but these errors were encountered: