Uploaded image for project: 'Flume'
  1. Flume
  2. FLUME-3226

flume1.8.0 taildir-source Error: Failed loading positionFile: /usr/op/.flume/taildir_position.json

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.0
    • Fix Version/s: 1.8.0
    • Component/s: Sinks+Sources
    • Labels:
    • Flags:
      Patch

      Description

      config file :

      a1.sources = r1
      a1.sinks = k1
      a1.channels = c1
      
      ## source
      a1.sources.r1.type = TAILDIR
      a1.sources.r1.positionFile = /tmp/taildir_position.json
      a1.sources.r1.filegroups = f1
      a1.sources.r1.filegroups.f1 = /tmp/logs/.*log.*
      a1.sources.r1.fileHeader = true
      
      # Describe the sink
      a1.sinks.k1.type = logger
      
      # Use a channel which buffers events in memory
      a1.channels.c1.type = memory
      a1.channels.c1.capacity = 1000
      a1.channels.c1.transactionCapacity = 100 
      
      # Bind the source and sink to the channel
      a1.sources.r1.channels = c1
      a1.sinks.k1.channel = c1
      
      

      2.create a empty file "/tmp/taildir_position.json"

      3.Running flume causes errors.

      2018-02-28 15:12:49,001 (lifecycleSupervisor-1-0) [INFO - org.apache.flume.source.taildir.ReliableTaildirEventReader.<init>(ReliableTaildirEventReader.java:94)] Updating position from position file: /usr/op/.flume/taildir_position.json
      2018-02-28 15:12:49,008 (lifecycleSupervisor-1-0) [ERROR - org.apache.flume.source.taildir.ReliableTaildirEventReader.loadPositionFile(ReliableTaildirEventReader.java:146)] Failed loading positionFile: /usr/op/.flume/taildir_position.json
      java.io.EOFException: End of input at line 1 column 1
      	at com.google.gson.stream.JsonReader.nextNonWhitespace(JsonReader.java:954)
      	at com.google.gson.stream.JsonReader.nextValue(JsonReader.java:771)
      	at com.google.gson.stream.JsonReader.peek(JsonReader.java:367)
      	at com.google.gson.stream.JsonReader.expect(JsonReader.java:337)
      	at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:306)
      	at org.apache.flume.source.taildir.ReliableTaildirEventReader.loadPositionFile(ReliableTaildirEventReader.java:110)
      	at org.apache.flume.source.taildir.ReliableTaildirEventReader.<init>(ReliableTaildirEventReader.java:95)
      	at org.apache.flume.source.taildir.ReliableTaildirEventReader.<init>(ReliableTaildirEventReader.java:48)
      	at org.apache.flume.source.taildir.ReliableTaildirEventReader$Builder.build(ReliableTaildirEventReader.java:348)
      	at org.apache.flume.source.taildir.TaildirSource.start(TaildirSource.java:103)
      	at org.apache.flume.source.PollableSourceRunner.start(PollableSourceRunner.java:71)
      	at org.apache.flume.lifecycle.LifecycleSupervisor$MonitorRunnable.run(LifecycleSupervisor.java:249)
      	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)
      2018-02-28 15:12:49,013 (lifecycleSupervisor-1-0) [INFO - org.apache.flume.instrumentation.MonitoredCounterGroup.register(MonitoredCounterGroup.java:119)] Monitored counter group for type: SOURCE, name: r1: Successfully registered new MBean.
      2018-02-28 15:12:49,013 (lifecycleSupervisor-1-0) [INFO - org.apache.flume.instrumentation.MonitoredCounterGroup.start(MonitoredCounterGroup.java:95)] Component type: SOURCE, name: r1 started
      
      

        Attachments

        1. taildir_positionfile.patch
          4 kB
          songzhenxing

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              songzhenxing songzhenxing
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

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