Bugs: SecretClient: HTTP response with status code 400 #222
Replies: 1 comment 5 replies
-
This is by design. The EdgeX secret store tokens have a 1 hour time-to-live (TTL). If the service does not renew its token by the time it expires, it is invalidated. There are various ways to adjust the TTL (by settings on Vault, and setting of default TTL periods of EdgeX's tokens) if this is a frequent occurrence, however, it is a feature of the underlying open source component (Hashicorp Vault) that tokens do not live in perpetuity. Here is also a feature by bypass this behavior for add-on services https://docs.edgexfoundry.org/3.0/security/Ch-DelayedStartServices/ but this capability is disabled for the EdgeX core services by default to save space. Also, you should be able to restart the secretstore-setup component to regenerate fresh tokens and there is retry logic inside of the core services to pick up fresh tokens. Hopefully, one of the above three methods (a) don't sleep, (b) adjust TTL, or (c) use delayed start features should be able to resolve your issue. |
Beta Was this translation helpful? Give feedback.
-
When i running docker-compose.yml of repo edgex-compose tag v2.3.0 on my laptop, why i turn off my laptop more than 8h or more, when i start my laptop and all service in edgex have trouble with Error:
level=INFO ts=2023-12-02T05:06:31.568298855Z app=core-metadata source=secret.go:63 msg="Creating SecretClient"
level=INFO ts=2023-12-02T05:06:31.568303891Z app=core-metadata source=secret.go:70 msg="Reading secret store configuration and authentication token"
level=INFO ts=2023-12-02T05:06:31.568310132Z app=core-metadata source=secret.go:177 msg="load token from file"
level=INFO ts=2023-12-02T05:06:31.568360942Z app=core-metadata source=secret.go:88 msg="Attempting to create secret client"
level=INFO ts=2023-12-02T05:06:31.570047917Z app=core-metadata source=secrets.go:260 msg="ttl already <= half of the renewal period"
level=WARN ts=2023-12-02T05:06:31.570660927Z app=core-metadata source=secret.go:119 msg="Retryable failure while creating SecretClient: HTTP response with status code 400, message: failed to renew token"
level=INFO ts=2023-12-02T05:06:32.570736378Z app=core-metadata source=secret.go:70 msg="Reading secret store configuration and authentication token"
level=INFO ts=2023-12-02T05:06:32.570769964Z app=core-metadata source=secret.go:177 msg="load token from file"
level=INFO ts=2023-12-02T05:06:32.570845895Z app=core-metadata source=secret.go:88 msg="Attempting to create secret client"
level=INFO ts=2023-12-02T05:06:32.572491635Z app=core-metadata source=secrets.go:260 msg="ttl already <= half of the renewal period"
level=WARN ts=2023-12-02T05:06:32.573378577Z app=core-metadata source=secret.go:119 msg="Retryable failure while creating SecretClient: HTTP response with status code 400, message: failed to renew token"
level=INFO ts=2023-12-02T05:06:33.573591999Z app=core-metadata source=secret.go:70 msg="Reading secret store configuration and authentication token"
level=INFO ts=2023-12-02T05:06:33.573665631Z app=core-metadata source=secret.go:177 msg="load token from file"
level=INFO ts=2023-12-02T05:06:33.573766718Z app=core-metadata source=secret.go:88 msg="Attempting to create secret client"
level=INFO ts=2023-12-02T05:06:33.575905025Z app=core-metadata source=secrets.go:260 msg="ttl already <= half of the renewal period"
level=WARN ts=2023-12-02T05:06:33.577569573Z app=core-metadata source=secret.go:119 msg="Retryable failure while creating SecretClient: HTTP response with status code 400, message: failed to renew token"
level=INFO ts=2023-12-02T05:06:34.577736588Z app=core-metadata source=secret.go:70 msg="Reading secret store configuration and authentication token"
level=INFO ts=2023-12-02T05:06:34.577781603Z app=core-metadata source=secret.go:177 msg="load token from file"
level=INFO ts=2023-12-02T05:06:34.577888137Z app=core-metadata source=secret.go:88 msg="Attempting to create secret client"
level=INFO ts=2023-12-02T05:06:34.579910204Z app=core-metadata source=secrets.go:260 msg="ttl already <= half of the renewal period"
level=WARN ts=2023-12-02T05:06:34.581308499Z app=core-metadata source=secret.go:119 msg="Retryable failure while creating SecretClient: HTTP response with status code 400, message: failed to renew token"
level=INFO ts=2023-12-02T05:06:35.581496324Z app=core-metadata source=secret.go:70 msg="Reading secret store configuration and authentication token"
Please give me some helps about problem!!!
Thanks u
Beta Was this translation helpful? Give feedback.
All reactions