Please help: app wont boot

  • Updating watchdog (2.0.2 -> 2.1.2)

  • Installing xlrd (1.2.0)

  • Installing yarg (0.1.9)

  • Installing yaspin (1.5.0)

  EnvCommandError

  Command ['/home/appuser/venv/bin/pip', 'install', '--no-deps', '/home/appuser/.cache/pypoetry/artifacts/2d/ca/d8/dabaca099adfbadd05f754bbb66ebf314b5b89fa5bae60eea7a3f50ce3/PyICU-2.6.tar.gz'] errored with the following return code 1, and output: 

  Processing /home/appuser/.cache/pypoetry/artifacts/2d/ca/d8/dabaca099adfbadd05f754bbb66ebf314b5b89fa5bae60eea7a3f50ce3/PyICU-2.6.tar.gz

      ERROR: Command errored out with exit status 1:

       command: /home/appuser/venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-i8y26swa/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-i8y26swa/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-ru06upzw

           cwd: /tmp/pip-req-build-i8y26swa/

      Complete output (53 lines):

      (running 'icu-config --version')

      (running 'pkg-config --modversion icu-i18n')

      Traceback (most recent call last):

        File "/tmp/pip-req-build-i8y26swa/setup.py", line 63, in <module>

          ICU_VERSION = os.environ['ICU_VERSION']

        File "/usr/local/lib/python3.7/os.py", line 681, in __getitem__

          raise KeyError(key) from None

      KeyError: 'ICU_VERSION'

      

      During handling of the above exception, another exception occurred:

      

      Traceback (most recent call last):

        File "/tmp/pip-req-build-i8y26swa/setup.py", line 66, in <module>

          ICU_VERSION = check_output(('icu-config', '--version')).strip()

        File "/tmp/pip-req-build-i8y26swa/setup.py", line 19, in check_output

          return subprocess_check_output(popenargs)

        File "/usr/local/lib/python3.7/subprocess.py", line 411, in check_output

          **kwargs).stdout

        File "/usr/local/lib/python3.7/subprocess.py", line 488, in run

          with Popen(*popenargs, **kwargs) as process:

        File "/usr/local/lib/python3.7/subprocess.py", line 800, in __init__

          restore_signals, start_new_session)

        File "/usr/local/lib/python3.7/subprocess.py", line 1551, in _execute_child

          raise child_exception_type(errno_num, err_msg, err_filename)

      FileNotFoundError: [Errno 2] No such file or directory: 'icu-config': 'icu-config'

      

      During handling of the above exception, another exception occurred:

      

      Traceback (most recent call last):

        File "/tmp/pip-req-build-i8y26swa/setup.py", line 69, in <module>

          ICU_VERSION = check_output(('pkg-config', '--modversion', 'icu-i18n')).strip()

        File "/tmp/pip-req-build-i8y26swa/setup.py", line 19, in check_output

          return subprocess_check_output(popenargs)

        File "/usr/local/lib/python3.7/subprocess.py", line 411, in check_output

          **kwargs).stdout

        File "/usr/local/lib/python3.7/subprocess.py", line 488, in run

          with Popen(*popenargs, **kwargs) as process:

        File "/usr/local/lib/python3.7/subprocess.py", line 800, in __init__

          restore_signals, start_new_session)

        File "/usr/local/lib/python3.7/subprocess.py", line 1551, in _execute_child

          raise child_exception_type(errno_num, err_msg, err_filename)

      FileNotFoundError: [Errno 2] No such file or directory: 'pkg-config': 'pkg-config'

      

      During handling of the above exception, another exception occurred:

      

      Traceback (most recent call last):

        File "<string>", line 1, in <module>

        File "/tmp/pip-req-build-i8y26swa/setup.py", line 74, in <module>

          ''')

      RuntimeError:

      Please install pkg-config on your system or set the ICU_VERSION environment

      variable to the version of ICU you have installed.

      

packages.txt already has this

pkg-config

Yet the error messages seem to ask to have it installed again.

The app is

https://share.streamlit.io/ffreemt/st-bumblebee-aligner/dev/st_app.py

It has been running for quite a while. A user tried to run it and crashed the app. It wont boot up now.

Would you please have a look and help me fix the problem?

Thanks a lot.

If I had to guess, I would bet that this has to do with having a requirements.txt and pyproject file in your repo. We had to make a change to Streamlit sharing to make the solver deterministic (i.e. pick the dependency files in a specific order, rather than whichever the computer happens to choose first), and this may keep your app from rebooting.

What I suggest is that you pick one or the other, then re-launch your app and see if this fixes it.

Best,
Randy

Thanks for the reply.

I understand the project uses pyproject.toml instead of requirements.txt. I’ll try to reorder dependent packages. Hopefully it will fix it.

I think pyicu is the cause of the problem. You helped me fixed a problem a while back by adding pkg-config to packages.txt. Now this does not help any more.

1 Like

Once you de-dup the project files, if it doesn’t work still, let me know and we can figure out how to get pyicu to build correctly.

Best,
Randy

I am not sure how to de-dup. The packages are managed by poetry add that generate a pyproject.toml, they are not added manually.

I cloned the repo to some ubuntu machines. With an apt-get install libicu-dev and poetry install, streamlit run st_app.py runs without a problem.

Also, it worked previously before the crash two days ago.

I tried different things in the meantime. But nothing seemed to help.

...
Get:10 http://deb.debian.org/debian buster/main amd64 xdg-user-dirs amd64 0.17-2 [53.8 kB]
Fetched 22.9 MB in 1s (42.2 MB/s)
E: Failed to fetch http://deb.debian.org/debian/pool/main/g/glib2.0/libglib2.0-0_2.58.3-2+deb10u2_amd64.deb  404  Not Found [IP: 151.101.54.132 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Installing dependencies from lock file

Package operations: 109 installs, 39 updates, 0 removals
...

I cant attache the log file. But somewhere in the log file the message above is shown. This occurs before installing the packages. I am not sure whether that’s the problem.

It would be much appreciated if you can help fix the problem again.

I fixed it. Hooray! Delete the app and add it back. No problemo no more.

I was trying to create a bare bone streamlit app that requires pyicu and other related packages. There were no problems at all. Then it came to me: I should delete the app that wont boot and re-create it again.

It was rather frustrating and time consuming. Quite an experience, I almost started to give up on streamlit! I am glad I did not. Thanks for offering streamlit service!

2 Likes

Glad to hear that you were able to fix it, and sorry to hear that a delete-and-reload was the solution. But as we develop the service, sometimes things can get into an uncertain state, and hopefully these sorts of issues are diminished with each release!

I also had a similar problem, where my packages.txt simply had graphviz inside. A delete-and-reboot fixed, after weeks of trying to search for a solution. Thanks for the tip!

3 Likes

Faced similar issue and also solved by delete-and-reboot as well. Thanks y’all!