diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 5b885cddd7e..668596c5cdb 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -316,10 +316,15 @@ class BBCooker:
                     try:
                         with hashserv.create_client(upstream) as client:
                             client.ping()
-                    except (ConnectionError, ImportError) as e:
-                        bb.warn("BB_HASHSERVE_UPSTREAM is not valid, unable to connect hash equivalence server at '%s': %s"
+                    except ConnectionError as e:
+                        bb.fatal("Unable to connect to hash equivalence server at '%s', please correct or remove BB_HASHSERVE_UPSTREAM:\n%s"
+                                 % (upstream, repr(e)))
+                    except ImportError as e:
+                        bb.fatal(""""Unable to use hash equivalence server at '%s' due to missing or incorrect python module:
+%s
+Please install the needed module on the build host, or use scripts/install-buildtools from openembedded-core.
+You can also adjust or remove BB_HASHSERVE_UPSTREAM setting, but this may result in significantly longer build times."""
                                  % (upstream, repr(e)))
-                        upstream = None
 
                 self.hashservaddr = "unix://%s/hashserve.sock" % self.data.getVar("TOPDIR")
                 self.hashserv = hashserv.create_server(
