Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fluentd as Docker log driver for Wings #5008

Open
3 tasks done
promarcel opened this issue Feb 14, 2024 · 5 comments · May be fixed by pterodactyl/wings#185
Open
3 tasks done

fluentd as Docker log driver for Wings #5008

promarcel opened this issue Feb 14, 2024 · 5 comments · May be fixed by pterodactyl/wings#185
Labels
bug Something that's not working as it's intended to be.

Comments

@promarcel
Copy link

Current Behavior

Hey everyone, I am currently running into a more specific problem with the Wings Control Plane.

I am trying to change the log driver of Wings from /etc/pterodactyl/config.yml. The default value local works without problems, as does json-file.

However, I would like to use fluentd at this point (already configured system-wide via the daemon.json of Docker). However, the control plane overwrites this setting from the system with its options from the configuration for containers that it creates. I can set the type, but Wings keeps throwing the default options from the source code (compress, max-file, max-size and mode) into the config value. Passing an empty object {} is ignored and adds the above values. Exactly the same if I manually set a tag (this is merged with the default values).

Example from /etc/pterodactyl/config.yml:

[...]
docker:
  log_config:
    type: fluentd
    config:
      tag: "docker.{{.Name}}"
[...]

Once, servers are started on this node, they are failing due to the environment has options, the fluentd log driver doesn't know because the default options are being merged into the config: array.

Does anyone of you have an idea about this?

Expected Behavior

Using the Docker log driver fluentd to allow logging tools like td-agent, fluentbit and other to catch logs to a log storage solution.

Steps to Reproduce

Adjust the configuration of Wings to the example provided at "Current Behavior".

Panel Version

1.11.5

Wings Version

1.11.8

Games and/or Eggs Affected

No response

Docker Image

No response

Error Logs

No response

Is there an existing issue for this?

  • I have searched the existing issues before opening this issue.
  • I have provided all relevant details, including the specific game and Docker images I am using if this issue is related to running a server.
  • I have checked in the Discord server and believe this is a bug with the software, and not a configuration issue with my specific system.
@promarcel promarcel added the not confirmed Report seems plausible but requires additional testing or 3rd part confirmation. label Feb 14, 2024
@danny6167
Copy link
Member

Can confirm.

What is happening is when wings starts up, it starts with an empty Configuration struct that is then filled with the defaults and THEN we overlay the data from the config.yml using yaml.Unmarshal().

This overwrites any values in the struct that exist in the config.yml, but it does not empty the LogConfig.Config map. It does what yaml.Unmarshal() is designed to do, it merges them.

A possible fix might be to re-order the operations. Load the config.yml into the empty struct and then call defaults.Set() to fill in any that is missing. Testing this idea myself, it seems to be working as desired. But at this point I don't know if there is any unintended consequences.

@danny6167
Copy link
Member

@promarcel If I provided you a source code patch that does what I described above, would you be willing to test, and do you have the ability to apply the patch and compile ?

@promarcel
Copy link
Author

promarcel commented Mar 18, 2024

@danny6167 Thanks for your reply, and sorry for my late reply.
I would be happy to test a corresponding patch, it is no problem for us to apply it and compile the program ourselves!

@danny6167
Copy link
Member

Hey @promarcel - I have this branch here that has the required changes.
It appears to be working fine for me. Please test and let me know.

https://github.com/danny6167/wings/tree/config-load-order

@danny6167
Copy link
Member

Note: If you're not passing any options, you will need to supply an empty value to config to keep it empty.

 log_config:
    type: fluentd
    config: {}

@danny6167 danny6167 added bug Something that's not working as it's intended to be. and removed not confirmed Report seems plausible but requires additional testing or 3rd part confirmation. labels May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that's not working as it's intended to be.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants