Closed RKO1337 closed 3 weeks ago
Hi @RKO1337! As far as I can see, you have specified tls in the storage, but you didn't provide that specification for the VM backup. When vmbackup tried to create a snapshot without tls flags, it got a 401 response code.
// create Transport
tr, err := httputils.Transport(createSnapshotURL, *tlsCertFile, *tlsKeyFile, *tlsCAFile, *tlsServerName, *tlsInsecureSkipVerify)
if err != nil {
return "", err
}
hc := &http.Client{Transport: tr}
You need to specify the tls flags in your vmbackup service https://docs.victoriametrics.com/vmbackup/#command-line-flags
Thanks for your reply @dmitryk-dk. Yes, storage is configured with tls and httpAuth.
But vmbackup should be able to connect with with the supplied httpAuth.password and httpAuth.username.
For example a curl with username and password works as expected.
curl -u 'xxxx:xxxx' https://vm.fqdn:8428/snapshot/create
{"status":"ok","snapshot":"20240424095325-17C8E8A10D930F2D"}
Thanks for your replay @dmitryk-dk. Yes, storage is configured with tls and httpAuth.
But vmbackup should be able to connect with with the supplied httpAuth.password and httpAuth.username.
For example a curl with username and password works as expected.
curl -u 'xxxx:xxxx' https://vm.fqdn:8428/snapshot/create {"status":"ok","snapshot":"20240424095325-17C8E8A10D930F2D"}
If you want to use httpAuth from the vmbackup, you should specify user and password in the snapshot.createURL
flag
Thanks, I was able to create the snapshot
vmbackup-prod -storageDataPath=/data/victoriametrics-server -snapshot.createURL='https://<user>:<password>@vm.fqdn:8428/snapshot/create' -dst=fs:///data/snapshots/victoriametrics-server
Describe the bug
When creating a snapshot with vmbackup and victoriametrics single node using httpAuth a http 401 error is returned.
To Reproduce
Create a snapshot with httpAuth enabled.
vmbackup-prod -storageDataPath=/data/victoriametrics-server -snapshot.createURL=https://vm.fqdn:8428/snapshot/create -httpAuth.username=xxxx-httpAuth.password=file:///etc/victoriametrics/httpauth.password -dst=fs:///data/snapshots/victoriametrics-server
Version
vmbackup-prod -version vmbackup-20240411-145841-tags-v1.100.1-0-g9ee51e34
victoria-metrics-prod -version victoria-metrics-20240411-145756-tags-v1.100.1-0-g9ee51e34c
Logs
Screenshots
No response
Used command-line flags
/usr/local/bin/victoria-metrics-prod -httpListenAddr=:8428 -storageDataPath /data/victoriametrics-server -retentionPeriod 720 -selfScrapeInterval 60s -promscrape.config /etc/victoriametrics/promscrape-server.yaml -promscrape.fileSDCheckInterval=10s -tls=true -tlsCertFile=/etc/ssl/private/wildcard.combo -tlsKeyFile=/etc/ssl/private/wildcard.key -tlsMinVersion=TLS13 -httpAuth.username=xxxx -httpAuth.password=file:///etc/victoriametrics/httpauth.password
Additional information
No response