Repository: conda/conda

Issue:
conda/bin deleted when conda install errors in 4.6.3
<!--
Hi!  Read this; it's important.

This is an issue tracker for conda -- the package manager.  File feature requests
for conda here, as well as bug reports about something conda has messed up.

If your issue is a bug report for:
  * a specific conda package from Anaconda ('defaults' channel):
      ==> file at https://github.com/ContinuumIO/anaconda-issues
  * a specific conda package from conda-forge:
      ==> file at the corresponding feedstock under https://github.com/conda-forge
  * repo.anaconda.com access and service:
      ==> file at https://github.com/ContinuumIO/anaconda-issues
  * anaconda.org access and service:
      ==> file at https://anaconda.org/contact/report
  * commands under 'conda build':
      ==> file at https://github.com/conda/conda-build
  * commands under 'conda env':
      ==> please file it here!
  * all other conda commands that start with 'conda':
      ==> please file it here!

If you continue on,

   **please include all requested information below.**

If a maintainer determines the information is required to understand 
your issue, and if it is not provided, your issue may be
closed automatically.

-->

## Current Behavior
<!-- What actually happens?
     If you want to include console output, please use "Steps to Reproduce" below. -->
```
The files in the anaconda/bin directory were deleted when running `conda install` on a new local build of a recipe. When the recipe errors/fails conda tries to roll back. During the role back, rm_rf is called on the anaconda/bin folder. The complete contents of the folder are deleted. This is from conda 4.6.3
```

### Steps to Reproduce
<!-- If the current behavior is a bug, please provide specific, minimal steps to independently reproduce.
     Include the exact conda commands that reproduce the issue and their output between the ticks below. -->
```
conda install --use-local  -v -y <recipe>
```


## Expected Behavior
<!-- What do you think should happen? -->
```
If conda install is unsuccessful conda should not remove the entire contents of the anaconda/bin folder.  
```

## Environment Information
<details open><summary><code>`conda info`</code></summary><p>
<!-- between the ticks below, paste the output of 'conda info' -->

```
Not available. Unfortunetly, the conda binary is no longer available to run any conda command. But the conda version was 4.6.3
```
</p></details>


<details open><summary><code>`conda config --show-sources`</code></summary><p>
<!-- between the ticks below, paste the output of 'conda config --show-sources' -->

```

```
</p></details>


<details><summary><code>`conda list --show-channel-urls`</code></summary><p>
<!-- between the ticks below, paste the output of 'conda list --show-channel-urls' -->

```

```
</p></details>

### Output from the command
```
No numpy version specified in conda_build_config.yaml.  Falling back to default numpy value of 1.11
WARNING:conda_build.metadata:No numpy version specified in conda_build_config.yaml.  Falling back to default numpy value of 1.11
INFO:conda_build.variants:Adding in variants from internal_defaults
INFO:conda_build.metadata:Attempting to finalize metadata for hg19-civic
WARNING: symlink_conda() is deprecated.
INFO:conda_build.build:Packaging hg19-civic
INFO:conda_build.build:Packaging hg19-civic-1-0
No files or script found for output hg19-civic
WARNING:conda_build.build:No files or script found for output hg19-civic
/scratch/local/u0055382/tmp1fopUu/hg19-civic-1-0.tar.bz2: C1115 Found invalid license "None" in info/index.json
/scratch/local/u0055382/tmp1fopUu/hg19-civic-1-0.tar.bz2: C1134 Found pre/post link file "bin/.hg19-civic-post-link.sh" in archive
INFO:conda_build.variants:Adding in variants from /scratch/local/u0055382/tmpSvYdIK/info/recipe/conda_build_config.yaml
Collecting package metadata: ...working... done
Solving environment: ...working... done
initializing UnlinkLinkTransaction with
  target_prefix: /uufs/chpc.utah.edu/common/home/u0055382/anaconda2
  unlink_precs:
    
  link_precs:
    bioconda::gsort-0.0.6-1
    local::hg19-civic-1-0



## Package Plan ##

  environment location: /uufs/chpc.utah.edu/common/home/u0055382/anaconda2

  added / updated specs:
    - hg19-civic


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    hg19-civic-1               |                0           6 KB  local
    ------------------------------------------------------------
                                           Total:           6 KB

The following NEW packages will be INSTALLED:

  gsort              bioconda/linux-64::gsort-0.0.6-1
  hg19-civic         uufs/chpc.utah.edu/common/home/u0055382/anaconda2/conda-bld/noarch::hg19-civic-1-0


Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... ===> LINKING PACKAGE: bioconda::gsort-0.0.6-1 <===
  prefix=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2
  source=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/pkgs/gsort-0.0.6-1


===> LINKING PACKAGE: local::hg19-civic-1-0 <===
  prefix=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2
  source=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/pkgs/hg19-civic-1-0


$ bash -x /uufs/chpc.utah.edu/common/home/u0055382/anaconda2nTV9V8
==> cwd: /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin <==
==> exit code: 1 <==
==> stdout <==
*****************************

Inactive or out-of-date environment variables:
> $ggd_hg19_civic

To activate inactive or out-of-date vars, run:
source activate base

*****************************

Retrieving the latest data downloads from CIViC
Creating civic_genes, civic_gene_summaries, and civic_variants BED files

==> stderr <==
+ [[ hB != hxB ]]
+ XTRACE_STATE=-x
+ [[ hxB != hxB ]]
+ VERBOSE_STATE=+v
+ set +xv
+ unset XTRACE_STATE VERBOSE_STATE
++ /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda shell.posix hook
+ eval 'export CONDA_EXE="/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda"
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

__conda_hashr() {
    if [ -n "${ZSH_VERSION:+x}" ]; then
        \rehash
    elif [ -n "${POSH_VERSION:+x}" ]; then
        :  # pass
    else
        \hash -r
    fi
}

__conda_activate() {
    if [ -n "${CONDA_PS1_BACKUP:+x}" ]; then
        # Handle transition from shell activated with conda <= 4.3 to a subsequent activation
        # after conda updated to >= 4.4. See issue #6173.
        PS1="$CONDA_PS1_BACKUP"
        \unset CONDA_PS1_BACKUP
    fi

    \local cmd="$1"
    shift
    \local ask_conda
    ask_conda="$(PS1="$PS1" "$CONDA_EXE" shell.posix "$cmd" "$@")" || \return $?
    \eval "$ask_conda"
    __conda_hashr
}

__conda_reactivate() {
    \local ask_conda
    ask_conda="$(PS1="$PS1" "$CONDA_EXE" shell.posix reactivate)" || \return $?
    \eval "$ask_conda"
    __conda_hashr
}

conda() {
    if [ "$#" -lt 1 ]; then
        "$CONDA_EXE"
    else
        \local cmd="$1"
        shift
        case "$cmd" in
            activate|deactivate)
                __conda_activate "$cmd" "$@"
                ;;
            install|update|upgrade|remove|uninstall)
                "$CONDA_EXE" "$cmd" "$@" && __conda_reactivate
                ;;
            *) "$CONDA_EXE" "$cmd" "$@" ;;
        esac
    fi
}

if [ -z "${CONDA_SHLVL+x}" ]; then
    \export CONDA_SHLVL=0
    PATH="$(dirname "$(dirname "$CONDA_EXE")")/condabin:${PATH:-}"
    \export PATH

    # We'\''re not allowing PS1 to be unbound. It must at least be set.
    # However, we'\''re not exporting it, which can cause problems when starting a second shell
    # via a first shell (i.e. starting zsh from bash).
    if [ -z "${PS1+x}" ]; then
        PS1=
    fi
fi


conda activate base'
++ export CONDA_EXE=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda
++ CONDA_EXE=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda
++ '[' -z '' ']'
++ export CONDA_SHLVL=0
++ CONDA_SHLVL=0
++++ dirname /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda
+++ dirname /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin
++ PATH=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper
++ export PATH
++ '[' -z '' ']'
++ PS1=
++ conda activate base
++ '[' 2 -lt 1 ']'
++ local cmd=activate
++ shift
++ case "$cmd" in
++ __conda_activate activate base
++ '[' -n '' ']'
++ local cmd=activate
++ shift
++ local ask_conda
+++ PS1=
+++ /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda shell.posix activate base
++ ask_conda='PS1='\''(base) '\''
\export CONDA_DEFAULT_ENV='\''base'\''
\export CONDA_EXE='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda'\''
\export CONDA_PREFIX='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2'\''
\export CONDA_PROMPT_MODIFIER='\''(base) '\''
\export CONDA_PYTHON_EXE='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/python'\''
\export CONDA_SHLVL='\''1'\''
\export PATH='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper'\'''
++ eval 'PS1='\''(base) '\''
\export CONDA_DEFAULT_ENV='\''base'\''
\export CONDA_EXE='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda'\''
\export CONDA_PREFIX='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2'\''
\export CONDA_PROMPT_MODIFIER='\''(base) '\''
\export CONDA_PYTHON_EXE='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/python'\''
\export CONDA_SHLVL='\''1'\''
\export PATH='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper'\'''
+++ PS1='(base) '
+++ export CONDA_DEFAULT_ENV=base
+++ CONDA_DEFAULT_ENV=base
+++ export CONDA_EXE=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda
+++ CONDA_EXE=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda
+++ export CONDA_PREFIX=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2
+++ CONDA_PREFIX=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2
+++ export 'CONDA_PROMPT_MODIFIER=(base) '
+++ CONDA_PROMPT_MODIFIER='(base) '
+++ export CONDA_PYTHON_EXE=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/python
+++ CONDA_PYTHON_EXE=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/python
+++ export CONDA_SHLVL=1
+++ CONDA_SHLVL=1
+++ export PATH=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper
+++ PATH=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper
++ __conda_hashr
++ '[' -n '' ']'
++ '[' -n '' ']'
++ hash -r
+ conda activate /uufs/chpc.utah.edu/common/home/u0055382/anaconda2
+ '[' 2 -lt 1 ']'
+ local cmd=activate
+ shift
+ case "$cmd" in
+ __conda_activate activate /uufs/chpc.utah.edu/common/home/u0055382/anaconda2
+ '[' -n '' ']'
+ local cmd=activate
+ shift
+ local ask_conda
++ PS1='(base) '
++ /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda shell.posix activate /uufs/chpc.utah.edu/common/home/u0055382/anaconda2
+ ask_conda='PS1='\''(base) '\''
\export CONDA_PROMPT_MODIFIER='\''(base) '\''
\export CONDA_SHLVL='\''1'\''
\export PATH='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper'\'''
+ eval 'PS1='\''(base) '\''
\export CONDA_PROMPT_MODIFIER='\''(base) '\''
\export CONDA_SHLVL='\''1'\''
\export PATH='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper'\'''
++ PS1='(base) '
++ export 'CONDA_PROMPT_MODIFIER=(base) '
++ CONDA_PROMPT_MODIFIER='(base) '
++ export CONDA_SHLVL=1
++ CONDA_SHLVL=1
++ export PATH=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper
++ PATH=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper
+ __conda_hashr
+ '[' -n '' ']'
+ '[' -n '' ']'
+ hash -r
+ source /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/.hg19-civic-post-link.sh
++ set -eo pipefail -o nounset
+++ conda info --root
+++ '[' 2 -lt 1 ']'
+++ local cmd=info
+++ shift
+++ case "$cmd" in
+++ /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda info --root
++ export CONDA_ROOT=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2
++ CONDA_ROOT=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2
+++ find /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/pkgs/ -name 'hg19-civic-1*'
+++ grep -v .tar.bz2
+++ grep '1-.*0$\|1\_.*0$'
++ PKG_DIR=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/pkgs/hg19-civic-1-0
++ export RECIPE_DIR=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/share/ggd/Homo_sapiens/hg19/hg19-civic/1
++ RECIPE_DIR=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/share/ggd/Homo_sapiens/hg19/hg19-civic/1
++ '[' -d /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/share/ggd/Homo_sapiens/hg19/hg19-civic/1 ']'
++ mkdir -p /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/share/ggd/Homo_sapiens/hg19/hg19-civic/1
++ recipe_env_name=ggd_hg19-civic
+++ echo ggd_hg19-civic
+++ sed s/-/_/g
++ recipe_env_name=ggd_hg19_civic
+++ conda info --envs
+++ grep '*'
+++ '[' 2 -lt 1 ']'
+++ local cmd=info
+++ shift
+++ case "$cmd" in
+++ /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda info --envs
+++ grep -o '\/.*'
++ env_dir=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2
++ activate_dir=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/etc/conda/activate.d
++ deactivate_dir=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/etc/conda/deactivate.d
++ mkdir -p /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/etc/conda/activate.d
++ mkdir -p /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/etc/conda/deactivate.d
++ echo 'export ggd_hg19_civic=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/share/ggd/Homo_sapiens/hg19/hg19-civic/1'
++ echo 'unset ggd_hg19_civic'
++ ggd show-env
++ cd /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/share/ggd/Homo_sapiens/hg19/hg19-civic/1
++ bash /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/pkgs/hg19-civic-1-0/info/recipe/recipe.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  498k  100  498k    0     0  1100k      0 --:--:-- --:--:-- --:--:-- 1103k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 73962  100 73962    0     0   419k      0 --:--:-- --:--:-- --:--:--  419k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 3281k  100 3281k    0     0  9483k      0 --:--:-- --:--:-- --:--:-- 9456k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   162  100   162    0     0    650      0 --:--:-- --:--:-- --:--:--   650
100  4122  100  4122    0     0   7926      0 --:--:-- --:--:-- --:--:--  7926
Traceback (most recent call last):
  File "merge_civic_files.py", line 8, in <module>
    gene_coords = open("../ensembl/sorted.ensembl.gene.coords", "r")
IOError: [Errno 2] No such file or directory: '../ensembl/sorted.ensembl.gene.coords'



===> REVERSING PACKAGE LINK: local::hg19-civic-1-0 <===
  prefix=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2


Could not remove or rename /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/.nfs000000010afff996000008c6.  Please remove this file manually (you may need to reboot to free file handles)

rsync: delete_file: unlink(.nfs000000010afff996000008c6) failed: Device or resource busy (16)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]
Removing folder /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin the fast way (with rsync) failed.  Do you have rsync available?

rm_rf failed for /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin

failed
An error occurred while installing package 'local::hg19-civic-1-0'.
LinkError: post-link script failed for package local::hg19-civic-1-0
running your command again with `-v` will provide additional information
location of failed script: /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/.hg19-civic-post-link.sh
==> script messages <==
<None>

Attempting to roll back.


Rolling back transaction: ...working... ===> REVERSING PACKAGE LINK: bioconda::gsort-0.0.6-1 <===
  prefix=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2


rsync: delete_file: unlink(.nfs000000010afff996000008c6) failed: Device or resource busy (16)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]
Removing folder /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin the fast way (with rsync) failed.  Do you have rsync available?

Could not remove or rename /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/.nfs000000010afff996000008c6.  Please remove this file manually (you may need to reboot to free file handles)

rsync: delete_file: unlink(.nfs000000010afff996000008c6) failed: Device or resource busy (16)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]
Removing folder /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin the fast way (with rsync) failed.  Do you have rsync available?

rm_rf failed for /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin

done
Traceback (most recent call last):
  File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/exceptions.py", line 1002, in __call__
    return func(*args, **kwargs)
  File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/cli/main.py", line 84, in _main
    exit_code = do_call(args, p)
  File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/cli/conda_argparse.py", line 82, in do_call
    exit_code = getattr(module, func_name)(args, parser)
  File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/cli/main_install.py", line 20, in execute
    install(args, parser, 'install')
  File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/cli/install.py", line 271, in install
    handle_txn(unlink_link_transaction, prefix, args, newenv)
  File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/cli/install.py", line 300, in handle_txn
    unlink_link_transaction.execute()
  File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/core/link.py", line 242, in execute
    self._execute(tuple(concat(interleave(itervalues(self.prefix_action_groups)))))
  File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/core/link.py", line 563, in _execute
    rollback_excs,
CondaMultiError: post-link script failed for package local::hg19-civic-1-0
running your command again with `-v` will provide additional information
location of failed script: /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/.hg19-civic-post-link.sh
==> script messages <==
<None>



Traceback (most recent call last):
  File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/ggd", line 11, in <module>
    
  File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/ggd/__main__.py", line 40, in main
    args.func(parser, args)
  File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/ggd/check_recipe.py", line 116, in check_recipe
    _install(bz2,str(recipe['package']['name']))
  File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/ggd/check_recipe.py", line 74, in _install
    stdout=sys.stdout)
  File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['conda', 'install', '-v', '--use-local', '-y', 'hg19-civic']' returned non-zero exit status 1

```

Note. The script states: 
``` 
Could not remove or rename /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/.nfs000000010afff996000008c6.  Please remove this file manually (you may need to reboot to free file handles)

rsync: delete_file: unlink(.nfs000000010afff996000008c6) failed: Device or resource busy (16)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]
Removing folder /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin the fast way (with rsync) failed.  Do you have rsync available?

rm_rf failed for /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin
```

however, the contents of anaconda2/bin was deleted. 



Discussion:
That's pretty bad. Sorry. Well fix this ASAP. Thanks for reporting.

On Mon, Feb 11, 2019, 17:07 Michael Cormier <notifications@github.com wrote:

> Current Behavior
>
> The files in the anaconda/bin directory were deleted when running `conda install` on a new local build of a recipe. When the recipe errors/fails conda tries to roll back. During the role back, rm_rf is called on the anaconda/bin folder. The complete contents of the folder are deleted. This is from conda 4.6.3
>
> Steps to Reproduce
>
> conda install --use-local  -v -y <recipe>
>
> Expected Behavior
>
> If conda install is unsuccessful conda should not remove the entire contents of the anaconda/bin folder.
>
> Environment Information `conda info`
>
> Not available. Unfortunetly, the conda binary is no longer available to run any conda command. But the conda version was 4.6.3
>
> `conda config --show-sources`
>
>  `conda list --show-channel-urls`
>
>  Output from the command
>
> No numpy version specified in conda_build_config.yaml.  Falling back to default numpy value of 1.11
> WARNING:conda_build.metadata:No numpy version specified in conda_build_config.yaml.  Falling back to default numpy value of 1.11
> INFO:conda_build.variants:Adding in variants from internal_defaults
> INFO:conda_build.metadata:Attempting to finalize metadata for hg19-civic
> WARNING: symlink_conda() is deprecated.
> INFO:conda_build.build:Packaging hg19-civic
> INFO:conda_build.build:Packaging hg19-civic-1-0
> No files or script found for output hg19-civic
> WARNING:conda_build.build:No files or script found for output hg19-civic
> /scratch/local/u0055382/tmp1fopUu/hg19-civic-1-0.tar.bz2: C1115 Found invalid license "None" in info/index.json
> /scratch/local/u0055382/tmp1fopUu/hg19-civic-1-0.tar.bz2: C1134 Found pre/post link file "bin/.hg19-civic-post-link.sh" in archive
> INFO:conda_build.variants:Adding in variants from /scratch/local/u0055382/tmpSvYdIK/info/recipe/conda_build_config.yaml
> Collecting package metadata: ...working... done
> Solving environment: ...working... done
> initializing UnlinkLinkTransaction with
>   target_prefix: /uufs/chpc.utah.edu/common/home/u0055382/anaconda2
>   unlink_precs:
>
>   link_precs:
>     bioconda::gsort-0.0.6-1
>     local::hg19-civic-1-0
>
>
>
> ## Package Plan ##
>
>   environment location: /uufs/chpc.utah.edu/common/home/u0055382/anaconda2
>
>   added / updated specs:
>     - hg19-civic
>
>
> The following packages will be downloaded:
>
>     package                    |            build
>     ---------------------------|-----------------
>     hg19-civic-1               |                0           6 KB  local
>     ------------------------------------------------------------
>                                            Total:           6 KB
>
> The following NEW packages will be INSTALLED:
>
>   gsort              bioconda/linux-64::gsort-0.0.6-1
>   hg19-civic         uufs/chpc.utah.edu/common/home/u0055382/anaconda2/conda-bld/noarch::hg19-civic-1-0
>
>
> Preparing transaction: ...working... done
> Verifying transaction: ...working... done
> Executing transaction: ...working... ===> LINKING PACKAGE: bioconda::gsort-0.0.6-1 <===
>   prefix=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2
>   source=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/pkgs/gsort-0.0.6-1
>
>
> ===> LINKING PACKAGE: local::hg19-civic-1-0 <===
>   prefix=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2
>   source=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/pkgs/hg19-civic-1-0
>
>
> $ bash -x /uufs/chpc.utah.edu/common/home/u0055382/anaconda2nTV9V8
> ==> cwd: /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin <==
> ==> exit code: 1 <==
> ==> stdout <==
> *****************************
>
> Inactive or out-of-date environment variables:
> > $ggd_hg19_civic
>
> To activate inactive or out-of-date vars, run:
> source activate base
>
> *****************************
>
> Retrieving the latest data downloads from CIViC
> Creating civic_genes, civic_gene_summaries, and civic_variants BED files
>
> ==> stderr <==
> + [[ hB != hxB ]]
> + XTRACE_STATE=-x
> + [[ hxB != hxB ]]
> + VERBOSE_STATE=+v
> + set +xv
> + unset XTRACE_STATE VERBOSE_STATE
> ++ /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda shell.posix hook
> + eval 'export CONDA_EXE="/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda"
> # Copyright (C) 2012 Anaconda, Inc
> # SPDX-License-Identifier: BSD-3-Clause
>
> __conda_hashr() {
>     if [ -n "${ZSH_VERSION:+x}" ]; then
>         \rehash
>     elif [ -n "${POSH_VERSION:+x}" ]; then
>         :  # pass
>     else
>         \hash -r
>     fi
> }
>
> __conda_activate() {
>     if [ -n "${CONDA_PS1_BACKUP:+x}" ]; then
>         # Handle transition from shell activated with conda <= 4.3 to a subsequent activation
>         # after conda updated to >= 4.4. See issue #6173.
>         PS1="$CONDA_PS1_BACKUP"
>         \unset CONDA_PS1_BACKUP
>     fi
>
>     \local cmd="$1"
>     shift
>     \local ask_conda
>     ask_conda="$(PS1="$PS1" "$CONDA_EXE" shell.posix "$cmd" "$@")" || \return $?
>     \eval "$ask_conda"
>     __conda_hashr
> }
>
> __conda_reactivate() {
>     \local ask_conda
>     ask_conda="$(PS1="$PS1" "$CONDA_EXE" shell.posix reactivate)" || \return $?
>     \eval "$ask_conda"
>     __conda_hashr
> }
>
> conda() {
>     if [ "$#" -lt 1 ]; then
>         "$CONDA_EXE"
>     else
>         \local cmd="$1"
>         shift
>         case "$cmd" in
>             activate|deactivate)
>                 __conda_activate "$cmd" "$@"
>                 ;;
>             install|update|upgrade|remove|uninstall)
>                 "$CONDA_EXE" "$cmd" "$@" && __conda_reactivate
>                 ;;
>             *) "$CONDA_EXE" "$cmd" "$@" ;;
>         esac
>     fi
> }
>
> if [ -z "${CONDA_SHLVL+x}" ]; then
>     \export CONDA_SHLVL=0
>     PATH="$(dirname "$(dirname "$CONDA_EXE")")/condabin:${PATH:-}"
>     \export PATH
>
>     # We'\''re not allowing PS1 to be unbound. It must at least be set.
>     # However, we'\''re not exporting it, which can cause problems when starting a second shell
>     # via a first shell (i.e. starting zsh from bash).
>     if [ -z "${PS1+x}" ]; then
>         PS1=
>     fi
> fi
>
>
> conda activate base'
> ++ export CONDA_EXE=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda
> ++ CONDA_EXE=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda
> ++ '[' -z '' ']'
> ++ export CONDA_SHLVL=0
> ++ CONDA_SHLVL=0
> ++++ dirname /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda
> +++ dirname /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin
> ++ PATH=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper
> ++ export PATH
> ++ '[' -z '' ']'
> ++ PS1=
> ++ conda activate base
> ++ '[' 2 -lt 1 ']'
> ++ local cmd=activate
> ++ shift
> ++ case "$cmd" in
> ++ __conda_activate activate base
> ++ '[' -n '' ']'
> ++ local cmd=activate
> ++ shift
> ++ local ask_conda
> +++ PS1=
> +++ /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda shell.posix activate base
> ++ ask_conda='PS1='\''(base) '\''
> \export CONDA_DEFAULT_ENV='\''base'\''
> \export CONDA_EXE='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda'\''
> \export CONDA_PREFIX='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2'\''
> \export CONDA_PROMPT_MODIFIER='\''(base) '\''
> \export CONDA_PYTHON_EXE='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/python'\''
> \export CONDA_SHLVL='\''1'\''
> \export PATH='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper'\'''
> ++ eval 'PS1='\''(base) '\''
> \export CONDA_DEFAULT_ENV='\''base'\''
> \export CONDA_EXE='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda'\''
> \export CONDA_PREFIX='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2'\''
> \export CONDA_PROMPT_MODIFIER='\''(base) '\''
> \export CONDA_PYTHON_EXE='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/python'\''
> \export CONDA_SHLVL='\''1'\''
> \export PATH='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper'\'''
> +++ PS1='(base) '
> +++ export CONDA_DEFAULT_ENV=base
> +++ CONDA_DEFAULT_ENV=base
> +++ export CONDA_EXE=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda
> +++ CONDA_EXE=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda
> +++ export CONDA_PREFIX=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2
> +++ CONDA_PREFIX=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2
> +++ export 'CONDA_PROMPT_MODIFIER=(base) '
> +++ CONDA_PROMPT_MODIFIER='(base) '
> +++ export CONDA_PYTHON_EXE=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/python
> +++ CONDA_PYTHON_EXE=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/python
> +++ export CONDA_SHLVL=1
> +++ CONDA_SHLVL=1
> +++ export PATH=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper
> +++ PATH=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper
> ++ __conda_hashr
> ++ '[' -n '' ']'
> ++ '[' -n '' ']'
> ++ hash -r
> + conda activate /uufs/chpc.utah.edu/common/home/u0055382/anaconda2
> + '[' 2 -lt 1 ']'
> + local cmd=activate
> + shift
> + case "$cmd" in
> + __conda_activate activate /uufs/chpc.utah.edu/common/home/u0055382/anaconda2
> + '[' -n '' ']'
> + local cmd=activate
> + shift
> + local ask_conda
> ++ PS1='(base) '
> ++ /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda shell.posix activate /uufs/chpc.utah.edu/common/home/u0055382/anaconda2
> + ask_conda='PS1='\''(base) '\''
> \export CONDA_PROMPT_MODIFIER='\''(base) '\''
> \export CONDA_SHLVL='\''1'\''
> \export PATH='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper'\'''
> + eval 'PS1='\''(base) '\''
> \export CONDA_PROMPT_MODIFIER='\''(base) '\''
> \export CONDA_SHLVL='\''1'\''
> \export PATH='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper'\'''
> ++ PS1='(base) '
> ++ export 'CONDA_PROMPT_MODIFIER=(base) '
> ++ CONDA_PROMPT_MODIFIER='(base) '
> ++ export CONDA_SHLVL=1
> ++ CONDA_SHLVL=1
> ++ export PATH=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper
> ++ PATH=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper
> + __conda_hashr
> + '[' -n '' ']'
> + '[' -n '' ']'
> + hash -r
> + source /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/.hg19-civic-post-link.sh
> ++ set -eo pipefail -o nounset
> +++ conda info --root
> +++ '[' 2 -lt 1 ']'
> +++ local cmd=info
> +++ shift
> +++ case "$cmd" in
> +++ /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda info --root
> ++ export CONDA_ROOT=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2
> ++ CONDA_ROOT=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2
> +++ find /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/pkgs/ -name 'hg19-civic-1*'
> +++ grep -v .tar.bz2
> +++ grep '1-.*0$\|1\_.*0$'
> ++ PKG_DIR=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/pkgs/hg19-civic-1-0
> ++ export RECIPE_DIR=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/share/ggd/Homo_sapiens/hg19/hg19-civic/1
> ++ RECIPE_DIR=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/share/ggd/Homo_sapiens/hg19/hg19-civic/1
> ++ '[' -d /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/share/ggd/Homo_sapiens/hg19/hg19-civic/1 ']'
> ++ mkdir -p /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/share/ggd/Homo_sapiens/hg19/hg19-civic/1
> ++ recipe_env_name=ggd_hg19-civic
> +++ echo ggd_hg19-civic
> +++ sed s/-/_/g
> ++ recipe_env_name=ggd_hg19_civic
> +++ conda info --envs
> +++ grep '*'
> +++ '[' 2 -lt 1 ']'
> +++ local cmd=info
> +++ shift
> +++ case "$cmd" in
> +++ /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda info --envs
> +++ grep -o '\/.*'
> ++ env_dir=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2
> ++ activate_dir=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/etc/conda/activate.d
> ++ deactivate_dir=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/etc/conda/deactivate.d
> ++ mkdir -p /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/etc/conda/activate.d
> ++ mkdir -p /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/etc/conda/deactivate.d
> ++ echo 'export ggd_hg19_civic=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/share/ggd/Homo_sapiens/hg19/hg19-civic/1'
> ++ echo 'unset ggd_hg19_civic'
> ++ ggd show-env
> ++ cd /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/share/ggd/Homo_sapiens/hg19/hg19-civic/1
> ++ bash /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/pkgs/hg19-civic-1-0/info/recipe/recipe.sh
>   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
>                                  Dload  Upload   Total   Spent    Left  Speed
> 100  498k  100  498k    0     0  1100k      0 --:--:-- --:--:-- --:--:-- 1103k
>   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
>                                  Dload  Upload   Total   Spent    Left  Speed
> 100 73962  100 73962    0     0   419k      0 --:--:-- --:--:-- --:--:--  419k
>   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
>                                  Dload  Upload   Total   Spent    Left  Speed
> 100 3281k  100 3281k    0     0  9483k      0 --:--:-- --:--:-- --:--:-- 9456k
>   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
>                                  Dload  Upload   Total   Spent    Left  Speed
> 100   162  100   162    0     0    650      0 --:--:-- --:--:-- --:--:--   650
> 100  4122  100  4122    0     0   7926      0 --:--:-- --:--:-- --:--:--  7926
> Traceback (most recent call last):
>   File "merge_civic_files.py", line 8, in <module>
>     gene_coords = open("../ensembl/sorted.ensembl.gene.coords", "r")
> IOError: [Errno 2] No such file or directory: '../ensembl/sorted.ensembl.gene.coords'
>
>
>
> ===> REVERSING PACKAGE LINK: local::hg19-civic-1-0 <===
>   prefix=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2
>
>
> Could not remove or rename /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/.nfs000000010afff996000008c6.  Please remove this file manually (you may need to reboot to free file handles)
>
> rsync: delete_file: unlink(.nfs000000010afff996000008c6) failed: Device or resource busy (16)
> rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]
> Removing folder /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin the fast way (with rsync) failed.  Do you have rsync available?
>
> rm_rf failed for /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin
>
> failed
> An error occurred while installing package 'local::hg19-civic-1-0'.
> LinkError: post-link script failed for package local::hg19-civic-1-0
> running your command again with `-v` will provide additional information
> location of failed script: /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/.hg19-civic-post-link.sh
> ==> script messages <==
> <None>
>
> Attempting to roll back.
>
>
> Rolling back transaction: ...working... ===> REVERSING PACKAGE LINK: bioconda::gsort-0.0.6-1 <===
>   prefix=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2
>
>
> rsync: delete_file: unlink(.nfs000000010afff996000008c6) failed: Device or resource busy (16)
> rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]
> Removing folder /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin the fast way (with rsync) failed.  Do you have rsync available?
>
> Could not remove or rename /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/.nfs000000010afff996000008c6.  Please remove this file manually (you may need to reboot to free file handles)
>
> rsync: delete_file: unlink(.nfs000000010afff996000008c6) failed: Device or resource busy (16)
> rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]
> Removing folder /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin the fast way (with rsync) failed.  Do you have rsync available?
>
> rm_rf failed for /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin
>
> done
> Traceback (most recent call last):
>   File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/exceptions.py", line 1002, in __call__
>     return func(*args, **kwargs)
>   File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/cli/main.py", line 84, in _main
>     exit_code = do_call(args, p)
>   File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/cli/conda_argparse.py", line 82, in do_call
>     exit_code = getattr(module, func_name)(args, parser)
>   File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/cli/main_install.py", line 20, in execute
>     install(args, parser, 'install')
>   File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/cli/install.py", line 271, in install
>     handle_txn(unlink_link_transaction, prefix, args, newenv)
>   File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/cli/install.py", line 300, in handle_txn
>     unlink_link_transaction.execute()
>   File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/core/link.py", line 242, in execute
>     self._execute(tuple(concat(interleave(itervalues(self.prefix_action_groups)))))
>   File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/core/link.py", line 563, in _execute
>     rollback_excs,
> CondaMultiError: post-link script failed for package local::hg19-civic-1-0
> running your command again with `-v` will provide additional information
> location of failed script: /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/.hg19-civic-post-link.sh
> ==> script messages <==
> <None>
>
>
>
> Traceback (most recent call last):
>   File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/ggd", line 11, in <module>
>
>   File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/ggd/__main__.py", line 40, in main
>     args.func(parser, args)
>   File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/ggd/check_recipe.py", line 116, in check_recipe
>     _install(bz2,str(recipe['package']['name']))
>   File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/ggd/check_recipe.py", line 74, in _install
>     stdout=sys.stdout)
>   File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/subprocess.py", line 190, in check_call
>     raise CalledProcessError(retcode, cmd)
> subprocess.CalledProcessError: Command '['conda', 'install', '-v', '--use-local', '-y', 'hg19-civic']' returned non-zero exit status 1
>
>
> Note. The script states:
>
> Could not remove or rename /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/.nfs000000010afff996000008c6.  Please remove this file manually (you may need to reboot to free file handles)
>
> rsync: delete_file: unlink(.nfs000000010afff996000008c6) failed: Device or resource busy (16)
> rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]
> Removing folder /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin the fast way (with rsync) failed.  Do you have rsync available?
>
> rm_rf failed for /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin
>
> however, the contents of anaconda2/bin was deleted.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/conda/conda/issues/8258>, or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AACV-c7InmuUJe5eeAV9s0j_Ks1CFmlxks5vMfehgaJpZM4a1Pvw>
> .
>

Sorry, I'm trying to make sense of this, but there's a lot of confusing information here:

1. It looks like you got into this by doing a conda build command:

```
No numpy version specified in conda_build_config.yaml.  Falling back to default numpy value of 1.11
WARNING:conda_build.metadata:No numpy version specified in conda_build_config.yaml.  Falling back to default numpy value of 1.11
INFO:conda_build.variants:Adding in variants from internal_defaults
INFO:conda_build.metadata:Attempting to finalize metadata for hg19-civic
WARNING: symlink_conda() is deprecated.
INFO:conda_build.build:Packaging hg19-civic
INFO:conda_build.build:Packaging hg19-civic-1-0
No files or script found for output hg19-civic
WARNING:conda_build.build:No files or script found for output hg19-civic
/scratch/local/u0055382/tmp1fopUu/hg19-civic-1-0.tar.bz2: C1115 Found invalid license "None" in info/index.json
/scratch/local/u0055382/tmp1fopUu/hg19-civic-1-0.tar.bz2: C1134 Found pre/post link file "bin/.hg19-civic-post-link.sh" in archive
INFO:conda_build.variants:Adding in variants from /scratch/local/u0055382/tmpSvYdIK/info/recipe/conda_build_config.yaml
```

2. Then it goes to install stuff in what looks like a base environment install.  I don't understand how the conda build command led to this.  There's no way that I know of to do that.

```
Solving environment: ...working... done
initializing UnlinkLinkTransaction with
  target_prefix: /uufs/chpc.utah.edu/common/home/u0055382/anaconda2
  unlink_precs:
    
  link_precs:
    bioconda::gsort-0.0.6-1
    local::hg19-civic-1-0



## Package Plan ##

  environment location: /uufs/chpc.utah.edu/common/home/u0055382/anaconda2

  added / updated specs:
    - hg19-civic


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    hg19-civic-1               |                0           6 KB  local
    ------------------------------------------------------------
                                           Total:           6 KB

The following NEW packages will be INSTALLED:

  gsort              bioconda/linux-64::gsort-0.0.6-1
  hg19-civic         uufs/chpc.utah.edu/common/home/u0055382/anaconda2/conda-bld/noarch::hg19-civic-1-0
```

Sorry, but we're going to need more info to make any sense of the situation.  What order of commands made this happen?
1) conda build is called to build a local conda package.

2) conda install is calles to install the local package created in step 1.

On Mon, Feb 11, 2019 at 4:57 PM Mike Sarahan <notifications@github.com>
wrote:

> Sorry, I'm trying to make sense of this, but there's a lot of confusing
> information here:
>
>    1. It looks like you got into this by doing a conda build command:
>
> No numpy version specified in conda_build_config.yaml.  Falling back to default numpy value of 1.11
> WARNING:conda_build.metadata:No numpy version specified in conda_build_config.yaml.  Falling back to default numpy value of 1.11
> INFO:conda_build.variants:Adding in variants from internal_defaults
> INFO:conda_build.metadata:Attempting to finalize metadata for hg19-civic
> WARNING: symlink_conda() is deprecated.
> INFO:conda_build.build:Packaging hg19-civic
> INFO:conda_build.build:Packaging hg19-civic-1-0
> No files or script found for output hg19-civic
> WARNING:conda_build.build:No files or script found for output hg19-civic
> /scratch/local/u0055382/tmp1fopUu/hg19-civic-1-0.tar.bz2: C1115 Found invalid license "None" in info/index.json
> /scratch/local/u0055382/tmp1fopUu/hg19-civic-1-0.tar.bz2: C1134 Found pre/post link file "bin/.hg19-civic-post-link.sh" in archive
> INFO:conda_build.variants:Adding in variants from /scratch/local/u0055382/tmpSvYdIK/info/recipe/conda_build_config.yaml
>
>
>    1. Then it goes to install stuff in what looks like a base environment
>    install. I don't understand how the conda build command led to this.
>    There's no way that I know of to do that.
>
> Solving environment: ...working... done
> initializing UnlinkLinkTransaction with
>   target_prefix: /uufs/chpc.utah.edu/common/home/u0055382/anaconda2
>   unlink_precs:
>
>   link_precs:
>     bioconda::gsort-0.0.6-1
>     local::hg19-civic-1-0
>
>
>
> ## Package Plan ##
>
>   environment location: /uufs/chpc.utah.edu/common/home/u0055382/anaconda2
>
>   added / updated specs:
>     - hg19-civic
>
>
> The following packages will be downloaded:
>
>     package                    |            build
>     ---------------------------|-----------------
>     hg19-civic-1               |                0           6 KB  local
>     ------------------------------------------------------------
>                                            Total:           6 KB
>
> The following NEW packages will be INSTALLED:
>
>   gsort              bioconda/linux-64::gsort-0.0.6-1
>   hg19-civic         uufs/chpc.utah.edu/common/home/u0055382/anaconda2/conda-bld/noarch::hg19-civic-1-0
>
> Sorry, but we're going to need more info to make any sense of the
> situation. What order of commands made this happen?
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/conda/conda/issues/8258#issuecomment-462544519>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AhmyhiKY6vWYH1-BX028RHType0G0Et4ks5vMgN9gaJpZM4a1Pvw>
> .
>

Here's the problem with what you're saying:

```
conda install --use-local  -v -y <recipe>
```

conda does not operate on recipes.  This command makes no sense.  Conda-build builds packages from recipes, and packages are what conda operates on.  Your command history does not show a conda-build command (only some output that looks like conda-build output), and it also does not show a ``conda install`` command (only output that looks like conda install output).  Please clarify what exactly you did.
My appoligies, it should be <pkg> rather than <recipe>. That is: conda
install --use-local -v -y <pkg>

I have a script that will run conda build on a recipe, and if the recipe is
successfully built into a package it will run conda install on the new
package. The actual commands are masked by the script that is running them,
but both conda build and conda install are being called.

On Mon, Feb 11, 2019 at 5:04 PM Mike Sarahan <notifications@github.com>
wrote:

> Here's the problem with what you're saying:
>
> conda install --use-local  -v -y <recipe>
>
> conda does not operate on recipes. This command makes no sense.
> Conda-build builds packages from recipes, and packages are what conda
> operates on. Your command history does not show a conda-build command (only
> some output that looks like conda-build output), and it also does not show
> a conda install command (only output that looks like conda install
> output). Please clarify what exactly you did.
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/conda/conda/issues/8258#issuecomment-462546196>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AhmyhtmuxMYp-tB6Zr3vxOkJFwf1suL6ks5vMgUegaJpZM4a1Pvw>
> .
>

Thanks, I've created a reproducer.  It removes the folder where the post-link script was - so $PREFIX/bin on unix, and %PREFIX%\Scripts on Windows.  I'll look into a fix and add a test.
This should fix it.  The problem is that the transaction thinks it created the folder (because it always tries to), so it should also try to remove it.

```
diff --git a/conda/core/path_actions.py b/conda/core/path_actions.py
index b6375c769..5fd15f082 100644
--- a/conda/core/path_actions.py
+++ b/conda/core/path_actions.py
@@ -6,7 +6,7 @@ from __future__ import absolute_import, division, print_function, unicode_litera
 from abc import ABCMeta, abstractmethod, abstractproperty
 from errno import EXDEV
 from logging import getLogger
-from os.path import basename, dirname, getsize, join
+from os.path import basename, dirname, getsize, join, isdir
 import re
 from uuid import uuid4

@@ -370,7 +370,8 @@ class LinkPathAction(CreateInPrefixPathAction):
     def reverse(self):
         if self._execute_successful:
             log.trace("reversing link creation %s", self.target_prefix)
-            rm_rf(self.target_full_path, clean_empty_parents=True)
+            if not isdir(self.target_full_path):
+                rm_rf(self.target_full_path, clean_empty_parents=True)


 class PrefixReplaceLinkAction(LinkPathAction):
@@ -975,7 +976,8 @@ class UnlinkPathAction(RemoveFromPrefixPathAction):
             backoff_rename(self.holding_full_path, self.target_full_path, force=True)

     def cleanup(self):
-        rm_rf(self.holding_full_path, clean_empty_parents=True)
+        if not isdir(self.holding_full_path):
+            rm_rf(self.holding_full_path, clean_empty_parents=True)


 class RemoveMenuAction(RemoveFromPrefixPathAction):
```

I'll put up a PR with the test package a little later.

Resolving patch:
diff --git a/conda/core/path_actions.py b/conda/core/path_actions.py
--- a/conda/core/path_actions.py
+++ b/conda/core/path_actions.py
@@ -6,7 +6,7 @@
 from abc import ABCMeta, abstractmethod, abstractproperty
 from errno import EXDEV
 from logging import getLogger
-from os.path import basename, dirname, getsize, join
+from os.path import basename, dirname, getsize, join, isdir
 import re
 from uuid import uuid4
 
@@ -32,7 +32,7 @@
                                     create_hard_link_or_copy, create_link,
                                     create_python_entry_point, extract_tarball,
                                     make_menu, mkdir_p, write_as_json_to_file)
-from ..gateways.disk.delete import rm_rf
+from ..gateways.disk.delete import rm_rf, path_is_clean
 from ..gateways.disk.permissions import make_writable
 from ..gateways.disk.read import (compute_md5sum, compute_sha256sum, islink, lexists,
                                   read_index_json)
@@ -370,7 +370,8 @@ def execute(self):
     def reverse(self):
         if self._execute_successful:
             log.trace("reversing link creation %s", self.target_prefix)
-            rm_rf(self.target_full_path, clean_empty_parents=True)
+            if not isdir(self.target_full_path) or path_is_clean(self.target_full_path):
+                rm_rf(self.target_full_path, clean_empty_parents=True)
 
 
 class PrefixReplaceLinkAction(LinkPathAction):
@@ -975,7 +976,8 @@ def reverse(self):
             backoff_rename(self.holding_full_path, self.target_full_path, force=True)
 
     def cleanup(self):
-        rm_rf(self.holding_full_path, clean_empty_parents=True)
+        if not isdir(self.holding_full_path) or path_is_clean(self.target_full_path):
+            rm_rf(self.holding_full_path, clean_empty_parents=True)
 
 
 class RemoveMenuAction(RemoveFromPrefixPathAction):


Test patch:
diff --git a/tests/test_create.py b/tests/test_create.py
--- a/tests/test_create.py
+++ b/tests/test_create.py
@@ -330,6 +330,15 @@ def test_create_install_update_remove_smoketest(self):
             assert not package_is_installed(prefix, 'flask')
             assert package_is_installed(prefix, 'python=3')
 
+    def test_install_broken_post_install_keeps_existing_folders(self):
+        # regression test for https://github.com/conda/conda/issues/8258
+        with make_temp_env("python=3.5") as prefix:
+            assert exists(join(prefix, BIN_DIRECTORY))
+            assert package_is_installed(prefix, 'python=3')
+
+            run_command(Commands.INSTALL, prefix, '-c', 'conda-test', 'failing_post_link', use_exception_handler=True)
+            assert exists(join(prefix, BIN_DIRECTORY))
+
     def test_safety_checks(self):
         # This test uses https://anaconda.org/conda-test/spiffy-test-app/0.5/download/noarch/spiffy-test-app-0.5-pyh6afbcc8_0.tar.bz2
         # which is a modification of https://anaconda.org/conda-test/spiffy-test-app/1.0/download/noarch/spiffy-test-app-1.0-pyh6afabb7_0.tar.bz2