Previously functioning python imports no longer working as of ~7/29

Hi there!

We have a feature in our streamlit application that imports a python library (dbt) and then utilizes that library to process data. This was working well as of last week. Over the weekend, we started getting an error saying:

FileNotFoundError: [Errno 2] No such file or directory: ‘dbt’
Traceback:

File "/home/adminuser/venv/lib/python3.8/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
    exec(code, module.__dict__)File "/mount/src/aero/app/⚙️_admin.py", line 154, in <module>
    run_command(['dbt', 'deps'], cwd=dbt_dir, extra_env=env)File "/mount/src/aero/app/dbt_runner.py", line 18, in run_command
    for i, line in enumerate(execute(args, cwd, my_env)):File "/mount/src/aero/app/dbt_runner.py", line 34, in execute
    popen = subprocess.Popen(cmd, cwd=cwd, env=env, stdout=subprocess.PIPE, universal_newlines=True)File "/usr/local/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,File "/usr/local/lib/python3.8/subprocess.py", line 1720, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)

Streamlit logs:

2023-07-31 14:38:24.170 | WARNING | error_util | error_util.py | handle_uncaught_app_exception() | 95 | Uncaught app exception

Traceback (most recent call last):
  File "/home/adminuser/venv/lib/python3.8/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
    exec(code, module.__dict__)
  File "/mount/src/aero/app/⚙️_admin.py", line 154, in <module>
    run_command(['dbt', 'deps'], cwd=dbt_dir, extra_env=env)
  File "/mount/src/aero/app/dbt_runner.py", line 18, in run_command
    for i, line in enumerate(execute(args, cwd, my_env)):
  File "/mount/src/aero/app/dbt_runner.py", line 34, in execute
    popen = subprocess.Popen(cmd, cwd=cwd, env=env, stdout=subprocess.PIPE, universal_newlines=True)
  File "/usr/local/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/local/lib/python3.8/subprocess.py", line 1720, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'dbt'

We haven’t deployed any changes in the last week, so we’re trying to figure out where this is coming from and how to resolve, as it’s pretty core functionality to our product.
I’d prefer not to post our application publicly but happy to send a DM to someone investigating, or provide any more helpful information. I believe we’re on python 3.8 and confirmed we’re on Streamlit v1.21.0

Thanks!

1 Like

Hey @Jai,

Thanks for sharing this! I’m checking with our team and will update here when I have more info

Hi @Jai! I’m one of the engineers working on Community Cloud, also responsible for breaking your app. I apologize for that.

Could you please share a subset of the app with me, mainly around the dependencies you are installing and a small Python script testing them?

Best,
George

2 Likes

Hi George, here’s a sample:

import streamlit as st
import dbt as dbt
from subprocess import PIPE, run
import logging
import os

logging.basicConfig(level=logging.INFO,
                    format='%(filename)s: '    
                            '%(levelname)s: '
                            '%(funcName)s(): '
                            '%(lineno)d:\t'
                            '%(message)s')

if st.button("test"):
    logging.info("running dbt --version")
    logging.info(os.system('ls -l'))
    logging.info("running dbt --version")
    logging.info(os.system('dbt --version'))
    commands = [
        ['ls'],
        ['pip', 'list'],
        ['dbt', '--version']
    ]
    for c in commands:
        st.code(f"running {c}")
        result = run(c, stdout=PIPE, stderr=PIPE, universal_newlines=True)
        st.code(f"result: {result}")

And a public streamlit application running that code: https://d4cgjbaycedxicxqg3rtae.streamlit.app/

Is there a way to privately message other specifics?

1 Like

Thank you, @Jai! I will look at this today and I will give you updates as I make progress on it.

Hi, @Jai! I identified the issue and will put out a fix by EOD tomorrow.

@Jai, https://d4cgjbaycedxicxqg3rtae.streamlit.app/ is now working. If you have any other apps which are broken, you would need to either delete/recreate them, or let me know their domain and I can migrate them for you.

Best,
George

Thanks George! Is there a way to privately message a URL?

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