Troubleshooting Streamlit in Snowflake

The following scenarios can help you troubleshoot issues that can occur when working with Streamlit in Snowflake.

您无法连接到 Snowflake 后端

In some cases, browser extensions can make local network access (LNA) requests as part of normal operation. For example, a security extension may detect Streamlit in Snowflake’s cross-origin traffic and then make an LNA request. Chrome 142 introduced mandatory LNA restrictions. Because you can’t configure LNA at the extension level, you must either disable the extension or allow LNA for Snowsight. For more information about Chrome’s LNA restrictions, see New permission prompt for Local Network Access (https://developer.chrome.com/blog/local-network-access) in the Chrome for Developers blog.

ErrorUnable to connect to the Snowflake backend.
CauseA browser extension attempted to make a local network access (LNA) request that was blocked by Chrome’s LNA restrictions.
SolutionDisable the browser extension or allow LNA for Snowsight.

如果在完成以下步骤后问题仍然存在,请联系 Snowflake 支持团队:

  • 确认您正在使用最新版本的 Snowsight。
  • Verify that the “Local network access” permission is enabled for Snowsight. If you use an enterprise managed browser, contact your IT administrator.
  • 确认在暂时禁用所有扩展后,加载失败问题是否仍然存在。
  • Verify that load failures continue after disabling the Chrome flag via chrome://flags#local-network-access-check.

无法加载 Streamlit 应用程序

Each Streamlit app running in Streamlit in Snowflake uses a unique subdomain.

Ensure that *.snowflakeapp.cn and *.snowflake.cn are on the allowlist in your network (including content filtering systems), and can connect to Snowflake. When these domains are on the allowlist, your apps can communicate with Snowflake servers without any restrictions. However, in some cases adding these domains may not be sufficient due to network policies blocking subpaths under them. If this occurs, contact your network administrator.

此外,为防止连接到 Snowflake 后端出现任何问题,请确保网络配置中未阻止 WebSockets。

Error
Could not reload streamlit files.
Error: 092806 (P0002): The specified Streamlit was not found.
CauseThe Snowflake WebSocket connection cannot reach the endpoint associated with the application.
SolutionAdd *.snowflakeapp.cn to the allowlist on the organization’s firewall configuration.

您将无法查看数据或修改数据库

You might not be able to see your data or change the database, warehouse, or role because Streamlit apps run with owner’s rights by default, which means that they run with the privileges of the owner, not the privileges of the caller. Streamlit apps use the database and schema that the Streamlit in Snowflake app was created in, not the database and schema that the caller is currently using.

For more information, see Understanding owner’s rights and Streamlit in Snowflake apps. To run a container-runtime app with the viewer’s privileges instead, see Restricted caller’s rights and Streamlit in Snowflake.

Streamlit 库的功能无法正常使用

Ensure that the Streamlit library version and feature that you use are supported by Streamlit in Snowflake. For more information, see Supported versions of the Streamlit library in warehouse runtimes and Unsupported Streamlit features.

To ask questions on features in the open-source Streamlit library, see Streamlit Community Forum (https://discuss.streamlit.io/).