Skip to content

'tail' input attempts to seek in pipes #16636

@fetzerch

Description

@fetzerch

Relevant telegraf.conf

[[inputs.tail]]
  files = ["/dev/ttyUSB.ARDUINO.ONEWIRE"]
  pipe = true

Logs from Telegraf

Mar 14 13:04:37 beaver telegraf[743589]: 2025-03-14T12:04:37Z E! [inputs.tail] Stopping tail on "/dev/ttyUSB.ARDUINO.ONEWIRE": Seek error on /dev/ttyUSB.ARDUINO.ONEWIRE: seek /dev/ttyUSB.ARDUINO.ONEWIRE: illegal seek

System info

Telegraf 1.34.0

Docker

No response

Steps to reproduce

  1. Use tail input with pipes after 1.34.0

Expected behavior

Input plugin should not attempt to seek when pipe = true is configured.

Actual behavior

Input plugin ignores pipe = true and attempts to seek. Leading to illegal seek.

Additional info

I'm using the tail input plugin to read logs from an Arduino (connected over USB). Starting with Telegraf 1.34.0, this is no longer possible because tail always attempts to seek the file, even if pipe=true is configured.

The issue got introduced in #16342 which accidentally removes the check for the pipe option and the plugin now unconditionally seeks. See my comment: #16342 (review)

For reference: The pipe=true option got introduced in #2090.

Metadata

Metadata

Assignees

Labels

bugunexpected problem or unintended behaviorregressionsomething that used to work, but is now broken

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions