Open hillmandj opened 1 year ago
@jszwedko opened this ticket up as promised, do you have any insights? Thanks!
Thanks @hillmandj !
So, it is expected that Vector isn't reloading the credentials via credentials_process
when a SIGHUP
is issued. the credentials_process
mechanism is wholly owned by the AWS Rust SDK. It is responsible for reloading the credentials when they are close to expiration. It sounds like you are observing the credentials not being reloaded automatically though?
@jszwedko, yes. The credentials were not loaded automatically and we had "ExpiredToken" errors that would occur with every event until we issued a SIGTERM
signal. After that the new pod was able to pick up the credentials. To be clear, it may have "attempted" to load credentials, but failed to stop the "ExpiredToken" errors when it came to our aws_s3 sink
Thanks for the details @hillmandj ! I think we'll need to try to reproduce and troubleshoot this one.
Another potential related issue: https://github.com/vectordotdev/vector/issues/7013
@hillmandj have you figured this out? I am familiar with aws-sdk for go and there is no function inside that able to recognize credentials expiration. I bet the same is with rust sdk
Any success here? We're having the exact same issue and I see the duplicates closed in December with no updates since.
Anything that would refresh the file on a SIGHUP would be wonderful 🙏
I'm wondering if this is related:
ERROR vector::topology::builder: msg="Healthcheck failed." error=Invalid credentials component_kind="sink" component_type="aws_s3" component_id=my-sink
I'm using Web Identity Token in a kubernetes pod via IAM roles for service accounts.
The funny thing is that the events are created in the bucket, but the healthcheck fails??
L.E.:
I found out why the healthcheck fails, but the logs are sunk to the S3 bucket: the AWS policy requires ListBucket
for the healthcheck. https://github.com/vectordotdev/vector/discussions/19792
A note for the community
Problem
We have a process in which secrets (files) for AWS are updated via a sidecar. The vector documentation states:
We have attempted various changes in configuration such as setting
auth.credentials_file
to point to the file path that gets updated as indicated here. Regardless, we still got errors that the token had expired for ouraws_s3
sink.Also, as a separate experiment, we went into a pod that had credential files recently refreshed, and manually triggered a HUP signal to see if vector would pick it up and it failed to do so. The only way we could get vector to pick up the new creds was to issue a TERM signal. We're handling this now by issuing a TERM signal to vector whenever we detect a file change for the credentials via a separate container/process, which seems wrong.
In a separate open issue, it is mentioned that Vector should be able to pick this up via SIGHUP and that AWS's
credential_process
configuration should help, but we have not seen this work. Everything with respect to the AWS secrets is pretty standard. The contents of the secret directory look like this:The credentials file itself looks like this:
And the configuration file looks like this:
The
credentials.json
file which is used incredential_process
follows the AWS specification, socat
should yield the result we expect based on the AWS documentation:One thing to note is this all began happening after we upgraded to vector 0.31.0 (we are on a later version of vector now but the problem still persists). Is there something we're missing here? It seems like this is all standard and vector should be able to handle changes to credential files automatically. Thanks!
Configuration
Version
0.32.1
Debug Output
No response
Example Data
No response
Additional Context
The AWS
credentials.json
file contents, notice the expiration date:Execution of a manual SIGHUP on the same pod, notice the timestamp as being earlier than the expiration date above:
References
12585