You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by bs...@apache.org on 2022/06/10 07:42:39 UTC

[nifi] branch main updated: NIFI-7535 add detailed error message when .nar file is not readable

This is an automated email from the ASF dual-hosted git repository.

bsimon pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/main by this push:
     new f99298f98e NIFI-7535 add detailed error message when .nar file is not readable
f99298f98e is described below

commit f99298f98e3b5a959e8a9d69c5d68316408a925d
Author: Nandor Soma Abonyi <ab...@gmail.com>
AuthorDate: Tue May 17 13:20:34 2022 +0200

    NIFI-7535 add detailed error message when .nar file is not readable
    
    This closes #6056
    Signed-off-by: Bence Simon <bs...@apache.org>
---
 .../nifi-nar-utils/src/main/java/org/apache/nifi/nar/NarUnpacker.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/src/main/java/org/apache/nifi/nar/NarUnpacker.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/src/main/java/org/apache/nifi/nar/NarUnpacker.java
index fbd9991e52..63550ade86 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/src/main/java/org/apache/nifi/nar/NarUnpacker.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/src/main/java/org/apache/nifi/nar/NarUnpacker.java
@@ -122,6 +122,10 @@ public final class NarUnpacker {
                 final long startTime = System.nanoTime();
                 logger.info("Expanding " + narFiles.size() + " NAR files with all processors...");
                 for (File narFile : narFiles) {
+                    if (!narFile.canRead()) {
+                        throw new IllegalStateException("Unable to read NAR file: " + narFile.getAbsolutePath());
+                    }
+
                     logger.debug("Expanding NAR file: " + narFile.getAbsolutePath());
 
                     // get the manifest for this nar