Repository: conan-io/conan

Issue:
ERROR: not enough values to unpack (expected 4, got 1) on conan create
Tools I'm using:
Conan 1.14.0
CMake 3.14.0
Visual Studio Community 2017 15.9.10
Windows 10 1809 64-bit

Steps to reproduce:
git clone https://gitlab.com/ssrobins/conan-zlib.git
cd conan-zlib
build_windows.bat

I get this error:

`ERROR: not enough values to unpack (expected 4, got 1)
Traceback (most recent call last):
  File "C:\Users\Steve\AppData\Local\Programs\Python\Python37\Scripts\conan-script.py", line 11, in <module>
    load_entry_point('conan==1.14.0', 'console_scripts', 'conan')()
  File "c:\users\steve\appdata\local\programs\python\python37\lib\site-packages\conans\conan.py", line 7, in run
    main(sys.argv[1:])
  File "c:\users\steve\appdata\local\programs\python\python37\lib\site-packages\conans\client\command.py", line 1698, in main
    conan_api, cache, user_io = Conan.factory()
  File "c:\users\steve\appdata\local\programs\python\python37\lib\site-packages\conans\client\conan_api.py", line 194, in factory
    cache = migrate_and_get_cache(user_home, out)
  File "c:\users\steve\appdata\local\programs\python\python37\lib\site-packages\conans\client\conan_api.py", line 1188, in migrate_and_get_cache
    migrator.migrate()
  File "c:\users\steve\appdata\local\programs\python\python37\lib\site-packages\conans\migrations.py", line 23, in migrate
    self._make_migrations(old_version)
  File "c:\users\steve\appdata\local\programs\python\python37\lib\site-packages\conans\client\migrations.py", line 55, in _make_migrations
    migrate_config_install(self.cache)
  File "c:\users\steve\appdata\local\programs\python\python37\lib\site-packages\conans\client\migrations.py", line 228, in migrate_config_install
    config_type, uri, verify_ssl, args = [r.strip() for r in item.split(",")]
ValueError: not enough values to unpack (expected 4, got 1)`

If I downgrade to the previous version:
pip3 install conan==1.13.3

And re-run build_windows.bat, the package is created with no errors.

Back on 1.14.0, if I move the .conan folder and let it get re-created, it works fine.  I did keep the old config folder in case there's something I can share with you to help troubleshoot.  Everything is working for me now so if you'd prefer to close this, I won't complain :)


Discussion:
Hi @ssrobins 

Yes, this seems a bug in the migration to the new ``conan config install`` storage. I am going to check it and release a fix asap, but if you have there the contents of your old ``.conan/conan.conf`` file (only the ``config-install`` information, that would help. Thanks!

Also, what is the version of Conan you are upgrading from. It seems that the migration should work when migrating from Conan 1.11, but older conans, that might be the issue.
Yes, seems that in Conan 1.9.0, the line stored in ``conan.conf`` is:

```
config_install = https://github.com/memsharded/config_test/archive/v0.1.zip
```

Instead of the 4 args:
```
config_install = url, https://github.com/memsharded/config_test/archive/v0.1.zip, True, None
```


Resolving patch:
diff --git a/conans/client/migrations.py b/conans/client/migrations.py
--- a/conans/client/migrations.py
+++ b/conans/client/migrations.py
@@ -225,7 +225,16 @@ def _migrate_lock_files(cache, out):
 def migrate_config_install(cache):
     try:
         item = cache.config.get_item("general.config_install")
-        config_type, uri, verify_ssl, args = [r.strip() for r in item.split(",")]
+        items = [r.strip() for r in item.split(",")]
+        if len(items) == 4:
+            config_type, uri, verify_ssl, args = items
+        elif len(items) == 1:
+            uri = items[0]
+            verify_ssl = "True"
+            args = "None"
+            config_type = None
+        else:
+            raise Exception("I don't know how to migrate this config install: %s" % items)
         verify_ssl = "true" in verify_ssl.lower()
         args = None if "none" in args.lower() else args
         config = _ConfigOrigin.from_item(uri, config_type, verify_ssl, args, None, None)


Test patch: