Not displaying streamlit app with GCP Compute Engine VM

So I’m running into an issue when trying to run my streamlit application. I have two VM instances that I created on Google Cloud, and one will display my Streamlit app in the browser at the external URL, while the other one does not (it times out). For additional context, I’m using JupyterLab on both VMs, and running the script/testing via the terminal you can use in JupyterLab.

I’ve compared the specs of the two instances, and besides slightly different compute (one has marginally more cores/memory), I cannot find any differences in how the VMs are set-up. Additionally, I’m SSHing into each instance via my command line. I’m guessing that this has something to do with GCP, but would anybody have any idea where I should start looking to address this issue? Thanks!

Hey @jearnshaw, welcome back!

The first place I would start would be making sure that the networking/firewall rules are the same. Are the rules for the VM that doesn’t work the same, or can you make them the same?

Hey @randyzwitch, thanks for the response! I compared the VMs via their instance details side-by-side, and at first, there were no differences (apart from the slightly different machine type).

But then I check the Firewall config page, and there was a different rule, which turned out to be the culprit! I changed it and was able to run the streamlit script and access it at the external URL.

For future reference, the original VM had been set-up according to these instructions from Stanford’s CS231 class, and I set-up the other VM in a slightly different manner. However, about halfway down is a Configure Networking section, and after following along with that, I was able to address the issue.

1 Like

Yeah, that’s a pretty common scenario. Cloud providers tend to have public access turned off from the start, instead of enabled from the start, to keep people from accidentally releasing things they didn’t mean to.

Glad you got it figured out!

1 Like