Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Runtime failed to build due to Mamba Error #4153

Closed
2 tasks done
xingyaoww opened this issue Oct 1, 2024 · 2 comments · Fixed by #4154
Closed
2 tasks done

[Bug]: Runtime failed to build due to Mamba Error #4153

xingyaoww opened this issue Oct 1, 2024 · 2 comments · Fixed by #4154
Labels
bug Something isn't working severity:medium Affecting multiple users

Comments

@xingyaoww
Copy link
Collaborator

Is there an existing issue for the same bug?

Describe the bug

Traceback (most recent call last):
  File "/openhands/miniforge3/bin/mamba", line 7, in <module>
    from mamba.mamba import main
  File "/openhands/miniforge3/lib/python3.11/site-packages/mamba/mamba.py", line 18, in <module>
    from conda.cli.main import generate_parser, init_loggers
ImportError: cannot import name 'generate_parser' from 'conda.cli.main' 

which cause the build to fail

Current OpenHands version

I am experimenting on https://github.com/All-Hands-AI/OpenHands/pull/3985, but it should pretty much the same as main

Installation and Configuration

make build

Model and Agent

No response

Operating System

No response

Reproduction Steps

No response

Logs, Errors, Screenshots, and Additional Context

...

  Package                         Version  Build               Channel         Size
─────────────────────────────────────────────────────────────────────────────────────
  Install:
─────────────────────────────────────────────────────────────────────────────────────

  + _libgcc_mutex                     0.1  conda_forge         conda-forge         
  + ca-certificates             2024.8.30  hbcca054_0          conda-forge         
  + ld_impl_linux-64                 2.40  hf3520f5_7          conda-forge         
  + pybind11-abi                        4  hd8ed1ab_3          conda-forge         
  + python_abi                       3.12  5_cp312             conda-forge         
  + tzdata                          2024a  h8827d51_1          conda-forge         
  + libgomp                        14.1.0  h77fa898_1          conda-forge         
  + _openmp_mutex                     4.5  2_gnu               conda-forge         
  + libgcc                         14.1.0  h77fa898_1          conda-forge         
  + libexpat                        2.6.3  h5888daf_0          conda-forge         
  + libgcc-ng                      14.1.0  h69a702a_1          conda-forge         
  + libstdcxx                      14.1.0  hc0a3c3a_1          conda-forge         
  + openssl                         3.3.2  hb9d3cd8_0          conda-forge         
  + bzip2                           1.0.8  h4bc722e_7          conda-forge         
  + c-ares                         1.32.3  h4bc722e_0          conda-forge         
  + keyutils                        1.6.1  h166bdaf_0          conda-forge         
  + libev                            4.33  hd590300_2          conda-forge         
  + libffi                          3.4.2  h7f98852_5          conda-forge         
  + libiconv                         1.17  hd590300_2          conda-forge         
  + libnsl                          2.0.1  hd590300_0          conda-forge         
  + libstdcxx-ng                   14.1.0  h4852527_1          conda-forge         
  + libuuid                        2.38.1  h0b41bf4_0          conda-forge         
  + libxcrypt                      4.4.36  hd590300_1          conda-forge         
  + libzlib                         1.3.1  h4ab18f5_1          conda-forge         
  + lzo                              2.10  hd590300_1001       conda-forge         
  + ncurses                           6.5  he02047a_1          conda-forge         
  + reproc                   14.2.4.post0  hd590300_1          conda-forge         
  + xz                              5.2.6  h166bdaf_0          conda-forge         
  + fmt                            10.2.1  h00ab1b0_0          conda-forge         
  + icu                              75.1  he02047a_0          conda-forge         
  + libedit                  3.1.20191231  he28a2e2_2          conda-forge         
  + libnghttp2                     1.58.0  h47da74e_1          conda-forge         
  + libsolv                        0.7.30  h3509ff9_0          conda-forge         
  + libsqlite                      3.46.1  hadc24fc_0          conda-forge         
  + libssh2                        1.11.0  h0841786_0          conda-forge         
  + lz4-c                           1.9.4  hcb278e6_0          conda-forge         
  + readline                          8.2  h8228510_1          conda-forge         
  + reproc-cpp               14.2.4.post0  h59595ed_1          conda-forge         
  + tk                             8.6.13  noxft_h4845f30_101  conda-forge         
  + yaml-cpp                        0.8.0  h59595ed_0          conda-forge         
  + zstd                            1.5.6  ha6fb4c9_0          conda-forge         
  + krb5                           1.21.3  h659f571_0          conda-forge         
  + libxml2                        2.12.7  he7c6b58_4          conda-forge         
  + python                         3.12.6  hc5c86c4_1_cpython  conda-forge         
  + libarchive                      3.7.4  hfca40fe_0          conda-forge         
  + libcurl                        8.10.1  hbbe4b11_0          conda-forge         
  + menuinst                        2.1.2  py312h7900ff3_1     conda-forge         
  + archspec                        0.2.3  pyhd8ed1ab_0        conda-forge         
  + boltons                        24.0.0  pyhd8ed1ab_0        conda-forge         
  + brotli-python                   1.1.0  py312h2ec8cdc_2     conda-forge         
  + certifi                     2024.8.30  pyhd8ed1ab_0        conda-forge         
  + charset-normalizer              3.3.2  pyhd8ed1ab_0        conda-forge         
  + colorama                        0.4.6  pyhd8ed1ab_0        conda-forge         
  + distro                          1.9.0  pyhd8ed1ab_0        conda-forge         
  + frozendict                      2.4.4  py312h66e93f0_1     conda-forge         
  + hpack                           4.0.0  pyh9f0ad1d_0        conda-forge         
  + hyperframe                      6.0.1  pyhd8ed1ab_0        conda-forge         
  + idna                             3.10  pyhd8ed1ab_0        conda-forge         
  + jsonpointer                     3.0.0  py312h7900ff3_1     conda-forge         
  + libmamba                        1.5.9  h4cc3d14_0          conda-forge         
  + packaging                        24.1  pyhd8ed1ab_0        conda-forge         
  + platformdirs                    4.3.6  pyhd8ed1ab_0        conda-forge         
  + pluggy                          1.5.0  pyhd8ed1ab_0        conda-forge         
  + pycosat                         0.6.6  py312h98912ed_0     conda-forge         
  + pycparser                        2.22  pyhd8ed1ab_0        conda-forge         
  + pysocks                         1.7.1  pyha2e5f31_6        conda-forge         
  + ruamel.yaml.clib                0.2.8  py312h98912ed_0     conda-forge         
  + setuptools                     74.1.2  pyhd8ed1ab_0        conda-forge         
  + truststore                      0.9.2  pyhd8ed1ab_0        conda-forge         
  + wheel                          0.44.0  pyhd8ed1ab_0        conda-forge         
  + cffi                           1.17.1  py312h06ac9bb_0     conda-forge         
  + h2                              4.1.0  pyhd8ed1ab_0        conda-forge         
  + jsonpatch                        1.33  pyhd8ed1ab_0        conda-forge         
  + libmambapy                      1.5.9  py312h7fb9e8e_0     conda-forge         
  + pip                              24.2  pyh8b19718_1        conda-forge         
  + ruamel.yaml                    0.18.6  py312h98912ed_0     conda-forge         
  + tqdm                           4.66.5  pyhd8ed1ab_0        conda-forge         
  + zstandard                      0.23.0  py312hef9b889_1     conda-forge         
  + conda-package-streaming        0.10.0  pyhd8ed1ab_0        conda-forge         
  + urllib3                         2.2.3  pyhd8ed1ab_0        conda-forge         
  + conda-package-handling          2.3.0  pyh7900ff3_0        conda-forge         
  + requests                       2.32.3  pyhd8ed1ab_0        conda-forge         
  + conda                          24.7.1  py312h7900ff3_0     conda-forge         
  + conda-libmamba-solver          24.7.0  pyhd8ed1ab_0        conda-forge         
  + mamba                           1.5.9  py312h9460a1c_0     conda-forge         

  Summary:

  Install: 85 packages

  Total download: 0 B

