diff --git a/src/StreamWrapper/S3fsStream.php b/src/StreamWrapper/S3fsStream.php
index 64d42643f..d8cf9f642 100644
--- a/src/StreamWrapper/S3fsStream.php
+++ b/src/StreamWrapper/S3fsStream.php
@@ -1037,6 +1037,19 @@ protected function getS3fsObject($uri) {
     // Check if this URI is in the cache.
     $metadata = $this->readCache($uri);
 
+    // If metadata fetching failed we try to fetch it from s3 instead.
+    if (!$metadata) {
+      try {
+        if ($metadata = $this->getS3Metadata($uri)) {
+          $this->writeCache($metadata);
+          clearstatcache(TRUE, $uri);
+        }
+      }
+      catch (\Exception $e) {
+        return $this->triggerError($e->getMessage());
+      }
+    }
+
     // If cache ignore is enabled, query S3 for all URIs which aren't in the
     // cache, and non-folder URIs which are.
     if (!empty($this->config['ignore_cache']) && !$metadata['dir']) {
