fluent-plugins-nursery / fluent-plugin-systemd

This is a fluentd input plugin. It reads logs from the systemd journal.
Apache License 2.0
153 stars 43 forks source link

Systemd::JournalError: No such file or directory retrying in 1s #33

Closed devent closed 7 years ago

devent commented 7 years ago

Hello, I'm trying out your plugin, but I'm stuck at this error.

#0 Systemd::JournalError: No such file or directory retrying in 1s

Configuration:

<source>
    @type systemd
    @log_level debug
    path /var/log/journal
    tag systemd
    read_from_head true
    path /var/fluentd/journal.pos
</source>

<match systemd>
  @type stdout
</match>

Directories (Fluentd is run as root):

 ▲ com.anrisoftware/fluentd-elk/fluentd-elk-image docker exec -it fluentd-elk-debian bash
root@20ffbc8bdcd3:/home/fluent# cd /var/log/journal/
root@20ffbc8bdcd3:/var/log/journal# ls -l 
total 4
drwxr-xr-x 2 root root 4096 Apr 23 14:43 c956513c70744b3483ee4ea2b0d1b5c9
root@20ffbc8bdcd3:/var/log/journal# cd c956513c70744b3483ee4ea2b0d1b5c9/
root@20ffbc8bdcd3:/var/log/journal/c956513c70744b3483ee4ea2b0d1b5c9# ls -l
total 49156
-rw-r-----  1 root root 41943040 Apr 23 16:26 system.journal
-rw-r-----+ 1 root root  8388608 Apr 23 15:47 user-1000.journal

Changing path to /var/log/journal/c956513c70744b3483ee4ea2b0d1b5c9 or /var/log/journal/c956513c70744b3483ee4ea2b0d1b5c9/system.journal doesn't help.

Versions.

2017-04-23 16:25:12 +0000 [info]: reading config file path="/fluentd/etc/fluent.conf"
2017-04-23 16:25:12 +0000 [info]: starting fluentd-0.14.14 pid=1
2017-04-23 16:25:12 +0000 [info]: spawn command to main:  cmdline=["/usr/local/bin/ruby", "-Eascii-8bit:ascii-8bit", "/usr/local/bundle/bin/fluentd", "-c", "/fluentd/etc/fluent.conf", "-p", "/fluentd/plugins", "--under-supervisor"]
2017-04-23 16:25:12 +0000 [info]: gem 'fluent-plugin-elasticsearch' version '1.9.3'
2017-04-23 16:25:12 +0000 [info]: gem 'fluent-plugin-kubernetes_metadata_filter' version '0.26.3'
2017-04-23 16:25:12 +0000 [info]: gem 'fluent-plugin-record-reformer' version '0.9.0'
2017-04-23 16:25:12 +0000 [info]: gem 'fluent-plugin-secure-forward' version '0.4.3'
2017-04-23 16:25:12 +0000 [info]: gem 'fluent-plugin-systemd' version '0.2.0'
2017-04-23 16:25:12 +0000 [info]: gem 'fluentd' version '0.14.14'
errm commented 7 years ago

Humm, this is weird, it looks like everything is set up correctly...

I take it you are running fluentd in a container? How have you mounted /var/log/journal? What capabilities does the container have? What version of systemd are you using in the container... and on the host?

devent commented 7 years ago

Hello, thank you, but it was my fault. I had two times path.

path /var/log/journal
path /var/fluentd/journal.pos
errm commented 7 years ago

🎉