Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-12217

In PutDatabaseRecord processor, when you try to insert a CLOB and a SQLException gets catched, the exception message gets lost

    XMLWordPrintableJSON

Details

    Description

      In PutDatabaseRecord processor, when you try to insert a CLOB and a SQLException gets catched

      https://github.com/apache/nifi/blob/main/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutDatabaseRecord.java#L866C4-L866C4

      the original Exception message (the most valuable part) gets completely lost, because only its .getCause() is wrapped in a generic IOException that states "Unable to parse data as CLOB/String", making it extremely difficult to identify which is the real problem.

      In my case, the problem was something like "ORA-25153: Tablespace temporanea vuota" but this valuable message wasn't logged at all.

       

      I suggest to replace 

                      } catch (SQLException e) {
                          throw new IOException("Unable to parse data as CLOB/String " + value, e.getCause());
                      } 

      with

                      } catch (SQLException e) {
                          throw new IOException("Unable to parse data as CLOB/String " + value, e);
                      } 

       

      Thank you

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              apolselli Alessandro Polselli
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: