GithubHelp home page GithubHelp logo

daichirata / fluent-plugin-gcs Goto Github PK

View Code? Open in Web Editor NEW
42.0 4.0 18.0 59 KB

Google Cloud Storage output plugin for Fluentd.

License: Other

Ruby 99.56% Shell 0.44%
gcs fluentd-plugin gcp fluentd

fluent-plugin-gcs's Introduction

fluent-plugin-gcs

Gem Version Test Code Climate

Google Cloud Storage output plugin for Fluentd.

Requirements

fluent-plugin-gcs fluentd ruby
>= 0.4.0 >= v0.14.0 >= 2.4
< 0.4.0 >= v0.12.0 >= 1.9

Installation

$ gem install fluent-plugin-gcs -v "~> 0.3" --no-document # for fluentd v0.12 or later
$ gem install fluent-plugin-gcs -v "0.4.0" --no-document # for fluentd v0.14 or later

Examples

For v0.14 style

<match pattern>
  @type gcs

  project YOUR_PROJECT
  keyfile YOUR_KEYFILE_PATH
  bucket YOUR_GCS_BUCKET_NAME
  object_key_format %{path}%{time_slice}_%{index}.%{file_extension}
  path logs/${tag}/%Y/%m/%d/

  # if you want to use ${tag} or %Y/%m/%d/ like syntax in path / object_key_format,
  # need to specify tag for ${tag} and time for %Y/%m/%d in <buffer> argument.
  <buffer tag,time>
    @type file
    path /var/log/fluent/gcs
    timekey 1h # 1 hour partition
    timekey_wait 10m
    timekey_use_utc true # use utc
  </buffer>

  <format>
    @type json
  </format>
</match>

For v0.12 style

<match pattern>
  @type gcs

  project YOUR_PROJECT
  keyfile YOUR_KEYFILE_PATH
  bucket YOUR_GCS_BUCKET_NAME
  object_key_format %{path}%{time_slice}_%{index}.%{file_extension}
  path logs/
  buffer_path /var/log/fluent/gcs

  time_slice_format %Y%m%d-%H
  time_slice_wait 10m
  utc
</match>

Configuration

Authentication

You can provide the project and credential information to connect to the Storage service, or if you are running on Google Compute Engine this configuration is taken care of for you.

project

Project identifier for GCS. Project are discovered in the following order:

  • Specify project in project
  • Discover project in environment variables STORAGE_PROJECT, GOOGLE_CLOUD_PROJECT, GCLOUD_PROJECT
  • Discover GCE credentials

keyfile

Path of GCS service account credentials JSON file. Credentials are discovered in the following order:

  • Specify credentials path in keyfile
  • Discover credentials path in environment variables GOOGLE_CLOUD_KEYFILE, GCLOUD_KEYFILE
  • Discover credentials JSON in environment variables GOOGLE_CLOUD_KEYFILE_JSON, GCLOUD_KEYFILE_JSON
  • Discover credentials file in the Cloud SDK's path
  • Discover GCE credentials

client_retries

Number of times to retry requests on server error.

client_timeout

Default timeout to use in requests.

*bucket (required)

GCS bucket name.

store_as

Archive format on GCS. You can use serveral format:

  • gzip (default)
  • json
  • text

path

path prefix of the files on GCS. Default is "" (no prefix).

object_key_format

The format of GCS object keys. You can use several built-in variables:

  • %{path}
  • %{time_slice}
  • %{index}
  • %{file_extension}
  • %{uuid_flush}
  • %{hex_random}
  • %{hostname}

to decide keys dynamically.

  • %{path} is exactly the value of path configured in the configuration file. E.g., "logs/" in the example configuration above.
  • %{time_slice} is the time-slice in text that are formatted with time_slice_format.
  • %{index} is the sequential number starts from 0, increments when multiple files are uploaded to GCS in the same time slice.
  • %{file_extention} is changed by the value of store_as.
    • gzip - gz
    • json - json
    • text - txt
  • %{uuid_flush} a uuid that is replaced everytime the buffer will be flushed
  • %{hex_random} a random hex string that is replaced for each buffer chunk, not assured to be unique. You can configure the length of string with a hex_random_length parameter (Default: 4).
  • %{hostname} is set to the standard host name of the system of the running server.

The default format is %{path}%{time_slice}_%{index}.%{file_extension}.

hex_random_length

The length of %{hex_random} placeholder.

transcoding

Enable the decompressive form of transcoding.

See also Transcoding of gzip-compressed files.

format

Change one line format in the GCS object. You can use serveral format:

  • out_file (default)
  • json
  • ltsv
  • single_value

See also official Formatter article.

auto_create_bucket

Create GCS bucket if it does not exists. Default is true.

acl

Permission for the object in GCS. Acceptable values are:

  • auth_read - File owner gets OWNER access, and allAuthenticatedUsers get READER access.
  • owner_full - File owner gets OWNER access, and project team owners get OWNER access.
  • owner_read - File owner gets OWNER access, and project team owners get READER access.
  • private - File owner gets OWNER access.
  • project_private - File owner gets OWNER access, and project team members get access according to their roles.
  • public_read - File owner gets OWNER access, and allUsers get READER access.

Default is nil (bucket default object ACL). See also official document.

storage_class

Storage class of the file. Acceptable values are:

  • dra - Durable Reduced Availability
  • nearline - Nearline Storage
  • coldline - Coldline Storage
  • multi_regional - Multi-Regional Storage
  • regional - Regional Storage
  • standard - Standard Storage

Default is nil. See also official document.

encryption_key

You can also choose to provide your own AES-256 key for server-side encryption. See also Customer-supplied encryption keys.

encryption_key_sha256 will be calculated using encryption_key.

overwrite

Overwrite already existing path. Default is false, which raises an error if a GCS object of the same path already exists, or increment the %{index} placeholder until finding an absent path.

*buffer_path (required)

path prefix of the files to buffer logs.

time_slice_format

Format of the time used as the file name. Default is '%Y%m%d'. Use '%Y%m%d%H' to split files hourly.

time_slice_wait

The time to wait old logs. Default is 10 minutes. Specify larger value if old logs may reache.

localtime

Use Local time instead of UTC.

utc

Use UTC instead of local time.

And see official Time Sliced Output article

blind_write

Doesn't check if an object exists in GCS before writing. Default is false.

Allows to avoid granting of storage.objects.get permission.

Warning! If the object exists and storage.objects.delete permission is not granted, it will result in an unrecoverable error. Usage of %{hex_random} is recommended.

ObjectMetadata

User provided web-safe keys and arbitrary string values that will returned with requests for the file as "x-goog-meta-" response headers.

<match *>
  @type gcs

  <object_metadata>
    key KEY_DATA_1
    value VALUE_DATA_1
  </object_metadata>

  <object_metadata>
    key KEY_DATA_2
    value VALUE_DATA_2
  </object_metadata>
</match>

fluent-plugin-gcs's People

Contributors

cosmo0920 avatar daichirata avatar korjik avatar nyanexe avatar pepov avatar sfc-gh-cxu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fluent-plugin-gcs's Issues

Unable to install plugin

Hello, I recently encountered issues installing this fluentd-plugin-gcs plugin. Below is the error when you attempt to install it when building an image:

Sending build context to Docker daemon  151.6kB
Step 1/2 : FROM quay.io/fluentd_elasticsearch/fluentd:v2.9.0
 ---> 5a992077baba
Step 2/2 : RUN fluent-gem install fluent-plugin-gcs   && fluent-gem install fluent-plugin-s3
 ---> Running in 13acad7afecd
Successfully installed google-cloud-env-1.3.2
Successfully installed google-cloud-errors-1.0.1
Successfully installed google-cloud-core-1.5.0
Successfully installed declarative-option-0.1.0
Successfully installed declarative-0.0.20
Successfully installed uber-0.1.0
Successfully installed representable-3.0.4
Successfully installed retriable-3.1.2
Successfully installed mini_mime-1.0.2
Successfully installed jwt-2.2.1
Successfully installed signet-0.14.0
Successfully installed memoist-0.16.2
Successfully installed os-1.1.0
Successfully installed googleauth-0.13.0
Successfully installed httpclient-2.8.3
Successfully installed google-api-client-0.41.2
Building native extensions. This could take a while...
ERROR:  Error installing fluent-plugin-gcs:
	ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.5.0/gems/digest-crc-0.6.1/ext/digest
/usr/bin/ruby2.5 -rrubygems /var/lib/gems/2.5.0/gems/rake-13.0.1/exe/rake RUBYARCHDIR=/var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/digest-crc-0.6.1 RUBYLIBDIR=/var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/digest-crc-0.6.1
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

rake failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.5.0/gems/digest-crc-0.6.1 for inspection.
Results logged to /var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/digest-crc-0.6.1/gem_make.out
The command '/bin/sh -c fluent-gem install fluent-plugin-gcs   && fluent-gem install fluent-plugin-s3' returned a non-zero code: 1

I am unable to find the root cause of the issue, so I am raising this issue here for help.

Version of fluentd is 1.8.0

Buffers piling up

I'm seeing the GCS plugin uploading to the bucket. But it also leaves behind a lot of buffer files, up to the point where the queue becomes full. What am I doing wrong?

I deleted the buffers last night, and as you can see, it's building up constantly:

screen shot 2018-05-22 at 18 04 41

My config:

<match **>
  @type copy
  <store>
    @type file

    path /fluentd/log/everything
    append true
    buffer_type memory
    flush_interval 5s
    format json
    include_time_key
    time_format %Y-%m-%dT%H:%M:%S.%N
    time_slice_format %Y-%m-%d-%H
    disable_retry_limit
    utc
  </store>
  <store>
    @type gcs

    format json
    include_time_key
    disable_retry_limit
    utc
    buffer_type file
    buffer_path /fluentd/log/gcs.buffer
    buffer_chunk_limit 10M
    # Max 1000 * 10M = 10GB
    buffer_queue_limit 1000
    time_slice_format %Y%m%d%H
    time_slice_wait 10m

    project projectname
    bucket bucketname
    store_as gzip
    path fluentd/
    auto_create_bucket false
    keyfile "/etc/td-agent/secrets/gcs-service-account-key"
    storage_class nearline
  </store>
</match>

Lists of buffers and GCS data here.

Fluentd 0.12.35, plugin version 0.3.0.

DaemonSet Pod with Fluent GCS Plugin Stuck in Crash Loop: "stack level too deep"

Image: fluent/fluentd-kubernetes-daemonset:v1.11.5-debian-gcs-1.0
fluent-plugin-gcs version: v0.4.0
Platform: Google Kubernetes Engine (GKE)
Node Version: v1.17.13-gke.2001

I noticed that from time to time, one Pod out of all the DaemonSet Pods would
be stuck in a crash loop due to the error stack level too deep, so fluentd Pod was unable
to drain the log buffer. This issue appears nondeterministic, since other Pods
running the same container image were fine, and the issue only shows up about once
per week. This issue was gone once the Pod was manually deleted, causing the DaemonSet
controller to recreate it.

I am curious if someone has experienced similar issues or could help me understand
what could have gone wrong. I have attached the Pod log and the Kubernetes manifests.

Fluentd Pod Log:

2021-01-19 02:37:52 +0000 [warn]: #0 [out_gcs] thread exited by unexpected error plugin=Fluent::Plugin::GCSOutput title=:flush_thread_0 error_class=SystemStackError error="stack level too deep"
#<Thread:0x00007f5766df19d8@flush_thread_0@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 run> terminated with exception (report_on_exception is true):
/fluentd/vendor/bundle/ruby/2.6.0/gems/google-api-client-0.48.0/lib/google/apis/core/json_representation.rb:77:in `block in set_default_options': stack level too deep (SystemStackError)
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:18:in `evaluate'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:10:in `block in call'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `each'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `inject'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `call'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/deserializer.rb:87:in `block in <module:Representable>'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:18:in `evaluate'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:10:in `block in call'
	 ... 7276 levels...
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin/output.rb:1136:in `try_flush'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin/output.rb:1442:in `flush_thread_run'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin/output.rb:462:in `block (2 levels) in start'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:78:in `block in thread_create'
2021-01-19 02:37:52 +0000 [error]: #0 unexpected error error_class=SystemStackError error="stack level too deep"
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/google-api-client-0.48.0/lib/google/apis/core/json_representation.rb:77:in `block in set_default_options'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:18:in `evaluate'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:10:in `block in call'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `each'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `inject'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `call'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/deserializer.rb:87:in `block in <module:Representable>'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:18:in `evaluate'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:10:in `block in call'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `each'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `inject'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `call'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/binding.rb:37:in `uncompile_fragment'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable.rb:53:in `block in call'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable.rb:51:in `each'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable.rb:51:in `call'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable.rb:70:in `representable_map!'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable.rb:37:in `update_properties_from'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/hash.rb:30:in `from_hash'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/json.rb:39:in `from_json'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/google-api-client-0.48.0/lib/google/apis/core/api_command.rb:88:in `decode_response_body'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/google-api-client-0.48.0/lib/google/apis/core/http_command.rb:195:in `process_response'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/google-api-client-0.48.0/lib/google/apis/core/http_command.rb:310:in `execute_once'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/google-api-client-0.48.0/lib/google/apis/core/http_command.rb:113:in `block (2 levels) in execute'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/retriable-3.1.2/lib/retriable.rb:61:in `block in retriable'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `times'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `retriable'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/google-api-client-0.48.0/lib/google/apis/core/http_command.rb:110:in `block in execute'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/retriable-3.1.2/lib/retriable.rb:61:in `block in retriable'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `times'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `retriable'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/google-api-client-0.48.0/lib/google/apis/core/http_command.rb:102:in `execute'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/google-api-client-0.48.0/lib/google/apis/core/base_service.rb:366:in `execute_or_queue_command'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/google-api-client-0.48.0/generated/google/apis/storage_v1/service.rb:1914:in `get_object'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/google-cloud-storage-1.29.1/lib/google/cloud/storage/service.rb:325:in `block in get_file'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/google-cloud-storage-1.29.1/lib/google/cloud/storage/service.rb:632:in `execute'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/google-cloud-storage-1.29.1/lib/google/cloud/storage/service.rb:324:in `get_file'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/google-cloud-storage-1.29.1/lib/google/cloud/storage/bucket.rb:1071:in `file'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:170:in `generate_path'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:179:in `generate_path'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:179:in `generate_path'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:179:in `generate_path'
  2021-01-19 02:37:52 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:179:in `generate_path'
  ...
  ...
  2021-01-19 02:42:35 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:179:in `generate_path'
  2021-01-19 02:42:35 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:179:in `generate_path'
  2021-01-19 02:42:35 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:179:in `generate_path'
  2021-01-19 02:42:35 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:179:in `generate_path'
  2021-01-19 02:42:35 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:119:in `write'
  2021-01-19 02:42:35 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin/output.rb:1136:in `try_flush'
  2021-01-19 02:42:35 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin/output.rb:1442:in `flush_thread_run'
  2021-01-19 02:42:35 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin/output.rb:462:in `block (2 levels) in start'
  2021-01-19 02:42:35 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:78:in `block in thread_create'
2021-01-19 02:42:35 +0000 [warn]: #0 [out_gcs] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::GCSOutput title=:enqueue_thread thread=#<Thread:0x00007f85d9373848@enqueue_thread@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:42:35 +0000 [warn]: #0 thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::HttpInput title=:event_loop thread=#<Thread:0x00007f85d9373280@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:42:35 +0000 [warn]: #0 [in_tail_kube_apiserver_audit] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::TailInput title=:event_loop thread=#<Thread:0x00007f85d9371660@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:42:35 +0000 [warn]: #0 [in_tail_glbc] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::TailInput title=:event_loop thread=#<Thread:0x00007f85d9fc2388@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:42:35 +0000 [warn]: #0 [in_tail_cluster_autoscaler] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::TailInput title=:event_loop thread=#<Thread:0x00007f85d9fc3a08@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:42:35 +0000 [warn]: #0 [in_tail_kube_scheduler] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::TailInput title=:event_loop thread=#<Thread:0x00007f85d9fcfb00@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:42:35 +0000 [warn]: #0 [in_tail_rescheduler] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::TailInput title=:event_loop thread=#<Thread:0x00007f85d9fc1050@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:42:35 +0000 [warn]: #0 [in_tail_kube_controller_manager] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::TailInput title=:event_loop thread=#<Thread:0x00007f85d9fcecc8@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:42:35 +0000 [warn]: #0 [in_tail_kube_proxy] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::TailInput title=:event_loop thread=#<Thread:0x00007f85d9fcc6a8@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:42:35 +0000 [warn]: #0 [in_tail_kube_apiserver] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::TailInput title=:event_loop thread=#<Thread:0x00007f85d9fcd9e0@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:42:35 +0000 [warn]: #0 [in_tail_docker] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::TailInput title=:event_loop thread=#<Thread:0x00007f85d9fd8c28@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:42:35 +0000 [warn]: #0 [in_tail_kubelet] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::TailInput title=:event_loop thread=#<Thread:0x00007f85d9fdb298@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:42:35 +0000 [warn]: #0 [in_tail_etcd] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::TailInput title=:event_loop thread=#<Thread:0x00007f85d9fd9f60@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:42:35 +0000 [warn]: #0 [in_tail_container_logs] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::TailInput title=:event_loop thread=#<Thread:0x00007f85d9d936e8@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:42:35 +0000 [warn]: #0 [in_tail_minion] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::TailInput title=:event_loop thread=#<Thread:0x00007f85d9d86880@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:42:35 +0000 [warn]: #0 [in_tail_startupscript] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::TailInput title=:event_loop thread=#<Thread:0x00007f85d9d87b68@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:42:35 +0000 [warn]: #0 [prometheus_monitor] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::PrometheusMonitorInput title=:event_loop thread=#<Thread:0x00007f85d914a0a8@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:42:35 +0000 [warn]: #0 [prometheus_output_monitor] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::PrometheusOutputMonitorInput title=:event_loop thread=#<Thread:0x00007f85d91392a8@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:42:35 +0000 [warn]: #0 [monitor_agent] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::MonitorAgentInput title=:event_loop thread=#<Thread:0x00007f85d9148d20@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:42:35 +0000 [warn]: #0 [in_systemd_bootkube] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::SystemdInput title=:event_loop thread=#<Thread:0x00007f85d91dac70@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:42:35 +0000 [warn]: #0 [prometheus] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::PrometheusInput title=:in_prometheus thread=#<Thread:0x00007f85d91db008@in_prometheus@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:42:35 +0000 [warn]: #0 [in_systemd_docker] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::SystemdInput title=:event_loop thread=#<Thread:0x00007f85d91d9cf8@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:42:35 +0000 [warn]: #0 [in_systemd_kubelet] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::SystemdInput title=:event_loop thread=#<Thread:0x00007f85d8e81150@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:42:35 +0000 [warn]: #0 [monitor_agent] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::MonitorAgentInput title=:in_monitor_http_server_helper thread=#<Thread:0x00007f85d9199400@in_monitor_http_server_helper@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:44:09 +0000 [warn]: #0 [out_gcs] thread exited by unexpected error plugin=Fluent::Plugin::GCSOutput title=:flush_thread_0 error_class=SystemStackError error="stack level too deep"
#<Thread:0x00007f8643697bb8@flush_thread_0@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 run> terminated with exception (report_on_exception is true):
/fluentd/vendor/bundle/ruby/2.6.0/gems/google-api-client-0.48.0/lib/google/apis/core/json_representation.rb:77:in `block in set_default_options': stack level too deep (SystemStackError)
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:18:in `evaluate'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:10:in `block in call'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `each'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `inject'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `call'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/deserializer.rb:87:in `block in <module:Representable>'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:18:in `evaluate'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:10:in `block in call'
	 ... 7276 levels...
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin/output.rb:1136:in `try_flush'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin/output.rb:1442:in `flush_thread_run'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin/output.rb:462:in `block (2 levels) in start'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:78:in `block in thread_create'
2021-01-19 02:44:09 +0000 [error]: #0 unexpected error error_class=SystemStackError error="stack level too deep"
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/google-api-client-0.48.0/lib/google/apis/core/json_representation.rb:77:in `block in set_default_options'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:18:in `evaluate'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:10:in `block in call'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `each'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `inject'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `call'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/deserializer.rb:87:in `block in <module:Representable>'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:18:in `evaluate'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:10:in `block in call'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `each'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `inject'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `call'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/binding.rb:37:in `uncompile_fragment'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable.rb:53:in `block in call'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable.rb:51:in `each'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable.rb:51:in `call'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable.rb:70:in `representable_map!'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable.rb:37:in `update_properties_from'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/hash.rb:30:in `from_hash'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/json.rb:39:in `from_json'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/google-api-client-0.48.0/lib/google/apis/core/api_command.rb:88:in `decode_response_body'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/google-api-client-0.48.0/lib/google/apis/core/http_command.rb:195:in `process_response'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/google-api-client-0.48.0/lib/google/apis/core/http_command.rb:310:in `execute_once'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/google-api-client-0.48.0/lib/google/apis/core/http_command.rb:113:in `block (2 levels) in execute'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/retriable-3.1.2/lib/retriable.rb:61:in `block in retriable'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `times'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `retriable'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/google-api-client-0.48.0/lib/google/apis/core/http_command.rb:110:in `block in execute'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/retriable-3.1.2/lib/retriable.rb:61:in `block in retriable'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `times'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `retriable'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/google-api-client-0.48.0/lib/google/apis/core/http_command.rb:102:in `execute'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/google-api-client-0.48.0/lib/google/apis/core/base_service.rb:366:in `execute_or_queue_command'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/google-api-client-0.48.0/generated/google/apis/storage_v1/service.rb:1914:in `get_object'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/google-cloud-storage-1.29.1/lib/google/cloud/storage/service.rb:325:in `block in get_file'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/google-cloud-storage-1.29.1/lib/google/cloud/storage/service.rb:632:in `execute'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/google-cloud-storage-1.29.1/lib/google/cloud/storage/service.rb:324:in `get_file'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/google-cloud-storage-1.29.1/lib/google/cloud/storage/bucket.rb:1071:in `file'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:170:in `generate_path'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:179:in `generate_path'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:179:in `generate_path'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:179:in `generate_path'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:179:in `generate_path'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:179:in `generate_path'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:179:in `generate_path'
...
...
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:179:in `generate_path'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:179:in `generate_path'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:179:in `generate_path'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:179:in `generate_path'
/fluentd/vendor/bundle/ruby/2.6.0/gems/google-api-client-0.48.0/lib/google/apis/core/json_representation.rb:77:in `block in set_default_options': stack level too deep (SystemStackError)
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:18:in `evaluate'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:10:in `block in call'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `each'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `inject'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `call'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/deserializer.rb:87:in `block in <module:Representable>'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:18:in `evaluate'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/representable-3.0.4/lib/representable/pipeline.rb:10:in `block in call'
	 ... 7276 levels...
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin/output.rb:1136:in `try_flush'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin/output.rb:1442:in `flush_thread_run'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin/output.rb:462:in `block (2 levels) in start'
	from /fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:78:in `block in thread_create'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:179:in `generate_path'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:179:in `generate_path'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:179:in `generate_path'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:179:in `generate_path'
...
...
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:179:in `generate_path'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:179:in `generate_path'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:179:in `generate_path'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:119:in `write'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin/output.rb:1136:in `try_flush'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin/output.rb:1442:in `flush_thread_run'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin/output.rb:462:in `block (2 levels) in start'
  2021-01-19 02:44:09 +0000 [error]: #0 /fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:78:in `block in thread_create'
2021-01-19 02:44:09 +0000 [warn]: #0 [out_gcs] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::GCSOutput title=:enqueue_thread thread=#<Thread:0x00007f8643697320@enqueue_thread@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:44:09 +0000 [warn]: #0 thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::HttpInput title=:event_loop thread=#<Thread:0x00007f8643696628@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:44:09 +0000 [warn]: #0 [in_tail_kube_apiserver_audit] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::TailInput title=:event_loop thread=#<Thread:0x00007f86436ae3e0@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:44:09 +0000 [warn]: #0 [in_tail_rescheduler] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::TailInput title=:event_loop thread=#<Thread:0x00007f86436a67d0@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:44:09 +0000 [warn]: #0 [in_tail_kube_controller_manager] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::TailInput title=:event_loop thread=#<Thread:0x00007f86436c9280@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:44:09 +0000 [warn]: #0 [in_tail_glbc] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::TailInput title=:event_loop thread=#<Thread:0x00007f864369cd20@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:44:09 +0000 [warn]: #0 [in_tail_cluster_autoscaler] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::TailInput title=:event_loop thread=#<Thread:0x00007f864369f480@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:44:09 +0000 [warn]: #0 [in_tail_kube_proxy] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::TailInput title=:event_loop thread=#<Thread:0x00007f86436daad0@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:44:09 +0000 [warn]: #0 [in_tail_kubelet] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::TailInput title=:event_loop thread=#<Thread:0x00007f86436e3bf8@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:44:09 +0000 [warn]: #0 [in_tail_kube_apiserver] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::TailInput title=:event_loop thread=#<Thread:0x00007f86436d2588@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:44:09 +0000 [warn]: #0 [in_tail_etcd] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::TailInput title=:event_loop thread=#<Thread:0x00007f86436e09f8@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:44:09 +0000 [warn]: #0 [in_tail_container_logs] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::TailInput title=:event_loop thread=#<Thread:0x00007f8643713290@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:44:09 +0000 [warn]: #0 [in_tail_startupscript] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::TailInput title=:event_loop thread=#<Thread:0x00007f8643703ed0@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:44:09 +0000 [warn]: #0 [in_tail_minion] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::TailInput title=:event_loop thread=#<Thread:0x00007f86437016f8@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:44:09 +0000 [warn]: #0 [prometheus_output_monitor] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::PrometheusOutputMonitorInput title=:event_loop thread=#<Thread:0x00007f8642574b10@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:44:09 +0000 [warn]: #0 [in_tail_docker] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::TailInput title=:event_loop thread=#<Thread:0x00007f86436ea3b8@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:44:09 +0000 [warn]: #0 [in_tail_kube_scheduler] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::TailInput title=:event_loop thread=#<Thread:0x00007f86436c9b18@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:44:09 +0000 [warn]: #0 [prometheus_monitor] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::PrometheusMonitorInput title=:event_loop thread=#<Thread:0x00007f864257dfd0@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:44:09 +0000 [warn]: #0 [monitor_agent] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::MonitorAgentInput title=:event_loop thread=#<Thread:0x00007f864257d030@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:44:09 +0000 [warn]: #0 [monitor_agent] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::MonitorAgentInput title=:in_monitor_http_server_helper thread=#<Thread:0x00007f864257c018@in_monitor_http_server_helper@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:44:09 +0000 [warn]: #0 [in_systemd_bootkube] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::SystemdInput title=:event_loop thread=#<Thread:0x00007f8642280e68@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:44:09 +0000 [warn]: #0 [prometheus] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::PrometheusInput title=:in_prometheus thread=#<Thread:0x00007f8642281110@in_prometheus@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:44:09 +0000 [warn]: #0 [in_systemd_docker] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::SystemdInput title=:event_loop thread=#<Thread:0x00007f8642280850@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2021-01-19 02:44:09 +0000 [warn]: #0 [in_systemd_kubelet] thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::SystemdInput title=:event_loop thread=#<Thread:0x00007f86422b39f8@event_loop@/fluentd/vendor/bundle/ruby/2.6.0/gems/fluentd-1.11.5/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
...

