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

Tracing log files directory validation (moved to #11554) #11551

Closed
razvanphp opened this issue Jun 24, 2024 · 3 comments
Closed

Tracing log files directory validation (moved to #11554) #11551

razvanphp opened this issue Jun 24, 2024 · 3 comments
Labels

Comments

@razvanphp
Copy link

razvanphp commented Jun 24, 2024

Describe the bug

Not sure why my previous bug issue was deleted without a notice, but I will rephrase so that it's clear what the bug is, now that I confirmed it locally.

rabbitmq_tracing plugin configuration, more precisely directory is:

  1. not checked on runtime / startup, if it exists and it is writable
  2. not configurable in the new conf style

Reproduction steps

  1. enable rabbitmq_tracing plugin
  2. make folder /var/tmp/rabbitmq-tracing read-only
  3. go to the management GUI / Admin / Trace page
  4. you will see a fatal error:
Node 'rabbit@rabbitmq-0.(my-cluster-details).svc.cluster.local' could not be contacted: {badrpc,
{'EXIT',
{{badmatch,
{error,
erofs}},
[{rabbit_tracing_files,
list,
0,
[{file,
"rabbit_tracing_files.erl"},
{line,
18}]}]}}}

Expected behavior

On startup, the server checks if this directory exists and is writable and throws a fatal error otherwise.

Also, configuration for this plugin should also be available in the new config format, currently that's not possible:

2024-06-24 09:45:46.643406+00:00 [error] <0.156.0> Error preparing configuration in phase transform_datatypes:
2024-06-24 09:45:46.643462+00:00 [error] <0.156.0>   - Conf file attempted to set unknown variable: rabbitmq_tracing.password
2024-06-24 09:45:46.643530+00:00 [error] <0.156.0>   - Conf file attempted to set unknown variable: rabbitmq_tracing.username
2024-06-24 09:45:46.643588+00:00 [error] <0.156.0>   - Conf file attempted to set unknown variable: rabbitmq_tracing.directory

... same thing without rabbitmq_ prefix, it only works in advanced.config formatting.

Additional context

Originally reported here: bitnami/charts#27082

@michaelklishin
Copy link
Member

michaelklishin commented Jun 24, 2024

It was not "deleted without notice", it was moved to a discussion since it was a question #11546. The error returned by the OS was clearly explained to you.

This is not a bug. Only paths in rabbitmq.conf support validation. This has always been the case. You are welcome to contribute rabbitmq.conf support for the tracing plugin if you need it, this is the first such case in my 14 years around RabbitMQ.

The tracing plugin is only meant to be used in development environments and likely will be removed for 4.x because Wireshark and similar tools are superior in almost every way in production environments.

@michaelklishin
Copy link
Member

@razvanphp see #11554 which is more specific about what can be done. We will not be adding path validations outside of rabbitmq.conf since well over 90% of settings can be configured there (or exposed to rabbitmq.conf, in the case of plugins).

You are welcome to contribute rabbitmq.conf support for tracing. This is open source software you very likely get for free, after all. Smaller plugins can be used as an example.

Note that schema extensions have test suites usually named config_schema_SUITE that can be run with Make with

# this is an example
cd deps/rabbitmq_trust_store
gmake ct-config_schema

# open the results
open logs/index.html

@michaelklishin michaelklishin changed the title [rabbitmq_tracing] plugin configuration validation Tracing log files directory validation (moved to #11554) Jun 24, 2024
@razvanphp
Copy link
Author

Thank you very much for taking the time to explain the context, I also took the time to investigate this issue and I was frustrated that the issue disappeared, did not get any notification from github discussion indeed, my bad.

As you noticed, the bitnami chart created the premise for this bug to arise, for me and at least another person who opened the issue, so I'm glad it's sorted out, up until the plugin will be deprecated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants