Hiding tracebacks and errors doesn't work!

Summary

When showErrorDetails = false in the configuration file, the expected behaviour is to hide the tracebacks and show a generic error. This is not what is happening at the moment where only the summary of the error message gets obfuscated.

For example I am trying to access GPT 4 via the API, from an account that does not have access to it. With showErrorDetails = false I get back:

openai.error.InvalidRequestError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you're on Streamlit Cloud, click on 'Manage app' in the lower right of your app).

Traceback:

... Full traceback...

Any idea how I can stop this behaviour and hide all details being shown, including the type of error, eg. the openai.error.InvalidRequestError? Showing the traceback is very risky in a prod environment, especially for client-facing apps.

Debug info

  • Streamlit version: 1.25.0
  • Python version: 3.10.4
  • PyEnv & Poetry
  • OS version: MacOS 13.4.1 (22F82)
  • Browser version: Chrome 114.0.5735.198

Requirements file

python = “3.10.4”
streamlit = “^1.25.0”
openai = “^0.27.9”
streamlit-chat = “^0.1.1”
python-dotenv = “^1.0.0”
boto3 = “^1.28.36”
extra-streamlit-components = “^0.1.60”

Hey please check out this thread of StreamLit Github issue
Issue4519
This should solve your problem

Thanks! It seems like there is no official solution yet to this issue, but at least it’s recognised as a bug. Fingers crossed we will have a fix soon.

Ah yes, will update you if I get to know anything

this code work’s for me :

not showing traceback

try:
sql = “call upsert_transac(%s,%s,%s,%s,%s)”
val = (pilih[0],pilih[1],pilih[3],tmpjml,st.session_state[‘hantu’])
mycursor.execute(sql,val)
mydb.commit()
st.info(“Success”)
except KeyError:
st.error(‘baiklah’)
except Exception as e:
st.error(f"mainkan: {e}")

read from store procedure

image

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.