conda icon indicating copy to clipboard operation
conda copied to clipboard

Conda 24.9.2 installation fails on Windows (Github Actions)

Open lilithfeer opened this issue 1 year ago • 5 comments

What happened?

I am trying to set up my Github Actions workflow using conda. When I use the latest conda version it fails with the output below. I could reproduce the error as a warning on my local windows machine with the command C:\Windows\system32\cmd.exe /D /S /C "C:\Users\user\miniconda3\condabin\conda.bat install --name base "conda=*"" However in my github actions workflow this leads to a failure. I fixed it for now by using the conda version 24.5.0 instead.

The output below was edited to remove personal information.

Run conda-incubator/setup-miniconda@v3
Gathering Inputs...
Creating bootstrap condarc file in C:\Users\runneradmin\.condarc...
Ensuring installer...
Setup environment variables...
Parsing environment...
Configuring conda package cache...
Applying initial configuration...
Initializing conda shell integration...
Adding tools to 'base' env...
  Do we need to update conda?
  ... we will update conda.
  Do we need to update mamba?
  Do we need to update python?
  Do we need to update conda-build?
  C:\Windows\system32\cmd.exe /D /S /C "C:\Miniconda\condabin\conda.bat install --name base "conda=*""
  Channels:
   - conda-forge
   - bioconda
   - defaults
  Platform: win-64
  Collecting package metadata (repodata.json): ...working... done
  Solving environment: ...working... done
  
  ## Package Plan ##
  
    environment location: C:\Miniconda
  
    added / updated specs:
      - conda
  
  
  The following packages will be downloaded:
  
      package                    |            build
      ---------------------------|-----------------
      ca-certificates-2024.8.30  |       h56e8100_0         155 KB  conda-forge
      certifi-2024.8.30          |     pyhd8ed1ab_0         160 KB  conda-forge
      conda-24.9.2               |  py3[12]()h2e8e312_0         1.1 MB  conda-forge
      libexpat-2.6.2             |       h63175ca_0         [13]()6 KB  conda-forge
      libsqlite-3.46.1           |       h2466b09_0         856 KB  conda-forge
      libzlib-1.2.13             |       h2466b09_6          55 KB  conda-forge
      openssl-3.3.2              |       h2466b09_0         8.0 MB  conda-forge
      python-3.12.3              |h2628c8c_0_cpython        15.4 MB  conda-forge
      python_abi-3.12            |          5_cp312           7 KB  conda-forge
      ucrt-10.0.22621.0          |       h57928b3_1         547 KB  conda-forge
      vc[14]()_runtime-14.40.33810   |      hcc2c482_22         733 KB  conda-forge
      vs2015_runtime-14.40.33810 |      h3bf8584_22          [17]() KB  conda-forge
      zlib-1.2.13                |       h2466b09_6         105 KB  conda-forge
      ------------------------------------------------------------
                                             Total:        27.3 MB
  
  The following NEW packages will be INSTALLED:
  
    libexpat           conda-forge/win-64::libexpat-2.6.2-h63175ca_0 
    libsqlite          conda-forge/win-64::libsqlite-3.46.1-h2466b09_0 
    libzlib            conda-forge/win-64::libzlib-1.2.13-h2466b09_6 
    python_abi         conda-forge/win-64::python_abi-3.12-5_cp312 
    ucrt               conda-forge/win-64::ucrt-10.0.22621.0-h57928b3_1 
    vc14_runtime       conda-forge/win-64::vc14_runtime-14.40.33810-hcc2c482_22 
  
  The following packages will be UPDATED:
  
    ca-certificates    pkgs/main::ca-certificates-[20]()24.7.2-h~ --> conda-forge::ca-certificates-2024.8.30-h56e8100_0 
    certifi            pkgs/main/win-64::certifi-2024.7.4-py~ --> conda-forge/noarch::certifi-2024.8.30-pyhd8ed1ab_0 
    conda              pkgs/main::conda-24.7.1-py312haa95532~ --> conda-forge::conda-24.9.2-py312h2e8e312_0 
    openssl              pkgs/main::openssl-3.0.14-h827c3e9_0 --> conda-forge::openssl-3.3.2-h2466b09_0 
    vs2015_runtime     pkgs/main::vs2015_runtime-14.40.33807~ --> conda-forge::vs2015_runtime-14.40.33810-h3bf8584_[22]() 
    zlib                    pkgs/main::zlib-1.2.13-h8cc25b3_1 --> conda-forge::zlib-1.2.13-h2466b09_6 
  
  The following packages will be SUPERSEDED by a higher-priority channel:
  
    python                pkgs/main::python-3.12.4-h14ffc60_1 --> conda-forge::python-3.12.3-h2628c8c_0_cpython 
  
  
  
  Downloading and Extracting Packages: ...working... done
  Preparing transaction: ...working... done
  Verifying transaction: ...working... done
  Executing transaction: ...working... done
  
  D:\a\repo-name\repo-name>L "C:\Miniconda\condabin\..\Scripts\conda.exe"   install --name base "conda=*" 
  Warning: 'L' is not recognized as an internal or external command,
  operable program or batch file.
  
  'L' is not recognized as an internal or external command,
  operable program or batch file.
Error: The process 'C:\Miniconda\condabin\conda.bat' failed with exit code 9009

Conda Config

name: project
channels:
  - conda-forge
  - bioconda
  - defaults
dependencies:
  - python=3.11.9
  - bwa=0.7.18
  - pip=24.2
  - pip:
    - biopython==1.81
    - pysam==0.21.0

lilithfeer avatar Oct 17 '24 12:10 lilithfeer

@lilithfeer we haven't been able to replicate this yet, can you share the GitHub workflow that causes the error to occur?

kenodegard avatar Oct 17 '24 14:10 kenodegard

@lilithfeer we have replicated this locally and understand why this happens, it boils down the conda.bat script being updated while in use (and Windows Cmd.exe being Windows Cmd.exe doesn't handle this well).

If you were to encounter this error locally while updating conda in your base environment, restarting your terminal would resolve the issue. Since this is happening in your CI using the conda-incubator/setup-miniconda GitHub Action I suggest setting auto-update-conda: false to avoid the issue.

kenodegard avatar Oct 17 '24 16:10 kenodegard

@kenodegard here is the yaml file. It worked for macos & ubuntu:

name: project

on:
  push:
    branches: [ "test" ]
  pull_request:
    branches: [ "test" ]

permissions:
  contents: read

jobs:
  build:
    name: ${{matrix.os}}
    runs-on: ${{matrix.os}}
    defaults:
      run:
        shell: bash -l {0}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]

    steps:
      - name: Checkout code
        uses: actions/checkout@v4
      - name: create conda environment with conda
        uses: conda-incubator/setup-miniconda@v3
        with:
          conda-version: "*"
          activate-environment: condaenv
          environment-file: tests/environment.yaml
          auto-activate-base: false
      - name: check conda environment & install flake8 and pytest
        run: |
          conda info
          conda list
          pip install flake8 pytest
      - name: Lint with flake8
        run: |
          # stop the build if there are Python syntax errors or undefined names
          flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
          # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
          flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
      - name: Test with pytest
        run: |
          pytest

lilithfeer avatar Oct 17 '24 16:10 lilithfeer

@lilithfeer ah so specifying conda-version: "*" is the effectively the equivalent of saying auto-update-conda: true, removing that will also do the trick.

kenodegard avatar Oct 17 '24 16:10 kenodegard

@kenodegard Thanks for your help!

lilithfeer avatar Oct 17 '24 16:10 lilithfeer

Hi there, thank you for your contribution!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this issue to remain open please:

  1. Verify that you can still reproduce the issue at hand
  2. Comment that the issue is still reproducible and include: - What OS and version you reproduced the issue on - What steps you followed to reproduce the issue

NOTE: If this issue was closed prematurely, please leave a comment.

Thanks!

github-actions[bot] avatar Oct 18 '25 04:10 github-actions[bot]