Fluent.conf:

apiVersion: v1
kind: ConfigMap
metadata:
  name: fluentd-conf
  namespace: fluentd
data:
  fluent.conf: |-
    @include "#{ENV['FLUENTD_SYSTEMD_CONF'] || 'systemd'}.conf"
    @include "#{ENV['FLUENTD_PROMETHEUS_CONF'] || 'prometheus'}.conf"
    @include filter.conf
    @include kubernetes.conf
    @include monitoring.conf
    @include conf.d/*.conf

    <system>
      log_level debug
    </system>

    # HTTP Endpoint used for health checking
    <source>
      @type http
      port 9880
      bind 0.0.0.0
    </source>

    <match **>
      # docs: https://github.com/daichirata/fluent-plugin-gcs
      # this configuration relies on the nodes having permission to write on your gs bucket
      @type gcs
      @id out_gcs
      @log_level debug
      project "#{ENV['GCS_BUCKET_PROJECT']}"
      bucket "#{ENV['GCS_BUCKET_NAME']}"
      object_key_format "%{path}%{time_slice}#{ENV['K8S_CLUSTER_NAME']}_#{ENV['HOSTNAME']}_%{index}.log"
      time_slice_format "/%Y/%m/%d/%H/%M/"
      path "#{ENV['GCS_PATH']}"
      <buffer>
        @type file
        path /var/log/fluentd-buffers/gcs.buffer
        timekey 30
        timekey_wait 0
        timekey_use_utc true
        chunk_limit_size 256m
        flush_at_shutdown true
      </buffer>
    </match>

DaemonSet Manifest:

apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: fluentd
  namespace: fluentd
  labels:
    k8s-app: fluentd-logging
    version: v1
spec:
  selector:
    matchLabels:
      k8s-app: fluentd-logging
      version: v1
  updateStrategy:
    rollingUpdate:
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        k8s-app: fluentd-logging
        version: v1
    spec:
      tolerations:
        - key: node-role.kubernetes.io/master
          effect: NoSchedule
        - effect: NoSchedule
          operator: Exists
      containers:
        - name: fluentd
          image: fluent/fluentd-kubernetes-daemonset:v1.11.5-debian-gcs-1.0
          env:
            - name: GCS_BUCKET_PROJECT
              value: <redacted>
            - name: GCS_BUCKET_NAME
              value: <redacted>
            - name: GCS_PATH
              value: <redacted>
            - name: K8S_CLUSTER_NAME
              value: <redacted>
            - name: K8S_NODE_NAME
              valueFrom:
                fieldRef:
                  fieldPath: spec.nodeName
          ports:
            - containerPort: 24231
            - containerPort: 9880
          livenessProbe:
            httpGet:
              # The value is {"log": "health check"}
              path: /fluentd.healthcheck?json=%7B%22log%22%3A+%22health+check%22%7D
              port: 9880
            initialDelaySeconds: 10
            periodSeconds: 10
            timeoutSeconds: 1
            failureThreshold: 1
            successThreshold: 1
          resources:
            limits:
              memory: 800Mi
            requests:
              cpu: 200m
              memory: 400Mi
          volumeMounts:
            - name: varlog
              mountPath: /var/log
            - name: varlibdockercontainers
              mountPath: /var/lib/docker/containers
              readOnly: true
            - name: config-volume
              mountPath: /fluentd/etc/fluent.conf
              subPath: fluent.conf
            - name: filterconfig-volume
              mountPath: /fluentd/etc/filter.conf
              subPath: filter.conf
            - name: kubernetesconfig-volume
              mountPath: /fluentd/etc/kubernetes.conf
              subPath: kubernetes.conf
            - name: prometheusconfig-volume
              mountPath: /fluentd/etc/prometheus.conf
              subPath: prometheus.conf
      priorityClassName: cluster-addon-priority
      terminationGracePeriodSeconds: 30
      serviceAccountName: fluentd
      volumes:
        - name: config-volume
          configMap:
            name: fluentd-conf
        - name: filterconfig-volume
          configMap:
            name: filter-conf
        - name: prometheusconfig-volume
          configMap:
            name: prometheus-conf
        - name: kubernetesconfig-volume
          configMap:
            name: kubernetes-conf
        - name: varlog
          hostPath:
            path: /var/log
        - name: varlibdockercontainers
          hostPath:
            path: /var/lib/docker/containers

failed to upload due to GCS

2023-11-06 10:13:00 +0900 [debug]: #0 [gcs] Created new chunk chunk_id="609718e16bbf586a68ee2395e345b3f2" metadata=#<struct Fluent::Plugin::Buffer::Metadata timekey=1699233180, tag="reformed.test.https", variables=nil, seq=0> 2023-11-06 10:13:06 +0900 [warn]: #0 [gcs] got unrecoverable error in primary and no secondary error_class=ArgumentError error="wrong number of arguments (given 2, expected 1)" 2023-11-06 10:13:06 +0900 [warn]: #0 /usr/local/lib/ruby/gems/3.1.0/gems/google-cloud-storage-1.44.0/lib/google/cloud/storage/bucket.rb:1360:in `file' 2023-11-06 10:13:06 +0900 [warn]: #0 /usr/local/lib/ruby/gems/3.1.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:170:in `generate_path' 2023-11-06 10:13:06 +0900 [warn]: #0 /usr/local/lib/ruby/gems/3.1.0/gems/fluent-plugin-gcs-0.4.0/lib/fluent/plugin/out_gcs.rb:119:in `write' 2023-11-06 10:13:06 +0900 [warn]: #0 /usr/local/lib/ruby/gems/3.1.0/gems/fluentd-1.16.2/lib/fluent/plugin/output.rb:1225:in `try_flush' 2023-11-06 10:13:06 +0900 [warn]: #0 /usr/local/lib/ruby/gems/3.1.0/gems/fluentd-1.16.2/lib/fluent/plugin/output.rb:1538:in `flush_thread_run' 2023-11-06 10:13:06 +0900 [warn]: #0 /usr/local/lib/ruby/gems/3.1.0/gems/fluentd-1.16.2/lib/fluent/plugin/output.rb:510:in `block (2 levels) in start' 2023-11-06 10:13:06 +0900 [warn]: #0 /usr/local/lib/ruby/gems/3.1.0/gems/fluentd-1.16.2/lib/fluent/plugin_helper/thread.rb:78:in `block in thread_create'
using ruby 3.1.2

append rec to already existing file

Currently there is no option to append rec to existing file. It can overwrite entire file or through error that file already exist based on overwrite parameter. For append it says not used. Is there any way to append data to existing file

Failed flush because of Zlib::DataError

Hi,

I have set a fluentd (version 1.2.5) broker configuration to set some logs data into gcs.
With a simple config where I set the buffer at 5m and using buffer time, everything works great:

    path toto
    time_slice_format '%Y-%m-%d_%H%M'
    object_key_format %Y/%m/%d/%{time_slice}_%{hostname}_%{uuid_flush}_%{index}_%{path}.%{file_extension}
    utc

    <buffer time>
      @type file
      path /data/fluent/toto
      timekey 5m
      timekey_wait 0s
      timekey_use_utc true
      flush_at_shutdown true
    </buffer>

Now the thing is I want to add the tag who represent the hostname of the server who has forward the log. Te be more specific, It is about 400 hosts who sent their logs:

    path ${tag[1]}_toto  #  ${tag[1]} represent the hostname of one fowarder
    time_slice_format '%Y-%m-%d_%H%M'
    object_key_format %Y/%m/%d/%{time_slice}_%{hostname}_%{uuid_flush}_%{index}_%{path}.%{file_extension}
    utc

    <buffer tag,time>
      @type file
      path /data/fluent/toto
      timekey 5m
      timekey_wait 0s
      timekey_use_utc true
      flush_at_shutdown true
    </buffer>

But with this settings, fluentd report a lot of error about Zlib:

2018-10-02 18:03:43 +0200 [warn]: #20 failed to flush the buffer. retry_time=0 next_retry_seconds=2018-10-02 18:03:44 +0200 chunk="57741037bffabce665f0c6a2247d13e8" error_class=Zlib::DataError error="data error"

After a retry, it succeeds:

2018-10-02 18:03:45 +0200 [warn]: #20 retry succeeded. chunk_id="57741037bffabce665f0c6a2247d13e8"

If someone has an idea.

Failing to upload due to Google Storage Library Updates

2022-08-15 20:04:00 +0000 [warn]: #0 [out_gcs] got unrecoverable error in primary and no secondary error_class=ArgumentError error="wrong number of arguments (given 3, expected 1..2)"
  2022-08-15 20:04:00 +0000 [warn]: #0 /fluentd/vendor/bundle/ruby/3.1.0/gems/google-cloud-storage-1.38.0/lib/google/cloud/storage/bucket.rb:1557:in `create_file'
  2022-08-15 20:04:00 +0000 [warn]: #0 /fluentd/vendor/bundle/ruby/3.1.0/gems/fluent-plugin-gcs-0.4.1/lib/fluent/plugin/out_gcs.rb:134:in `block in write'
  2022-08-15 20:04:00 +0000 [warn]: #0 /fluentd/vendor/bundle/ruby/3.1.0/gems/fluent-plugin-gcs-0.4.1/lib/fluent/plugin/gcs/object_creator.rb:39:in `block in create'
  2022-08-15 20:04:00 +0000 [warn]: #0 /usr/local/lib/ruby/3.1.0/tempfile.rb:358:in `create'
  2022-08-15 20:04:00 +0000 [warn]: #0 /fluentd/vendor/bundle/ruby/3.1.0/gems/fluent-plugin-gcs-0.4.1/lib/fluent/plugin/gcs/object_creator.rb:35:in `create'
  2022-08-15 20:04:00 +0000 [warn]: #0 /fluentd/vendor/bundle/ruby/3.1.0/gems/fluent-plugin-gcs-0.4.1/lib/fluent/plugin/out_gcs.rb:123:in `write'
  2022-08-15 20:04:00 +0000 [warn]: #0 /fluentd/vendor/bundle/ruby/3.1.0/gems/fluentd-1.15.1/lib/fluent/plugin/output.rb:1180:in `try_flush'
  2022-08-15 20:04:00 +0000 [warn]: #0 /fluentd/vendor/bundle/ruby/3.1.0/gems/fluentd-1.15.1/lib/fluent/plugin/output.rb:1501:in `flush_thread_run'
  2022-08-15 20:04:00 +0000 [warn]: #0 /fluentd/vendor/bundle/ruby/3.1.0/gems/fluentd-1.15.1/lib/fluent/plugin/output.rb:501:in `block (2 levels) in start'
  2022-08-15 20:04:00 +0000 [warn]: #0 /fluentd/vendor/bundle/ruby/3.1.0/gems/fluentd-1.15.1/lib/fluent/plugin_helper/thread.rb:78:in `block in thread_create'
2022-08-15 20:04:00 +0000 [warn]: #0 [out_gcs] bad chunk is moved to /tmp/fluent/backup/worker0/out_gcs/5e64d1e3550ff0cf7802d2dbc6c511cc.log

Seeing this issue tyring to use fluent/fluentd-kubernetes-daemonset:v1.15-debian-gcs-1

Seems like the google libraries maybe are not locked and they expect fewer arguments...

Token exchange failed with status 400

Currently running the fluentd-plugin-gcs on a kops kubernetes cluster where I have the following error;

2024-01-12 14:17:56 +0000 [error]: #0 unexpected error error_class=RuntimeError error="Token exchange failed with status 400"

Below is my configuration;

              <match kube-apiserver-audit>
                @type gcs

                project {{ $.Values.global.cluster.gcp_project_id }}
                bucket cluster-access-{{ $.Values.global.cluster.name }}-{{ $.Values.global.cluster.domain | replace "." "-" }}
                path k8s-audit/

                <buffer tag,time>
                  @type file
                  path /var/log/fluent/gcs
                  timekey 600 # 10 minute partition
                  timekey_wait 10m
                  timekey_use_utc true # use utc
                  chunk_limit_size 256m
                </buffer>
              </match>

I currently have workload identity setup so I did not specify the keyfile path.

Logs are not getting pushed to gcs bucket

image: fluent/fluentd:v1.12.0-debian-1.0
fluent-plugin-gcs version: "fluent-plugin-gcs", "0.4.0"
Platform: Google Kubernetes Engine (GKE)
Node Version: v1.17.14-gke.1600

Description: I'm running fluentd to ship logs to gcs bucket using the above mentioned image and plugin, but the issue that I'm facing is that the logs are not being shipped to my gcs bucket. And there are no exceptions in the logs of the pod either.

Config Map:

apiVersion: v1
kind: ConfigMap
metadata:
  name: fluentd-config
  namespace: loki-grafana
data:
  fluent.conf: |-
    @include pods-fluent.conf
    @include loki-fluent.conf
    @include gcs-fluent.conf
  pods-fluent.conf: |-
    <source>
      @type tail
      read_from_head true
      tag kubernetes.*
      path /var/log/containers/*.log
      pos_file /var/log/fluentd-containers.log.pos
      exclude_path /var/log/containers/fluentd*
      path_key filename
      <parse>
        @type json
        time_type string
      </parse>
    </source>
    #########OPTIONAL################
    
    ######## IF you un-comment this you will get kuberenetes_meta data metrics in your logs#########
    # <filter kubernetes.**>
    #   @type kubernetes_metadata
    #   @id filter_kube_metadata
    #   kubernetes_url "#{ENV['FLUENT_FILTER_KUBERNETES_URL'] || 'https://' + ENV.fetch('KUBERNETES_SERVICE_HOST') + ':' + ENV.fetch('KUBERNETES_SERVICE_PORT') + '/api'}"
    #   verify_ssl "#{ENV['KUBERNETES_VERIFY_SSL'] || true}"
    #   ca_file "#{ENV['KUBERNETES_CA_FILE']}"
    #   skip_labels "#{ENV['FLUENT_KUBERNETES_METADATA_SKIP_LABELS'] || 'false'}"
    #   skip_container_metadata "#{ENV['FLUENT_KUBERNETES_METADATA_SKIP_CONTAINER_METADATA'] || 'false'}"
    #   skip_master_url "#{ENV['FLUENT_KUBERNETES_METADATA_SKIP_MASTER_URL'] || 'false'}"
    #   skip_namespace_metadata "#{ENV['FLUENT_KUBERNETES_METADATA_SKIP_NAMESPACE_METADATA'] || 'false'}"
    #</filter>
  loki-fluent.conf: |-
    <match **>
        @type loki
        #### url of loki can be your loki-service inside the cluster or an external endpoint#############
        url "http://loki:3100"
        extra_labels {"env":"prod"}
        <label>
          filename
        </label>
        label_keys "app,job,namespace,pod"
        extract_kubernetes_labels true
        flush_interval 10s
        flush_at_shutdown true
        buffer_chuck_limit 1m
    </match>
  gcs-fluent.conf: |-
    <match **>
      @type gcs
      
      project <your-gcp-project>
      keyfile "#{ENV['GCP_CRED']}"
      bucket <BUCKET_NAME>
      object_key_format %{path}%{time_slice}_%{index}.%{file_extension}
      path logs/${tag}/%Y/%m/%d/
      <buffer tag,time>
        @type file
        path /var/log/fluent/gcs
        timekey 1h
        timekey_wait 10min
        timekey_use_utc true
        flush_at_shutdown true
      </buffer>  
    </match>

Daemon Set file:

apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: fluentd
  namespace: loki-grafana
  labels:
    app: fluentd-logging
    version: v1
    kubernetes.io/cluster-service: "true"
spec:
  selector:
    matchLabels:
      name: fluentd-logging
      version: v1
      kubernetes.io/cluster-service: "true"
  template:
    metadata:
      labels:
        name: fluentd-logging
        version: v1
        kubernetes.io/cluster-service: "true"
    spec:
      serviceAccount: fluentd
      serviceAccountName: fluentd
      tolerations:
      - key: node-role.kubernetes.io/master
        effect: NoSchedule
      containers:
      - name: fluentd
        image: <your-image>
        command: 
          - /bin/sh 
          - '-c'
          - >
            fluent-gem i fluent-plugin-grafana-loki-licence-fix ;
            tini /fluentd/entrypoint.sh;
        volumeMounts:
        - name: varlog
          mountPath: /var/log
        - name: varlibdockercontainers
          mountPath: /var/lib/docker/containers
          readOnly: true
        - name: config
          mountPath: /fluentd/etc
        - name: google-cloud-key
          mountPath: /var/secrets/google
        env:
        - name: GCP_CRED
          value: /var/secrets/google/creds.json  
      terminationGracePeriodSeconds: 30
      volumes:
      - name: varlog
        hostPath:
          path: /var/log
      - name: varlibdockercontainers
        hostPath:
          path: /var/lib/docker/containers
      - name: config
        configMap:
          name: fluentd-config
      - name: google-cloud-key
        secret:
          secretName: fluentd-secret

Also seems like its not an auth issue as I was able to download a file from that bucket into my pod after install gcloud inside the pod.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.