Repository: conan-io/conan

Issue:
Question: What does "ERROR: . [Remote: ci]" mean?
To help us debug your issue please explain:

- [x] I've read the [CONTRIBUTING guide](https://raw.githubusercontent.com/conan-io/conan/develop/.github/CONTRIBUTING.md).
- [x] I've specified the Conan version, operating system version and any tool that can be relevant.
- [ ] I've explained the steps to reproduce the error or the motivation/use case of the question/suggestion.

Conan v1.0.2

I have no idea what Conan is trying to tell me here.

```
david@balrog:~$ conan install freeopcua/1.8.0@wsbu/stable --build missing --build outdated --update
freeopcua/1.8.0@wsbu/stable: Installing package
Requirements
    Boost/1.64.0@wsbu/stable from ci
    bzip2/1.0.6@conan/stable from conan-center
    freeopcua/1.8.0@wsbu/stable from ci
    googletest/1.8.0@wsbu/stable from ci
    zlib/1.2.11@conan/stable from conan-center
Packages
    Boost/1.64.0@wsbu/stable:ab6671ce24bf75c2739ef669ce2a5887ea6a745f
    bzip2/1.0.6@conan/stable:d50a0d523d98c15bb147b18fa7d203887c38be8b
    freeopcua/1.8.0@wsbu/stable:7dc92a71d100e411d973b9f63ddf97d50edbb291
    googletest/1.8.0@wsbu/stable:27cb7fbffba1a5268eda91c4da54b0254d48c3b1
    zlib/1.2.11@conan/stable:6ae331b72e7e265ca2a3d1d8246faf73aa030238

bzip2/1.0.6@conan/stable: Package is up to date
googletest/1.8.0@wsbu/stable: Package is up to date
zlib/1.2.11@conan/stable: Package is up to date
Boost/1.64.0@wsbu/stable: Package is up to date
bzip2/1.0.6@conan/stable: Already installed!
googletest/1.8.0@wsbu/stable: Already installed!
zlib/1.2.11@conan/stable: WARN: Current package is newer than remote upstream one
zlib/1.2.11@conan/stable: Already installed!
Boost/1.64.0@wsbu/stable: Already installed!
Boost/1.64.0@wsbu/stable: WARN: Use 'self.collect_libs' is deprecated, use tools.collect_libs(self) instead
Boost/1.64.0@wsbu/stable: LIBRARIES: ['boost_graph', 'boost_math_tr1f', 'boost_chrono', 'boost_program_options', 'boost_unit_test_framework', 'boost_iostreams', 'boost_serialization', 'boost_random', 'boost_system', 'boost_wserialization', 'boost_regex', 'boost_signals', 'boost_math_tr1', 'boost_timer', 'boost_atomic', 'boost_log_setup', 'boost_locale', 'boost_coroutine', 'boost_type_erasure', 'boost_math_c99l', 'boost_test_exec_monitor', 'boost_fiber', 'boost_prg_exec_monitor', 'boost_log', 'boost_filesystem', 'boost_math_c99', 'boost_math_c99f', 'boost_wave', 'boost_math_tr1l', 'boost_container', 'boost_date_time', 'boost_context', 'boost_exception', 'boost_thread']
ERROR: . [Remote: ci]
david@balrog:~$ 
```


Discussion:
Looks like it was mad because the package did not exist in any remote (I had the wrong version number). Strange error message though. I'm going to leave this open because I think that error message might be considered a bug.
I haven't been able to reproduce this error. When I try to install a dependency (wrong version number for example), that doesn't exist, the error message is more clear:

```bash
conan install jsonformoderncpp/2.1.2@vthiery/stable -r=conan-center
jsonformoderncpp/2.1.2@vthiery/stable: Not found, retrieving from server 'conan-center'
jsonformoderncpp/2.1.2@vthiery/stable: Trying with 'conan-center'...
ERROR: Request for path: vthiery/jsonformoderncpp/2.1.2/stable/export Not Found. [Remote: conan-center]
```

Can you please tell how to reproduce or come up with a smaller example? Many thanks
Took me a while to find the right steps, but I managed:

```
david@balrog:~/tmp$ rm -rf ~/.conan/data/Foo/
david@balrog:~/tmp$ conan install Foo/0.0.1@wsbu/testing
Foo/0.0.1@wsbu/testing: Retrieving from predefined remote 'ci'
Foo/0.0.1@wsbu/testing: Trying with 'ci'...
ERROR: . [Remote: ci]
david@balrog:~/tmp$ 
```

If you remove the contents of a package both locally and in the remote but leave it in the registry, Conan doesn't like it.
I have not been able to reproduce. Is ``Foo/0.0.1@wsbu/testing`` the same package that you had in the local cache? I can do the above,  and will get the dependency downloaded from the remote.

Also, the conan local cache cannot be removed that way. Please use ``conan remove``, otherwise, the consistency of the data is broken (mainly the ``registry.txt`` file goes out of sync with the cache). Any reason for not using ``conan remove``? Thanks
#2410  confirms this. It indeed seems an issue. Help to reproduce it is much appreciated.
Okay, sorry about that. I'll try to reproduce this from an Ubuntu 16.04 Docker image and then give you the commands I used. 
Here you go. Note two things: I do invoke vim at one point, and that is only to give global write permission for the conan server. I also immediately kill the conan server after starting it the first time. That just gets the default configuration in place before adding the writing permissions.

Also, all the `>> /dev/null` is used so that I could copy/paste exactly the commands that I invoked without going crazy on this post.

```
david@balrog:~$ docker run -it --rm ubuntu:16.04
root@f6e79fb88d4c:/# apt-get update >> /dev/null
root@f6e79fb88d4c:/# apt-get install --yes python-pip git-core cmake vim >> /dev/null
debconf: delaying package configuration, since apt-utils is not installed
root@f6e79fb88d4c:/# pip install conan >> /dev/null
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
root@f6e79fb88d4c:/# conan --version
Conan version 1.0.4 
root@ff3be56f7147:/# conan_server     
Bottle v0.12.13 server starting up (using WSGIRefServer())...
Listening on http://0.0.0.0:9300/
Hit Ctrl-C to quit.

^Croot@ff3be56f7147:/# vim /root/.conan_server/server.conf
root@ff3be56f7147:/# conan_server 2&>1 &
[1] 4413
root@f6e79fb88d4c:/# conan remote add local http://0.0.0.0:9300
WARN: Remotes registry file missing, creating default one in /root/.conan/registry.txt
root@ff3be56f7147:/# conan user -r local -p demo demo
Change 'local' user from None (anonymous) to demo
root@f6e79fb88d4c:/# conan new Hello/1.0 
File saved: conanfile.py
root@f6e79fb88d4c:/# conan create . foo/bar 2>&1 >> /dev/null
root@f6e79fb88d4c:/# conan search
Existing package recipes:

Hello/1.0@foo/bar
root@f6e79fb88d4c:/# conan upload -r local Hello/1.0@foo/bar
Uploading Hello/1.0@foo/bar
Uploading conanmanifest.txt                                           
[==================================================] 58B/58B          
Uploading conanfile.py                                                
[==================================================] 1.6KB/1.6KB      
Uploaded conan recipe 'Hello/1.0@foo/bar' to 'local': http://0.0.0.0:9300
root@f6e79fb88d4c:~# rm -rf /root/.conan/data/Hello     
root@f6e79fb88d4c:~# rm -rf /root/.conan_server/data/Hello
root@f6e79fb88d4c:~# conan install Hello/1.0@foo/bar
Hello/1.0@foo/bar: Retrieving from predefined remote 'local'
Hello/1.0@foo/bar: Trying with 'local'...
ERROR: . [Remote: local]
root@f6e79fb88d4c:~# 
```
Thanks very much for your work and your detailed report. It really helped to reproduce the issue.
I am going to propose a PR to improve this error message to something like:

```
Hello/1.0@demo/testing: Retrieving from predefined remote 'local'
Hello/1.0@demo/testing: Trying with 'local'...
ERROR: Hello/1.0@demo/testing was not found in remote 'local'
```

Resolving patch:
diff --git a/conans/client/proxy.py b/conans/client/proxy.py
--- a/conans/client/proxy.py
+++ b/conans/client/proxy.py
@@ -205,16 +205,20 @@ def _retrieve_from_remote(remote):
 
         if self._remote_name:
             output.info("Not found, retrieving from server '%s' " % self._remote_name)
-            remote = self._registry.remote(self._remote_name)
-            return _retrieve_from_remote(remote)
+            ref_remote = self._registry.remote(self._remote_name)
         else:
             ref_remote = self._registry.get_ref(conan_reference)
             if ref_remote:
                 output.info("Retrieving from predefined remote '%s'" % ref_remote.name)
+
+        if ref_remote:
+            try:
                 return _retrieve_from_remote(ref_remote)
-            else:
-                output.info("Not found in local cache, looking in remotes...")
+            except NotFoundException:
+                raise NotFoundException("%s was not found in remote '%s'" % (str(conan_reference),
+                                                                             ref_remote.name))
 
+        output.info("Not found in local cache, looking in remotes...")
         remotes = self._registry.remotes
         for remote in remotes:
             logger.debug("Trying with remote %s" % remote.name)


Test patch:
diff --git a/conans/test/command/install_test.py b/conans/test/command/install_test.py
--- a/conans/test/command/install_test.py
+++ b/conans/test/command/install_test.py
@@ -2,14 +2,14 @@
 import platform
 import os
 
-from conans.test.utils.tools import TestClient
+from conans.test.utils.tools import TestClient, TestServer
 from conans.model.ref import ConanFileReference, PackageReference
 from conans.paths import CONANFILE, CONANINFO
 from conans.model.info import ConanInfo
 from conans.test.utils.cpp_test_files import cpp_hello_conan_files
 from conans.paths import CONANFILE_TXT
 from conans.client.conf.detect import detected_os
-from conans.util.files import load, mkdir
+from conans.util.files import load, mkdir, rmdir
 
 
 class InstallTest(unittest.TestCase):
@@ -359,7 +359,7 @@ class TestConan(ConanFile):
 
         client.run("install . --build=missing -s os=Windows -s os_build=Windows --install-folder=win_dir")
         self.assertIn("Hello/0.1@lasote/stable from local cache\n",
-                      client.out) # Test "from local cache" output message
+                      client.out)  # Test "from local cache" output message
         client.run("install . --build=missing -s os=Macos -s os_build=Macos --install-folder=os_dir")
         conaninfo = load(os.path.join(client.current_folder, "win_dir/conaninfo.txt"))
         self.assertIn("os=Windows", conaninfo)
@@ -428,3 +428,28 @@ def install_with_path_errors_test(self):
                            ignore_error=True)
         self.assertTrue(error)
         self.assertIn("Conanfile not found", client.out)
+
+    def install_broken_reference_test(self):
+        client = TestClient(servers={"default": TestServer()},
+                            users={"default": [("lasote", "mypass")]})
+        conanfile = """from conans import ConanFile
+class Pkg(ConanFile):
+    pass
+"""
+        client.save({"conanfile.py": conanfile})
+        client.run("export . Hello/0.1@lasote/stable")
+        client.run("remote add_ref Hello/0.1@lasote/stable default")
+        conan_reference = ConanFileReference.loads("Hello/0.1@lasote/stable")
+        rmdir(os.path.join(client.client_cache.conan(conan_reference)))
+
+        error = client.run("install Hello/0.1@lasote/stable", ignore_error=True)
+        self.assertTrue(error)
+        self.assertIn("ERROR: Hello/0.1@lasote/stable was not found in remote 'default'",
+                      client.out)
+
+        # If it was associated, it has to be desasociated
+        client.run("remote remove_ref Hello/0.1@lasote/stable")
+        error = client.run("install Hello/0.1@lasote/stable", ignore_error=True)
+        self.assertTrue(error)
+        self.assertIn("ERROR: Unable to find 'Hello/0.1@lasote/stable' in remotes",
+                      client.out)