─────────────────────────────────────────────────────────────────────────────────────



Transaction starting

Transaction finished

To activate this environment, use:

    micromamba activate /openhands/miniforge3

Or to execute a single command in this environment, use:

    micromamba run -p /openhands/miniforge3 mycommand

installation finished.
Warning: 'conda-forge' already in 'channels' list, moving to the bottom
Removing intermediate container 8a5d0a595e2d
 ---> 6b53437dc1db
Step 7/11 : RUN /openhands/miniforge3/bin/mamba install conda-forge::poetry python=3.11 -y
 ---> Running in 71c23bfe4fd5
Transaction

  Prefix: /openhands/miniforge3

  Updating specs:

   - conda-forge::poetry
   - python=3.11
   - ca-certificates
   - certifi
   - openssl


  Package                           Version  Build               Channel           Size
─────────────────────────────────────────────────────────────────────────────────────────
  Install:
─────────────────────────────────────────────────────────────────────────────────────────

  + expat                             2.6.3  h6a678d5_0          pkgs/main        181kB
  + blas                                1.0  openblas            pkgs/main         47kB
  + libgfortran5                     11.2.0  h1234567_1          pkgs/main          2MB
  + libgfortran-ng                   11.2.0  h00389a5_1          pkgs/main         20kB
  + libopenblas                      0.3.21  h043d6bf_0          pkgs/main          6MB
  + zlib                             1.2.13  h4ab18f5_6          conda-forge       93kB
  + pcre2                             10.42  hebb0a14_1          pkgs/main          1MB
  + sqlite                           3.45.3  h5eee18b_0          pkgs/main          1MB
  + libglib                          2.78.4  hdc74915_0          pkgs/main          2MB
  + glib-tools                       2.78.4  h6a678d5_0          pkgs/main        118kB
  + python-fastjsonschema            2.20.0  pyhd8ed1ab_0        conda-forge      226kB
  + poetry-core                       1.9.0  pyhd8ed1ab_0        conda-forge      227kB
  + tomlkit                          0.13.2  pyha770c72_0        conda-forge       37kB
  + numpy-base                       1.26.4  py311hbfb1bba_0     pkgs/main          9MB
  + more-itertools                   10.3.0  py311h06a4308_0     pkgs/main        149kB
  + msgpack-python                    1.0.3  py311hdb19cb5_0     pkgs/main         37kB
  + glib                             2.78.4  h6a678d5_0          pkgs/main        520kB
  + zipp                             3.17.0  py311h06a4308_0     pkgs/main         25kB
  + filelock                         3.13.1  py311h06a4308_0     pkgs/main         25kB
  + distlib                           0.3.8  py311h06a4308_0     pkgs/main        467kB
  + trove-classifiers            2023.10.18  py311h06a4308_0     pkgs/main         22kB
  + tomli                             2.0.1  py311h06a4308_0     pkgs/main         31kB
  + shellingham                       1.5.0  py311h06a4308_0     pkgs/main         21kB
  + pyproject_hooks                   1.0.0  py311h06a4308_0     pkgs/main         25kB
  + pkginfo                          1.10.0  py311h06a4308_0     pkgs/main         67kB
  + crashtest                         0.4.1  py311h06a4308_0     pkgs/main         18kB
  + numpy                            1.26.4  py311h24aa872_0     pkgs/main         11kB
  + dbus                            1.13.18  hb2f20db_0          pkgs/main        516kB
  + importlib-metadata                7.0.1  py311h06a4308_0     pkgs/main         50kB
  + virtualenv                      20.26.1  py311h06a4308_0     pkgs/main          4MB
  + cryptography                     43.0.0  py311hdda0065_0     pkgs/main          2MB
  + rapidfuzz                         3.5.2  py311h6a678d5_0     pkgs/main          2MB
  + cleo                              2.1.0  py311h06a4308_0     pkgs/main        181kB
  + jeepney                           0.7.1  pyhd3eb1b0_0        pkgs/main         39kB
  + ptyprocess                        0.7.0  pyhd3eb1b0_2        pkgs/main         17kB
  + python-installer                  0.7.0  pyhd3eb1b0_1        pkgs/main        257kB
  + jaraco.classes                    3.2.1  pyhd3eb1b0_0        pkgs/main          9kB
  + importlib_metadata                7.0.1  hd3eb1b0_0          pkgs/main          9kB
  + pexpect                           4.8.0  pyhd3eb1b0_3        pkgs/main         54kB
  + python-build                      1.2.2  pyhd8ed1ab_0        conda-forge       25kB
  + secretstorage                     3.3.1  py311h06a4308_1     pkgs/main         29kB
  + dulwich                          0.21.3  py311h5eee18b_0     pkgs/main        998kB
  + requests-toolbelt                 1.0.0  py311h06a4308_0     pkgs/main         92kB
  + cachecontrol                     0.14.0  py311h06a4308_1     pkgs/main         46kB
  + keyring                          24.3.1  py311h06a4308_0     pkgs/main         82kB
  + cachecontrol-with-filecache      0.14.0  py311h06a4308_1     pkgs/main          5kB
  + poetry                            1.8.3  linux_pyha804496_1  conda-forge      167kB
  + poetry-plugin-export              1.8.0  pyhd8ed1ab_0        conda-forge       16kB

  Change:
─────────────────────────────────────────────────────────────────────────────────────────

  - ruamel.yaml.clib                  0.2.8  py312h98912ed_0     conda-forge     Cached
  + ruamel.yaml.clib                  0.2.8  py311h5eee18b_0     pkgs/main        161kB
  - pycosat                           0.6.6  py312h98912ed_0     conda-forge     Cached
  + pycosat                           0.6.6  py311h5eee18b_1     pkgs/main         97kB
  - menuinst                          2.1.2  py312h7900ff3_1     conda-forge     Cached
  + menuinst                          2.1.2  py311h06a4308_0     pkgs/main        263kB
  - cffi                             1.17.1  py312h06ac9bb_0     conda-forge     Cached
  + cffi                             1.17.1  py311h1fdaa30_0     pkgs/main        322kB

  Reinstall:
─────────────────────────────────────────────────────────────────────────────────────────

  o wheel                            0.44.0  pyhd8ed1ab_0        conda-forge     Cached
  o setuptools                       74.1.2  pyhd8ed1ab_0        conda-forge     Cached
  o pip                                24.2  pyh8b19718_1        conda-forge     Cached
  o truststore                        0.9.2  pyhd8ed1ab_0        conda-forge     Cached
  o pysocks                           1.7.1  pyha2e5f31_6        conda-forge     Cached
  o pycparser                          2.22  pyhd8ed1ab_0        conda-forge     Cached
  o pluggy                            1.5.0  pyhd8ed1ab_0        conda-forge     Cached
  o platformdirs                      4.3.6  pyhd8ed1ab_0        conda-forge     Cached
  o packaging                          24.1  pyhd8ed1ab_0        conda-forge     Cached
  o idna                               3.10  pyhd8ed1ab_0        conda-forge     Cached
  o hyperframe                        6.0.1  pyhd8ed1ab_0        conda-forge     Cached
  o hpack                             4.0.0  pyh9f0ad1d_0        conda-forge     Cached
  o distro                            1.9.0  pyhd8ed1ab_0        conda-forge     Cached
  o colorama                          0.4.6  pyhd8ed1ab_0        conda-forge     Cached
  o charset-normalizer                3.3.2  pyhd8ed1ab_0        conda-forge     Cached
  o certifi                       2024.8.30  pyhd8ed1ab_0        conda-forge     Cached
  o boltons                          24.0.0  pyhd8ed1ab_0        conda-forge     Cached
  o archspec                          0.2.3  pyhd8ed1ab_0        conda-forge     Cached
  o h2                                4.1.0  pyhd8ed1ab_0        conda-forge     Cached
  o tqdm                             4.66.5  pyhd8ed1ab_0        conda-forge     Cached
  o urllib3                           2.2.3  pyhd8ed1ab_0        conda-forge     Cached
  o conda-package-streaming          0.10.0  pyhd8ed1ab_0        conda-forge     Cached
  o jsonpatch                          1.33  pyhd8ed1ab_0        conda-forge     Cached
  o requests                         2.32.3  pyhd8ed1ab_0        conda-forge     Cached
  o conda-package-handling            2.3.0  pyh7900ff3_0        conda-forge     Cached
  o conda-libmamba-solver            24.7.0  pyhd8ed1ab_0        conda-forge     Cached

  Upgrade:
─────────────────────────────────────────────────────────────────────────────────────────

  - ca-certificates               2024.8.30  hbcca054_0          conda-forge     Cached
  + ca-certificates               2024.9.24  h06a4308_0          pkgs/main        133kB
  - xz                                5.2.6  h166bdaf_0          conda-forge     Cached
  + xz                                5.4.6  h5eee18b_1          pkgs/main        659kB
  - libxml2                          2.12.7  he7c6b58_4          conda-forge     Cached
  + libxml2                          2.13.1  hfdd30dd_2          pkgs/main        757kB
  - conda                            24.7.1  py312h7900ff3_0     conda-forge     Cached
  + conda                            24.9.0  py311h06a4308_0     pkgs/main          1MB

  Downgrade:
─────────────────────────────────────────────────────────────────────────────────────────

  - libuuid                          2.38.1  h0b41bf4_0          conda-forge     Cached
  + libuuid                          1.41.5  h5eee18b_0          pkgs/main         28kB
  - icu                                75.1  he02047a_0          conda-forge     Cached
  + icu                                73.1  h6a678d5_0          pkgs/main         27MB
  - libzlib                           1.3.1  h4ab18f5_1          conda-forge     Cached
  + libzlib                          1.2.13  h4ab18f5_6          conda-forge       62kB
  - libsqlite                        3.46.1  hadc24fc_0          conda-forge     Cached
  + libsqlite                        3.46.0  hde9e2c9_0          conda-forge      865kB
  - libcurl                          8.10.1  hbbe4b11_0          conda-forge     Cached
  + libcurl                           8.8.0  hca28451_1          conda-forge      410kB
  - libsolv                          0.7.30  h3509ff9_0          conda-forge     Cached
  + libsolv                          0.7.24  he621ea3_1          pkgs/main        502kB
  - python                           3.12.6  hc5c86c4_1_cpython  conda-forge     Cached
  + python                           3.11.9  h955ad1f_0          pkgs/main         34MB
  - libmamba                          1.5.9  h4cc3d14_0          conda-forge     Cached
  + libmamba                          1.5.8  had39da4_0          conda-forge        2MB
  - frozendict                        2.4.4  py312h66e93f0_1     conda-forge     Cached
  + frozendict                        2.4.2  py311h06a4308_0     pkgs/main         38kB
  - brotli-python                     1.1.0  py312h2ec8cdc_2     conda-forge     Cached
  + brotli-python                     1.0.9  py311h6a678d5_8     pkgs/main        367kB
  - ruamel.yaml                      0.18.6  py312h98912ed_0     conda-forge     Cached
  + ruamel.yaml                     0.17.21  py311h5eee18b_0     pkgs/main        255kB
  - zstandard                        0.23.0  py312hef9b889_1     conda-forge     Cached
  + zstandard                        0.19.0  py311h5eee18b_0     pkgs/main        449kB
  - jsonpointer                       3.0.0  py312h7900ff3_1     conda-forge     Cached
  + jsonpointer                         2.1  pyhd3eb1b0_0        pkgs/main          9kB
  - python_abi                         3.12  5_cp312             conda-forge     Cached
  + python_abi                         3.11  2_cp311             conda-forge        5kB
  - libmambapy                        1.5.9  py312h7fb9e8e_0     conda-forge     Cached
  + libmambapy                        1.5.8  py311hf2555c7_0     conda-forge      311kB
  - mamba                             1.5.9  py312h9460a1c_0     conda-forge     Cached
  + mamba                             1.5.8  py311h3072747_0     conda-forge       67kB

  Summary:

  Install: 48 packages
  Change: 4 packages
  Reinstall: 26 packages
  Upgrade: 4 packages
  Downgrade: 16 packages

  Total download: 104MB

─────────────────────────────────────────────────────────────────────────────────────────



Looking for: ['conda-forge::poetry', 'python=3.11']


Downloading and Extracting Packages: ...working... done
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
Removing intermediate container 71c23bfe4fd5
 ---> e07c93afbda8
Step 8/11 : RUN if [ -d /openhands/code ]; then rm -rf /openhands/code; fi
 ---> Running in 13bd633e1905
Removing intermediate container 13bd633e1905
 ---> 172894098a49
Step 9/11 : COPY ./code /openhands/code
 ---> 7d7e9aa1e383
Step 10/11 : WORKDIR /openhands/code
 ---> Running in 35bca73c59ee
Removing intermediate container 35bca73c59ee
 ---> ce2e67b74866
Step 11/11 : RUN     /openhands/miniforge3/bin/mamba run -n base poetry config virtualenvs.path /openhands/poetry &&     /openhands/miniforge3/bin/mamba run -n base poetry env use python3.11 &&     /openhands/miniforge3/bin/mamba run -n base poetry install --only main,runtime --no-interaction --no-root &&     apt-get update &&     /openhands/miniforge3/bin/mamba run -n base poetry run pip install playwright &&     /openhands/miniforge3/bin/mamba run -n base poetry run playwright install --with-deps chromium &&     echo "OH_INTERPRETER_PATH=$(/openhands/miniforge3/bin/mamba run -n base poetry run python -c "import sys; print(sys.executable)")" >> /etc/environment &&           /openhands/miniforge3/bin/mamba run -n base poetry cache clear --all . &&     chmod -R g+rws /openhands/poetry &&      mkdir -p /openhands/workspace && chmod -R g+rws,o+rw /openhands/workspace &&     apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* &&     /openhands/miniforge3/bin/mamba clean --all
 ---> Running in 0b64bd15c323
Traceback (most recent call last):
  File "/openhands/miniforge3/bin/mamba", line 7, in <module>
    from mamba.mamba import main
  File "/openhands/miniforge3/lib/python3.11/site-packages/mamba/mamba.py", line 18, in <module>
    from conda.cli.main import generate_parser, init_loggers
ImportError: cannot import name 'generate_parser' from 'conda.cli.main' (/openhands/miniforge3/lib/python3.11/site-packages/conda/cli/main.py)
The command '/bin/sh -c /openhands/miniforge3/bin/mamba run -n base poetry config virtualenvs.path /openhands/poetry &&     /openhands/miniforge3/bin/mamba run -n base poetry env use python3.11 &&     /openhands/miniforge3/bin/mamba run -n base poetry install --only main,runtime --no-interaction --no-root &&     apt-get update &&     /openhands/miniforge3/bin/mamba run -n base poetry run pip install playwright &&     /openhands/miniforge3/bin/mamba run -n base poetry run playwright install --with-deps chromium &&     echo "OH_INTERPRETER_PATH=$(/openhands/miniforge3/bin/mamba run -n base poetry run python -c "import sys; print(sys.executable)")" >> /etc/environment &&           /openhands/miniforge3/bin/mamba run -n base poetry cache clear --all . &&     chmod -R g+rws /openhands/poetry &&      mkdir -p /openhands/workspace && chmod -R g+rws,o+rw /openhands/workspace &&     apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* &&     /openhands/miniforge3/bin/mamba clean --all' returned a non-zero code: 1
@tobitege
Copy link
Collaborator

tobitege commented Oct 1, 2024

hmm... haven't seen this error before 🤔

@xingyaoww
Copy link
Collaborator Author

This is, indeed very strange and bugged me for an entire afternoon 😓 -- trying to see if #4154 can fix it.

I suspect this maybe the reason - we are overriding and breaking the mamba package in base env by installing python and poetry..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working severity:medium Affecting multiple users
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants