I’m trying to create an app using Streamlit and it is working fine locally but when I deploy the app on a server it is not showing the sidebar navigation and getting the error:
Page not found
You have requested page /closings, but no corresponding file was found in the app’s pages/ directory. Running the app’s main page.
My file structure is the docker container > main app > pages > 1_closing.py. I’m creating tabs and here is the sample code:
I’m not sure why it says page /closings but my file path is /docker/pages/closings.
It was a typo here while posting the issue but not in the actual file name therefore this is all set.
Can you please advise what else the issue could be? I’ve spent more than three days on this, but I’ve not found a solution yet, as it works locally but not on the server.
Did you check your file name? You also have “closing” in your filename vs “closings” in the href.
If it’s not that, can you link to your repo? Some small discrepancy like this can cause this, so it’d be best to see the source.
(As far as working locally but not the server, I’d double check that everything is fully synced. After that, the most common source of error is file path handling, but you are starting a new session by routing the URL instead on using a Python command, so I don’t see the usual problem of switching between Windows and Linux paths from the bit that I can see.)
As for the “s” in pages, that was my mistake. The expected error is “… requested page /closings…” (a reference to the URL pathname, not the file path). So I’m left with only the “s” after “closing” that might be missing in one spot.
Hi @mathcatsand, I’ve resolved the issue. The issue was not about the file naming but how the files were handled in Dockerfile where instead of including just the primary file, all python files should have been included. I’ll mark this resolved. Thank you very much!