VictoriaMetrics / VictoriaMetrics

VictoriaMetrics: fast, cost-effective monitoring solution and time series database
https://victoriametrics.com/
Apache License 2.0
11.97k stars 1.18k forks source link

vmagent: do not read trailing newline with -remoteWrite.basicAuth.passwordFile #6947

Open MiniPierre opened 2 weeks ago

MiniPierre commented 2 weeks ago

Is your feature request related to a problem? Please describe

When I am using the -remoteWrite.basicAuth.passwordFile with vmagent, it considers the trailing newline as being part of the password, and I am thus getting a 401 error code. I need to specifically remove the trailing newline, but most tools automatically add one when saving and it breaks my password file again

Describe the solution you'd like

Ignore the trailing newline at the end of the file

Describe alternatives you've considered

I have rewritten my Ansible templates to remove the trailing newline, but it always break when someone open the file and save it again

Additional information

No response

Haleygo commented 2 weeks ago

related to https://github.com/VictoriaMetrics/VictoriaMetrics/pull/6503. @zekker6 could you please take a look?

jiekun commented 6 days ago

Hi. Please see update comment here: https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6986#issuecomment-2352427617

Update from our side, behavior will be reverted to the previous state. We also will add a new flag to switch to the current behavior.

I added @zekker6 to assignees since it's duplicated to #6986 :)