From fd6e2f11e2a0e4f16497dc32f6a32e861b90455d Mon Sep 17 00:00:00 2001
From: Alexander Solovyov <alexander@solovyov.net>
Date: Mon, 9 Sep 2024 10:59:41 +0300
Subject: [PATCH] [serdes] api: better error when archive looks weird (#47721)

---
 .../backend/src/metabase_enterprise/serialization/api.clj  | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/enterprise/backend/src/metabase_enterprise/serialization/api.clj b/enterprise/backend/src/metabase_enterprise/serialization/api.clj
index 5101cde43c5..d3ec36dd3fb 100644
--- a/enterprise/backend/src/metabase_enterprise/serialization/api.clj
+++ b/enterprise/backend/src/metabase_enterprise/serialization/api.clj
@@ -128,9 +128,10 @@
                      (let [cnt  (u.compress/untgz file dst)
                            path (find-serialization-dir dst)]
                        (when-not path
-                         (throw (ex-info "No source dir detected" {:dst   (.getPath dst)
-                                                                   :count cnt
-                                                                   :files (.listFiles dst)})))
+                         (throw (ex-info "No source dir detected. Please make sure the serialization files are in the top level dir."
+                                         {:dst   (.getPath dst)
+                                          :count cnt
+                                          :files (.listFiles dst)})))
                        (log/infof "In total %s entries unpacked, detected source dir: %s" cnt (.getName path))
                        (serdes/with-cache
                          (-> (v2.ingest/ingest-yaml (.getPath path))
-- 
GitLab