Repository: conda/conda

Issue:
Solving environment: failed with current_repodata.json, will retry with next repodata source.  UnsatisfiableError:
<!--
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. -->
Cannot install or update packages when conda-forge is added

### Steps to Reproduce
<!-- If the current behaviour 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. -->
1. Install Anaconda3-2019.07-Windows-x86_64.exe (https://repo.continuum.io/archive/Anaconda3-2019.07-Windows-x86_64.exe)
2. Enable conda-forge
```
conda config --add channels conda-forge
conda config --set channel_priority strict
```
Here's what happens:
```
blim09@DESKTOP-J3L8E29:C:\Windows\system32 $ conda update --all
Collecting package metadata (current_repodata.json): done
Solving environment: failed with current_repodata.json, will retry with next repodata source.

UnsatisfiableError:

blim09@DESKTOP-J3L8E29:C:\Windows\system32 $
```
```
blim09@DESKTOP-J3L8E29:C:\Windows\system32 $ conda update --all --verbose
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... failed with current_repodata.json, will retry with next repodata source.
Traceback (most recent call last):
  File "C:\Users\blim09\Anaconda3\lib\site-packages\conda\exceptions.py", line 1062, in __call__
    return func(*args, **kwargs)
  File "C:\Users\blim09\Anaconda3\lib\site-packages\conda\cli\main.py", line 84, in _main
    exit_code = do_call(args, p)
  File "C:\Users\blim09\Anaconda3\lib\site-packages\conda\cli\conda_argparse.py", line 82, in do_call
    exit_code = getattr(module, func_name)(args, parser)
  File "C:\Users\blim09\Anaconda3\lib\site-packages\conda\cli\main_update.py", line 20, in execute
    install(args, parser, 'update')
  File "C:\Users\blim09\Anaconda3\lib\site-packages\conda\cli\install.py", line 307, in install
    raise e
  File "C:\Users\blim09\Anaconda3\lib\site-packages\conda\cli\install.py", line 256, in install
    force_reinstall=context.force_reinstall or context.force,
  File "C:\Users\blim09\Anaconda3\lib\site-packages\conda\core\solve.py", line 112, in solve_for_transaction
    force_remove, force_reinstall)
  File "C:\Users\blim09\Anaconda3\lib\site-packages\conda\core\solve.py", line 150, in solve_for_diff
    force_remove)
  File "C:\Users\blim09\Anaconda3\lib\site-packages\conda\core\solve.py", line 262, in solve_final_state
    ssc = self._run_sat(ssc)
  File "C:\Users\blim09\Anaconda3\lib\site-packages\conda\common\io.py", line 88, in decorated
    return f(*args, **kwds)
  File "C:\Users\blim09\Anaconda3\lib\site-packages\conda\core\solve.py", line 780, in _run_sat
    repodata_fn=self._repodata_fn)
  File "C:\Users\blim09\Anaconda3\lib\site-packages\conda\common\io.py", line 88, in decorated
    return f(*args, **kwds)
  File "C:\Users\blim09\Anaconda3\lib\site-packages\conda\resolve.py", line 1219, in solve
    raise UnsatisfiableError({})
conda.exceptions.UnsatisfiableError

blim09@DESKTOP-J3L8E29:C:\Windows\system32 $
```
Everything works correctly when conda-forge is removed
## Expected Behavior
<!-- What do you think should happen? -->
Packages should install or update normally

## Environment Information
<details open><summary><code>`conda info`</code></summary><p>
<!-- between the ticks below, paste the output of 'conda info' -->

```

     active environment: None
       user config file : C:\Users\blim09\.condarc
 populated config files : C:\Users\blim09\.condarc
          conda version : 4.7.10
    conda-build version : 3.18.9
         python version : 3.7.3.final.0
       virtual packages :
       base environment : C:\Users\blim09\Anaconda3  (writable)
           channel URLs : https://conda.anaconda.org/conda-forge/win-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\Users\blim09\Anaconda3\pkgs
                          C:\Users\blim09\.conda\pkgs
                          C:\Users\blim09\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\blim09\Anaconda3\envs
                          C:\Users\blim09\.conda\envs
                          C:\Users\blim09\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.7.10 requests/2.22.0 CPython/3.7.3 Windows/10 Windows/10.0.18362
          administrator : True
             netrc file : None
           offline mode : False

```
</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' -->

```
==> C:\Users\blim09\.condarc <==
channel_priority: strict
channels:
  - conda-forge
  - defaults

```
</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' -->

```
# packages in environment at C:\Users\blim09\Anaconda3:
#
# Name                    Version                   Build  Channel
_ipyw_jlab_nb_ext_conf    0.1.0                    py37_0    defaults
alabaster                 0.7.12                   py37_0    defaults
anaconda                  2019.07                  py37_0    defaults
anaconda-client           1.7.2                    py37_0    defaults
anaconda-navigator        1.9.7                    py37_0    defaults
anaconda-project          0.8.3                      py_0    defaults
asn1crypto                0.24.0                   py37_0    defaults
astroid                   2.2.5                    py37_0    defaults
astropy                   3.2.1            py37he774522_0    defaults
atomicwrites              1.3.0                    py37_1    defaults
attrs                     19.1.0                   py37_1    defaults
babel                     2.7.0                      py_0    defaults
backcall                  0.1.0                    py37_0    defaults
backports                 1.0                        py_2    defaults
backports.functools_lru_cache 1.5                        py_2    defaults
backports.os              0.1.1                    py37_0    defaults
backports.shutil_get_terminal_size 1.0.0                    py37_2    defaults
backports.tempfile        1.0                        py_1    defaults
backports.weakref         1.0.post1                  py_1    defaults
beautifulsoup4            4.7.1                    py37_1    defaults
bitarray                  0.9.3            py37he774522_0    defaults
bkcharts                  0.2                      py37_0    defaults
blas                      1.0                         mkl    defaults
bleach                    3.1.0                    py37_0    defaults
blosc                     1.16.3               h7bd577a_0    defaults
bokeh                     1.2.0                    py37_0    defaults
boto                      2.49.0                   py37_0    defaults
bottleneck                1.2.1            py37h452e1ab_1    defaults
bzip2                     1.0.8                he774522_0    defaults
ca-certificates           2019.5.15                     0    defaults
certifi                   2019.6.16                py37_0    defaults
cffi                      1.12.3           py37h7a1dbc1_0    defaults
chardet                   3.0.4                    py37_1    defaults
click                     7.0                      py37_0    defaults
cloudpickle               1.2.1                      py_0    defaults
clyent                    1.2.2                    py37_1    defaults
colorama                  0.4.1                    py37_0    defaults
comtypes                  1.1.7                    py37_0    defaults
conda                     4.7.10                   py37_0    defaults
conda-build               3.18.9                   py37_0    defaults
conda-env                 2.6.0                         1    defaults
conda-package-handling    1.3.11                   py37_0    defaults
conda-verify              3.4.2                      py_1    defaults
console_shortcut          0.1.1                         3    defaults
contextlib2               0.5.5                    py37_0    defaults
cryptography              2.7              py37h7a1dbc1_0    defaults
curl                      7.65.2               h2a8f88b_0    defaults
cycler                    0.10.0                   py37_0    defaults
cython                    0.29.12          py37ha925a31_0    defaults
cytoolz                   0.10.0           py37he774522_0    defaults
dask                      2.1.0                      py_0    defaults
dask-core                 2.1.0                      py_0    defaults
decorator                 4.4.0                    py37_1    defaults
defusedxml                0.6.0                      py_0    defaults
distributed               2.1.0                      py_0    defaults
docutils                  0.14                     py37_0    defaults
entrypoints               0.3                      py37_0    defaults
et_xmlfile                1.0.1                    py37_0    defaults
fastcache                 1.1.0            py37he774522_0    defaults
filelock                  3.0.12                     py_0    defaults
flask                     1.1.1                      py_0    defaults
freetype                  2.9.1                ha9979f8_1    defaults
future                    0.17.1                   py37_0    defaults
get_terminal_size         1.0.0                h38e98db_0    defaults
gevent                    1.4.0            py37he774522_0    defaults
glob2                     0.7                        py_0    defaults
greenlet                  0.4.15           py37hfa6e2cd_0    defaults
h5py                      2.9.0            py37h5e291fa_0    defaults
hdf5                      1.10.4               h7ebc959_0    defaults
heapdict                  1.0.0                    py37_2    defaults
html5lib                  1.0.1                    py37_0    defaults
icc_rt                    2019.0.0             h0cc432a_1    defaults
icu                       58.2                 ha66f8fd_1    defaults
idna                      2.8                      py37_0    defaults
imageio                   2.5.0                    py37_0    defaults
imagesize                 1.1.0                    py37_0    defaults
importlib_metadata        0.17                     py37_1    defaults
intel-openmp              2019.4                      245    defaults
ipykernel                 5.1.1            py37h39e3cac_0    defaults
ipython                   7.6.1            py37h39e3cac_0    defaults
ipython_genutils          0.2.0                    py37_0    defaults
ipywidgets                7.5.0                      py_0    defaults
isort                     4.3.21                   py37_0    defaults
itsdangerous              1.1.0                    py37_0    defaults
jdcal                     1.4.1                      py_0    defaults
jedi                      0.13.3                   py37_0    defaults
jinja2                    2.10.1                   py37_0    defaults
joblib                    0.13.2                   py37_0    defaults
jpeg                      9b                   hb83a4c4_2    defaults
json5                     0.8.4                      py_0    defaults
jsonschema                3.0.1                    py37_0    defaults
jupyter                   1.0.0                    py37_7    defaults
jupyter_client            5.3.1                      py_0    defaults
jupyter_console           6.0.0                    py37_0    defaults
jupyter_core              4.5.0                      py_0    defaults
jupyterlab                1.0.2            py37hf63ae98_0    defaults
jupyterlab_server         1.0.0                      py_0    defaults
keyring                   18.0.0                   py37_0    defaults
kiwisolver                1.1.0            py37ha925a31_0    defaults
krb5                      1.16.1               hc04afaa_7    defaults
lazy-object-proxy         1.4.1            py37he774522_0    defaults
libarchive                3.3.3                h0643e63_5    defaults
libcurl                   7.65.2               h2a8f88b_0    defaults
libiconv                  1.15                 h1df5818_7    defaults
liblief                   0.9.0                ha925a31_2    defaults
libpng                    1.6.37               h2a8f88b_0    defaults
libsodium                 1.0.16               h9d3ae62_0    defaults
libssh2                   1.8.2                h7a1dbc1_0    defaults
libtiff                   4.0.10               hb898794_2    defaults
libxml2                   2.9.9                h464c3ec_0    defaults
libxslt                   1.1.33               h579f668_0    defaults
llvmlite                  0.29.0           py37ha925a31_0    defaults
locket                    0.2.0                    py37_1    defaults
lxml                      4.3.4            py37h1350720_0    defaults
lz4-c                     1.8.1.2              h2fa13f4_0    defaults
lzo                       2.10                 h6df0209_2    defaults
m2w64-gcc-libgfortran     5.3.0                         6    defaults
m2w64-gcc-libs            5.3.0                         7    defaults
m2w64-gcc-libs-core       5.3.0                         7    defaults
m2w64-gmp                 6.1.0                         2    defaults
m2w64-libwinpthread-git   5.0.0.4634.697f757               2    defaults
markupsafe                1.1.1            py37he774522_0    defaults
matplotlib                3.1.0            py37hc8f65d3_0    defaults
mccabe                    0.6.1                    py37_1    defaults
menuinst                  1.4.16           py37he774522_0    defaults
mistune                   0.8.4            py37he774522_0    defaults
mkl                       2019.4                      245    defaults
mkl-service               2.0.2            py37he774522_0    defaults
mkl_fft                   1.0.12           py37h14836fe_0    defaults
mkl_random                1.0.2            py37h343c172_0    defaults
mock                      3.0.5                    py37_0    defaults
more-itertools            7.0.0                    py37_0    defaults
mpmath                    1.1.0                    py37_0    defaults
msgpack-python            0.6.1            py37h74a9793_1    defaults
msys2-conda-epoch         20160418                      1    defaults
multipledispatch          0.6.0                    py37_0    defaults
navigator-updater         0.2.1                    py37_0    defaults
nbconvert                 5.5.0                      py_0    defaults
nbformat                  4.4.0                    py37_0    defaults
networkx                  2.3                        py_0    defaults
nltk                      3.4.4                    py37_0    defaults
nose                      1.3.7                    py37_2    defaults
notebook                  6.0.0                    py37_0    defaults
numba                     0.44.1           py37hf9181ef_0    defaults
numexpr                   2.6.9            py37hdce8814_0    defaults
numpy                     1.16.4           py37h19fb1c0_0    defaults
numpy-base                1.16.4           py37hc3f5095_0    defaults
numpydoc                  0.9.1                      py_0    defaults
olefile                   0.46                     py37_0    defaults
openpyxl                  2.6.2                      py_0    defaults
openssl                   1.1.1c               he774522_1    defaults
packaging                 19.0                     py37_0    defaults
pandas                    0.24.2           py37ha925a31_0    defaults
pandoc                    2.2.3.2                       0    defaults
pandocfilters             1.4.2                    py37_1    defaults
parso                     0.5.0                      py_0    defaults
partd                     1.0.0                      py_0    defaults
path.py                   12.0.1                     py_0    defaults
pathlib2                  2.3.4                    py37_0    defaults
patsy                     0.5.1                    py37_0    defaults
pep8                      1.7.1                    py37_0    defaults
pickleshare               0.7.5                    py37_0    defaults
pillow                    6.1.0            py37hdc69c19_0    defaults
pip                       19.1.1                   py37_0    defaults
pkginfo                   1.5.0.1                  py37_0    defaults
pluggy                    0.12.0                     py_0    defaults
ply                       3.11                     py37_0    defaults
powershell_shortcut       0.0.1                         2    defaults
prometheus_client         0.7.1                      py_0    defaults
prompt_toolkit            2.0.9                    py37_0    defaults
psutil                    5.6.3            py37he774522_0    defaults
py                        1.8.0                    py37_0    defaults
py-lief                   0.9.0            py37ha925a31_2    defaults
pycodestyle               2.5.0                    py37_0    defaults
pycosat                   0.6.3            py37hfa6e2cd_0    defaults
pycparser                 2.19                     py37_0    defaults
pycrypto                  2.6.1            py37hfa6e2cd_9    defaults
pycurl                    7.43.0.3         py37h7a1dbc1_0    defaults
pyflakes                  2.1.1                    py37_0    defaults
pygments                  2.4.2                      py_0    defaults
pylint                    2.3.1                    py37_0    defaults
pyodbc                    4.0.26           py37ha925a31_0    defaults
pyopenssl                 19.0.0                   py37_0    defaults
pyparsing                 2.4.0                      py_0    defaults
pyqt                      5.9.2            py37h6538335_2    defaults
pyreadline                2.1                      py37_1    defaults
pyrsistent                0.14.11          py37he774522_0    defaults
pysocks                   1.7.0                    py37_0    defaults
pytables                  3.5.2            py37h1da0976_1    defaults
pytest                    5.0.1                    py37_0    defaults
pytest-arraydiff          0.3              py37h39e3cac_0    defaults
pytest-astropy            0.5.0                    py37_0    defaults
pytest-doctestplus        0.3.0                    py37_0    defaults
pytest-openfiles          0.3.2                    py37_0    defaults
pytest-remotedata         0.3.1                    py37_0    defaults
python                    3.7.3                h8c8aaf0_1    defaults
python-dateutil           2.8.0                    py37_0    defaults
python-libarchive-c       2.8                     py37_11    defaults
pytz                      2019.1                     py_0    defaults
pywavelets                1.0.3            py37h8c2d366_1    defaults
pywin32                   223              py37hfa6e2cd_1    defaults
pywinpty                  0.5.5                 py37_1000    defaults
pyyaml                    5.1.1            py37he774522_0    defaults
pyzmq                     18.0.0           py37ha925a31_0    defaults
qt                        5.9.7            vc14h73c81de_0    defaults
qtawesome                 0.5.7                    py37_1    defaults
qtconsole                 4.5.1                      py_0    defaults
qtpy                      1.8.0                      py_0    defaults
requests                  2.22.0                   py37_0    defaults
rope                      0.14.0                     py_0    defaults
ruamel_yaml               0.15.46          py37hfa6e2cd_0    defaults
scikit-image              0.15.0           py37ha925a31_0    defaults
scikit-learn              0.21.2           py37h6288b17_0    defaults
scipy                     1.2.1            py37h29ff71c_0    defaults
seaborn                   0.9.0                    py37_0    defaults
send2trash                1.5.0                    py37_0    defaults
setuptools                41.0.1                   py37_0    defaults
simplegeneric             0.8.1                    py37_2    defaults
singledispatch            3.4.0.3                  py37_0    defaults
sip                       4.19.8           py37h6538335_0    defaults
six                       1.12.0                   py37_0    defaults
snappy                    1.1.7                h777316e_3    defaults
snowballstemmer           1.9.0                      py_0    defaults
sortedcollections         1.1.2                    py37_0    defaults
sortedcontainers          2.1.0                    py37_0    defaults
soupsieve                 1.8                      py37_0    defaults
sphinx                    2.1.2                      py_0    defaults
sphinxcontrib             1.0                      py37_1    defaults
sphinxcontrib-applehelp   1.0.1                      py_0    defaults
sphinxcontrib-devhelp     1.0.1                      py_0    defaults
sphinxcontrib-htmlhelp    1.0.2                      py_0    defaults
sphinxcontrib-jsmath      1.0.1                      py_0    defaults
sphinxcontrib-qthelp      1.0.2                      py_0    defaults
sphinxcontrib-serializinghtml 1.1.3                      py_0    defaults
sphinxcontrib-websupport  1.1.2                      py_0    defaults
spyder                    3.3.6                    py37_0    defaults
spyder-kernels            0.5.1                    py37_0    defaults
sqlalchemy                1.3.5            py37he774522_0    defaults
sqlite                    3.29.0               he774522_0    defaults
statsmodels               0.10.0           py37h8c2d366_0    defaults
sympy                     1.4                      py37_0    defaults
tblib                     1.4.0                      py_0    defaults
terminado                 0.8.2                    py37_0    defaults
testpath                  0.4.2                    py37_0    defaults
tk                        8.6.8                hfa6e2cd_0    defaults
toolz                     0.10.0                     py_0    defaults
tornado                   6.0.3            py37he774522_0    defaults
tqdm                      4.32.1                     py_0    defaults
traitlets                 4.3.2                    py37_0    defaults
unicodecsv                0.14.1                   py37_0    defaults
urllib3                   1.24.2                   py37_0    defaults
vc                        14.1                 h0510ff6_4    defaults
vs2015_runtime            14.15.26706          h3a45250_4    defaults
wcwidth                   0.1.7                    py37_0    defaults
webencodings              0.5.1                    py37_1    defaults
werkzeug                  0.15.4                     py_0    defaults
wheel                     0.33.4                   py37_0    defaults
widgetsnbextension        3.5.0                    py37_0    defaults
win_inet_pton             1.1.0                    py37_0    defaults
win_unicode_console       0.5                      py37_0    defaults
wincertstore              0.2                      py37_0    defaults
winpty                    0.4.3                         4    defaults
wrapt                     1.11.2           py37he774522_0    defaults
xlrd                      1.2.0                    py37_0    defaults
xlsxwriter                1.1.8                      py_0    defaults
xlwings                   0.15.8                   py37_0    defaults
xlwt                      1.3.0                    py37_0    defaults
xz                        5.2.4                h2fa13f4_4    defaults
yaml                      0.1.7                hc54c509_2    defaults
zeromq                    4.3.1                h33f27b4_3    defaults
zict                      1.0.0                      py_0    defaults
zipp                      0.5.1                      py_0    defaults
zlib                      1.2.11               h62dcd97_3    defaults
zstd                      1.3.7                h508b16e_0    defaults
```
</p></details>



Discussion:

Resolving patch:
diff --git a/conda/cli/install.py b/conda/cli/install.py
--- a/conda/cli/install.py
+++ b/conda/cli/install.py
@@ -229,6 +229,8 @@ def install(args, parser, command='install'):
     elif REPODATA_FN not in repodata_fns:
         repodata_fns.append(REPODATA_FN)
 
+    args_set_update_modifier = hasattr(args, "update_modifier") and args.update_modifier != NULL
+
     for repodata_fn in repodata_fns:
         try:
             update_modifier = context.update_modifier
@@ -281,9 +283,12 @@ def install(args, parser, command='install'):
             if not hasattr(args, 'update_modifier'):
                 if repodata_fn == repodata_fns[-1]:
                     raise e
-            elif args.update_modifier == NULL:
+            elif not args_set_update_modifier or args.update_modifier not in (
+                    UpdateModifier.FREEZE_INSTALLED,
+                    UpdateModifier.UPDATE_SPECS):
                 try:
-                    if not args.json:
+                    if not args.json and (not args_set_update_modifier or
+                                          args.update_modifier == UpdateModifier.FREEZE_INSTALLED):
                         print("Initial quick solve with frozen env failed.  "
                               "Unfreezing env and trying again.")
                     unlink_link_transaction = solver.solve_for_transaction(
diff --git a/conda/core/solve.py b/conda/core/solve.py
--- a/conda/core/solve.py
+++ b/conda/core/solve.py
@@ -195,8 +195,10 @@ def solve_final_state(self, update_modifier=NULL, deps_modifier=NULL, prune=NULL
                 the solved state of the environment.
 
         """
+        update_modifier_set = True
         if update_modifier is NULL:
             update_modifier = context.update_modifier
+            update_modifier_set = False
         else:
             update_modifier = UpdateModifier(text_type(update_modifier).lower())
         if deps_modifier is NULL:
@@ -248,8 +250,14 @@ def solve_final_state(self, update_modifier=NULL, deps_modifier=NULL, prune=NULL
                          context.json):
                 ssc = self._collect_all_metadata(ssc)
 
-        fail_message = ("failed\n" if self._repodata_fn == REPODATA_FN else "failed with %s, "
-                        "will retry with next repodata source.\n" % self._repodata_fn)
+        if not update_modifier_set or update_modifier != UpdateModifier.UPDATE_SPECS:
+            fail_message = "failed with initial frozen solve. Retrying with flexible solve.\n"
+        elif self._repodata_fn != REPODATA_FN:
+            fail_message = ("failed with repodata from %s, will retry with next repodata"
+                            " source.\n" % self._repodata_fn)
+        else:
+            fail_message = "failed\n"
+
         with Spinner("Solving environment", not context.verbosity and not context.quiet,
                      context.json, fail_message=fail_message):
             ssc = self._remove_specs(ssc)


Test patch: