diff --git a/gitlab_docker_autodep/deps.py b/gitlab_docker_autodep/deps.py
index 12f0f256c47e1c95604a3c5b94a2cc85dacc3af5..0d880f3440c86f35e3016c33a4c6298d8bd17d9e 100644
--- a/gitlab_docker_autodep/deps.py
+++ b/gitlab_docker_autodep/deps.py
@@ -1,6 +1,7 @@
 import gitlab
 import logging
 import re
+import time
 
 
 _from_rx = re.compile(r'^FROM\s+(.*)$')
@@ -92,9 +93,9 @@ def rebuild_deps(gitlab_url, registry_hostname, gitlab_token,
         logging.info('rebuilding %s', project.path_with_namespace)
         if not dry_run:
             pipeline = rebuild(project, wait)
-            if pipeline.status != 'success':
-                logging.error('ERROR: build failed for %s',
-                              project.path_with_namespace)
+            if pipeline.status not in ('success', 'pending'):
+                logging.error('ERROR: build failed for %s (%s)',
+                              project.path_with_namespace, pipeline)
                 return
 
         if recurse: