From 3d999fd6a31e9def312392434cc332f217054707 Mon Sep 17 00:00:00 2001 From: Suchintan Date: Wed, 3 Apr 2024 22:11:05 -0400 Subject: [PATCH] Better failure message in visualizer (#152) --- streamlit_app/visualizer/streamlit.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/streamlit_app/visualizer/streamlit.py b/streamlit_app/visualizer/streamlit.py index 3b2789f7..c94e47bb 100644 --- a/streamlit_app/visualizer/streamlit.py +++ b/streamlit_app/visualizer/streamlit.py @@ -259,13 +259,19 @@ with visualizer_tab: if type(tasks_response) is not list: st.error("Failed to fetch tasks.") st.error(tasks_response) - if "Organization not found" in str(tasks_response) or "Could not validate credentials" in str(tasks_response): - st.error("Please check the organization credentials in .streamlit/secrets.toml.") - st.error( - "You can validate the credentials against the postgresql credentials by running\n\n" - '`psql -U skyvern -h localhost -d skyvern -c "SELECT o.organization_id, o.organization_name, token FROM organizations o JOIN organization_auth_tokens oat ON oat.organization_id = o.organization_id;"`.' - "\n\n NOTE: There might be multiple organizations -- each run of ./setup.sh creates a new one. Pick your favourite!" - ) + st.error( + "#1 -- Make sure you have both the server (./run_skyvern.sh) and client (./run_ui.sh) running at the same time in different terminals." + ) + st.error( + "#2 -- If you're getting a credentials error, Make sure you have the correct organization credentials in .streamlit/secrets.toml." + ) + st.error( + "You can validate the credentials against the postgresql credentials by running\n\n" + '`psql -U skyvern -h localhost -d skyvern -c "SELECT o.organization_id, o.organization_name, token FROM organizations o JOIN organization_auth_tokens oat ON oat.organization_id = o.organization_id;"`.' + "\n\n NOTE: There might be multiple organizations -- each run of ./setup.sh creates a new one. Pick your favourite!" + "\n\n If you're running postgres via Docker, please make sure you wrap it in a docker exec command. " + "`docker exec postgresql-container psql -U skyvern -h localhost -d skyvern -c 'SELECT o.organization_id, o.organization_name, token FROM organizations o JOIN organization_auth_tokens oat ON oat.organization_id = o.organization_id;'`" + ) else: # Display tasks in sidebar for selection