401 Unauthorized: unable to parse authentication credentials

Hello colleagues,
please help with the issue:

exactly as in manual (sorry can’t add an URL - this web site limitation)

  1. /etc/influxdb.conf
    [http]
    https-enabled = true
    https-certificate = “/etc/ssl/influxdb-selfsigned.crt”
    https-private-key = “/etc/ssl/influxdb-selfsigned.key”

auth_enable = true
ping-auth-enabled = true

  1. /etc/telegraf/telegraf.conf
    [[outputs.influxdb]]
    urls = [":8086"]
    username = “monitoring”
    password = “monitoring”
    tls_cert = “/etc/ssl/telegraf-selfsigned.crt”
    tls_key = “/etc/ssl/telegraf-selfsigned.key”
    insecure_skip_verify = true
    [[inputs.influxdb]]
    urls = [
    “https::8086/debug/vars”
    ]
    tls_cert = “/etc/ssl/telegraf-selfsigned.crt”
    tls_key = “/etc/ssl/telegraf-selfsigned.key”
    insecure_skip_verify = true

  1. Console

influx -ssl -unsafeSsl -host localhost:8086
~$ influx -ssl -unsafeSsl
Connected to https::8086 version 1.7.9
InfluxDB shell version: 1.7.9

auth
username: admin
password:
show users
user admin


monitoring true
admin true
mmm false

SET PASSWORD FOR “monitoring” = ‘monitoring’
show grants for monitoring
database privilege


telegraf ALL PRIVILEGES

quit
monitoring@monitoring2:~$ sudo -H -u telegraf telegraf -config /etc/telegraf/telegraf.conf
2020-01-22T04:26:48Z I! Starting Telegraf 1.13.0
2020-01-22T04:26:48Z I! Loaded inputs: internal net cpu disk diskio kernel mem processes swap system influxdb
2020-01-22T04:26:48Z I! Loaded aggregators:
2020-01-22T04:26:48Z I! Loaded processors:
2020-01-22T04:26:48Z I! Loaded outputs: influxdb
2020-01-22T04:26:48Z I! Tags enabled: host=monitoring2
2020-01-22T04:26:48Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:“monitoring2”, Flush Interval:10s
2020-01-22T04:26:50Z E! [inputs.influxdb] Error in plugin: 401 Unauthorized: unable to parse authentication credentials
^C2020-01-22T04:26:51Z I! [agent] Hang on, flushing any cached metrics before shutdown

well, the question is: how user “monitoring” with password ‘monitoring’ is unable to authorize if password was set a second before?

I think you just need to set username and password for the input as well as the output.

Hi Daniel,
thank you. This must be “false

/etc/influxdb/influxdb.conf
Enables authentication on the /ping, /metrics, and deprecated /status
Preformatted textendpoints. This setting has no effect if auth-enabled is set to false.
# ping-auth-enabled = false