Error: Runtime instance already exists

Hi,

I am getting a problem when I am trying to deploy my app onto the cloud. Below I am sending you the necessary information. Thanks in advance!

  1. Are you running your app locally or is it deployed? It is deployed
  2. If your app is deployed:
    a. Is it deployed on Community Cloud or another hosting platform? streamlit.io
    b. Share the link to the public deployed app. https://blastuialessandro201-9crcntwmesn7zuyndq8dry.streamlit.app/
  3. Share the link to your app’s public GitHub repository (including a requirements file) GitHub - kostasgalexiou/BlastUI_Alessandro201
  4. Error message:
2023-11-15 08:01:41.503 Uncaught app exception

Traceback (most recent call last):

  File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script

    exec(code, module.__dict__)

  File "/mount/src/blastui_alessandro201/src/run_app.py", line 51, in <module>

    run_streamlit('Home.py', 'streamlit run')

  File "/mount/src/blastui_alessandro201/src/run_app.py", line 27, in run_streamlit

    bootstrap.run(file, command_line, args, flag_options)

  File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/web/bootstrap.py", line 414, in run

    server = Server(main_script_path, command_line)

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/web/server/server.py", line 232, in __init__

    self._runtime = Runtime(

                    ^^^^^^^^

  File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/runtime.py", line 175, in __init__

    raise RuntimeError("Runtime instance already exists!")

RuntimeError: Runtime instance already exists!

2023-11-15 08:02:03.149 MediaFileHandler: Missing file dccee41a13634d8a01d705ee46624e2d7f18b4875ca649dab04e09ae.png

2023-11-15 08:02:03.150 MediaFileHandler: Missing file 30836f9f2f890a84636d4c3148d36d9f8cfab781223ab77b4f8138de.jpg

2023-11-15 08:02:03.151 MediaFileHandler: Missing file 1e7183cdabf792e926d8a736ba0b4fdd0c063144a891944d91cc4b1c.png

2023-11-15 08:02:03.151 MediaFileHandler: Missing file de8e7af6188de4a93947fd25eddd08fb2f1ce67c1a1dff398790816e.png

2023-11-15 08:02:03.160 MediaFileHandler: Missing file 01b3c12197b3faf84ae45e3f90a70f684953f7a11f6b926d944c566d.png

2023-11-15 08:02:03.167 MediaFileHandler: Missing file 2ef21535e4057f832f8702d1d2692a17b6c8509d13a49fd89e431d83.png

Checking blast...


Collecting usage statistics. To deactivate, set browser.gatherUsageStats to False.


2023-11-15 08:02:14.711 Uncaught app exception

Traceback (most recent call last):

  File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script

    exec(code, module.__dict__)

  File "/mount/src/blastui_alessandro201/src/run_app.py", line 51, in <module>

    run_streamlit('Home.py', 'streamlit run')

  File "/mount/src/blastui_alessandro201/src/run_app.py", line 27, in run_streamlit

    bootstrap.run(file, command_line, args, flag_options)

  File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/web/bootstrap.py", line 414, in run

    server = Server(main_script_path, command_line)

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/web/server/server.py", line 232, in __init__

    self._runtime = Runtime(

                    ^^^^^^^^

  File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/runtime.py", line 175, in __init__

    raise RuntimeError("Runtime instance already exists!")

RuntimeError: Runtime instance already exists!

2023-11-15 08:03:03.132 Uncaught app exception

Traceback (most recent call last):

  File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script

    exec(code, module.__dict__)

  File "/mount/src/blastui_alessandro201/src/pages/1 Manage Databases.py", line 252, in <module>

    main()

  File "/mount/src/blastui_alessandro201/src/pages/1 Manage Databases.py", line 83, in main

    switch_page('Home')

  File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/metrics_util.py", line 396, in wrapped_func

    result = non_optional_func(*args, **kwargs)

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit_extras/switch_page_button/__init__.py", line 35, in switch_page

    raise ValueError(f"Could not find page {page_name}. Must be one of {page_names}")

ValueError: Could not find page home. Must be one of ['run app', 'manage databases', 'blast query', 'results', 'analysis', 'help']

2023-11-15 08:04:03.469 Uncaught app exception

Traceback (most recent call last):

  File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script

    exec(code, module.__dict__)

  File "/mount/src/blastui_alessandro201/src/pages/2 Blast Query.py", line 803, in <module>

    main()

  File "/mount/src/blastui_alessandro201/src/pages/2 Blast Query.py", line 584, in main

    switch_page('Home')

  File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/metrics_util.py", line 396, in wrapped_func

    result = non_optional_func(*args, **kwargs)

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit_extras/switch_page_button/__init__.py", line 35, in switch_page

    raise ValueError(f"Could not find page {page_name}. Must be one of {page_names}")

ValueError: Could not find page home. Must be one of ['run app', 'manage databases', 'blast query', 'results', 'analysis', 'help']

2023-11-15 08:04:09.003 Uncaught app exception

Traceback (most recent call last):

  File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script

    exec(code, module.__dict__)

  File "/mount/src/blastui_alessandro201/src/pages/2 Blast Query.py", line 803, in <module>

    main()

  File "/mount/src/blastui_alessandro201/src/pages/2 Blast Query.py", line 584, in main

    switch_page('Home')

  File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/metrics_util.py", line 396, in wrapped_func

    result = non_optional_func(*args, **kwargs)

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit_extras/switch_page_button/__init__.py", line 35, in switch_page

    raise ValueError(f"Could not find page {page_name}. Must be one of {page_names}")

ValueError: Could not find page home. Must be one of ['run app', 'manage databases', 'blast query', 'results', 'analysis', 'help']


Collecting usage statistics. To deactivate, set browser.gatherUsageStats to False.


2023-11-15 08:05:31.992 Uncaught app exception

Traceback (most recent call last):

  File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script

    exec(code, module.__dict__)

  File "/mount/src/blastui_alessandro201/src/run_app.py", line 51, in <module>

    run_streamlit('Home.py', 'streamlit run')

  File "/mount/src/blastui_alessandro201/src/run_app.py", line 27, in run_streamlit

    bootstrap.run(file, command_line, args, flag_options)

  File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/web/bootstrap.py", line 414, in run

    server = Server(main_script_path, command_line)

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/web/server/server.py", line 232, in __init__

    self._runtime = Runtime(

                    ^^^^^^^^

  File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/runtime.py", line 175, in __init__

    raise RuntimeError("Runtime instance already exists!")

RuntimeError: Runtime instance already exists!


Collecting usage statistics. To deactivate, set browser.gatherUsageStats to False.


2023-11-15 10:22:57.380 Uncaught app exception

Traceback (most recent call last):

  File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script

    exec(code, module.__dict__)

  File "/mount/src/blastui_alessandro201/src/run_app.py", line 51, in <module>

    run_streamlit('Home.py', 'streamlit run')

  File "/mount/src/blastui_alessandro201/src/run_app.py", line 27, in run_streamlit

    bootstrap.run(file, command_line, args, flag_options)

  File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/web/bootstrap.py", line 414, in run

    server = Server(main_script_path, command_line)

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/web/server/server.py", line 232, in __init__

    self._runtime = Runtime(

                    ^^^^^^^^

  File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/runtime.py", line 175, in __init__

    raise RuntimeError("Runtime instance already exists!")

RuntimeError: Runtime instance already exists!
  1. Share the Streamlit and Python versions: streamlit==1.28.0, python3.11

You cannot call streamlit.web.bootstrap.run from within a streamlit application.

Hi @Goyo,

Thank you for your quick reply. I am quite new in the streamlit world. Could you elaborate on how can I make my app run without this error?

Thanks

I guess your “Main file path” should be Home.py and you set it to run_app.py instead. I am not sure it will work anyway, it seems to be designed to work locally. Did you try contacting the author?

Thanks for your reply @Goyo. I will contact the author then.