Skip to content

Conversation

@handsomecheung
Copy link
Contributor

Fresh the variable tmp_sds (which is still holding info for header host) before handle the new header x-content-sha256.

Fixes #8684


Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • Example configuration file for the change
[SERVICE]
  flush 1

[INPUT]
  Name   dummy

[Output]
  Name oracle_log_analytics
  Match *
  Namespace ${namespace}
  config_file_location /mnt/oci-config
  oci_la_log_group_id ${group_id}
  oci_la_log_source_name source-name
  tls On
  tls.verify Off
  • Debug log output from testing the change
[2024/04/08 14:11:48] [debug] [output:oracle_log_analytics:oracle_log_analytics.0] placed request
[2024/04/08 14:11:48] [debug] [output:oracle_log_analytics:oracle_log_analytics.0] request header POST /20200601/namespaces/nxxxxxxx0/actions/uploadLogEventsFile?logGroupId=ocid1.loganalyticsloggroup.oc1.ap-tokyo-1.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&payloadType=JSON HTTP/1.1
host: loganalytics.ap-tokyo-1.oci.oraclecloud.com
date: Mon, 08 Apr 2024 14:11:48 GMT
x-content-sha256: loganalytics.ap-tokyo-1.oci.oraclecloud.com
[2024/04/08 14:11:48] [ info] [output:oracle_log_analytics:oracle_log_analytics.0] Unable to parser error response. reponse is not valid json
[2024/04/08 14:11:48] [error] [output:oracle_log_analytics:oracle_log_analytics.0] loganalytics.ap-tokyo-1.oci.oraclecloud.com:443, retry=false, HTTP status=400
<h1>Bad Message 400</h1><pre>reason: Illegal character CNTL=0x0</pre>
[2024/04/08 14:11:48] [debug] [out flush] cb_destroy coro_id=0
[2024/04/08 14:11:48] [debug] [retry] new retry created for task_id=0 attempts=1
[2024/04/08 14:11:48] [ warn] [engine] failed to flush chunk '217570-1712585507.215377216.flb', retry in 7 seconds: task_id=0, input=dummy.0 > output=oracle_log_analytics.0 (out_id=0)
[2024/04/08 14:11:49] [debug] [task] created task=0x7fd7400d1230 id=1 OK
[2024/04/08 14:11:49] [debug] [output:oracle_log_analytics:oracle_log_analytics.0] task_id=1 assigned to thread #0
[2024/04/08 14:11:49] [debug] [input chunk] update output instances with new chunk size diff=36, records=1, input=dummy.0
[2024/04/08 14:11:49] [debug] [output:oracle_log_analytics:oracle_log_analytics.0] payload={"logEvents":[{"logSourceName":"poc-app-file","logRecords":["dummy"]}]}
[2024/04/08 14:11:49] [debug] [output:oracle_log_analytics:oracle_log_analytics.0] lg_id=ocid1.loganalyticsloggroup.oc1.ap-tokyo-1.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
[2024/04/08 14:11:49] [error] [/root/fluent-bit/src/flb_sds.c:43 errno=12] Cannot allocate memory
[2024/04/08 14:11:49] [error] [/root/fluent-bit/plugins/out_oracle_log_analytics/oci_logan.c:609 errno=12] Cannot allocate memory
[2024/04/08 14:11:49] [error] [output:oracle_log_analytics:oracle_log_analytics.0] unable to compose uri for logGroup: ocid1.loganalyticsloggroup.oc1.ap-tokyo-1.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx logSet: (null)
[2024/04/08 14:11:49] [debug] [output:oracle_log_analytics:oracle_log_analytics.0] full_uri=(null)
  • [N/A] Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • [N/A] Run local packaging test showing all targets (including any new ones) build.
  • [N/A] Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • [N/A] Documentation required for this feature

Backporting

  • [N/A] Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

@edsiper
Copy link
Member

edsiper commented Apr 8, 2024

Thanks for this contribution. Change requests:

  • extra variable initialization is not needed
  • fix the subject of the commit, it must start with: out_oracle_analytics: ...
  • sign off the commits (DCO error)

Fresh the variable `tmp_sds` (which is still holding the data of header `host`) before handle the new header `x-content-sha256`.

Signed-off-by: hc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Oracle Log Analytics output plugin 400 Bad Request error

2 participants