Merge branch 'master' into github-3408-production-datamanager
[arvados.git] / services / api / app / models / collection.rb
index 1fa7df686cc9b6a825d002f4eb132d02e84d11ae..cac25d1c537981a433db526f730957f943c0d487 100644 (file)
@@ -9,6 +9,7 @@ class Collection < ArvadosModel
   serialize :properties, Hash
 
   before_validation :check_encoding
+  before_validation :log_invalid_manifest_format
   before_validation :check_signatures
   before_validation :strip_signatures_and_update_replication_confirmed
   validate :ensure_pdh_matches_manifest_text
@@ -192,6 +193,15 @@ class Collection < ArvadosModel
     end
   end
 
+  def log_invalid_manifest_format
+    begin
+      Keep::Manifest.validate! manifest_text if manifest_text
+    rescue => e
+      logger.warn e
+    end
+    true
+  end
+
   def signed_manifest_text
     if has_attribute? :manifest_text
       token = current_api_client_authorization.andand.api_token