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

PutDatabaseRecord can not insert into mysql table with TEXT column

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • None
    • 1.14.0, 1.13.1
    • Extensions
    • None

    Description

      1. create table on mysql server

      CREATE TABLE tmp_text (
       ver varchar(10) NULL,
       richtext text NULL
       ) ;

      2. insert data into table with PutDatabaseRecord processor , raise error

      2021-02-19 00:43:04,424 ERROR [Timer-Driven Process Thread-3] o.a.n.p.standard.PutDatabaseRecord PutDatabaseRecord[id=b54f68de-0177-1000-917a-119d1bd6f5bf] Failed to put Records to database for StandardFlowFileRecord[uuid=3ad1b100-5661-4988-a21b-795b24cc5222,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1613666502360-8, container=default, section=8], offset=87073, length=17],offset=0,name=3ad1b100-5661-4988-a21b-795b24cc5222,size=17]. Routing to failure.: java.lang.NullPointerException
      java.lang.NullPointerException: null
      at org.apache.nifi.serialization.record.util.DataTypeUtils.convertType(DataTypeUtils.java:181)
      at org.apache.nifi.serialization.record.util.DataTypeUtils.convertType(DataTypeUtils.java:152)
      at org.apache.nifi.serialization.record.util.DataTypeUtils.convertType(DataTypeUtils.java:148)
      at org.apache.nifi.processors.standard.PutDatabaseRecord.executeDML(PutDatabaseRecord.java:707)
      at org.apache.nifi.processors.standard.PutDatabaseRecord.putToDatabase(PutDatabaseRecord.java:838)
      at org.apache.nifi.processors.standard.PutDatabaseRecord.onTrigger(PutDatabaseRecord.java:487)
      at org.pache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
      at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1173)
      at org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:214)
      at org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:117)
      at org.apache.nifi.engine.FlowEngine$2.run(FlowEngine.java:110)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)
      

       

      3. downgrade to Nifi 1.12.1, no error, data inserted into table

      4. change TEXT column to VARCHAR, no error

       

      Attachments

        Issue Links

          Activity

            People

              mattyb149 Matt Burgess
              macdoor615 macdoor615
              Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h