litestream icon indicating copy to clipboard operation
litestream copied to clipboard

Feature request: ability to exit on S3 permissions error

Open simonw opened this issue 3 years ago • 2 comments

I'm running Litestream using temporary S3 credentials that expire after 12 hours (created using the same mechanism as this: https://github.com/simonw/s3-credentials/blob/0.12.1/README.md)

I'm running in a container on Fly that fetches fresh credentials every time it starts - which means that to refresh credentials I need to quit Litestream so Fly will restart the container automatically.

I'm currently doing that by having my container exit automatically if it has been running for more than 10 hours:

  • https://github.com/simonw/datasette-scale-to-zero/issues/3

My ideal solution here would be an option to configure Litestream to exit the process if it gets a permissions error from S3 - that way I could use expiring credentials and now that my container will automatically quit and restart when they expire.

simonw avatar Aug 05 '22 23:08 simonw

@simonw I think we are trying to solve the same problem given this issue and https://github.com/benbjohnson/litestream/issues/246. Did you find a workaround? I may have to fallback to a cron job that restarts my service every few hours.

clintonb avatar Nov 28 '23 20:11 clintonb

We use https://github.com/beeper/litestream/blob/beeper/etc/aws-config + https://github.com/beeper/litestream/blob/beeper/etc/aws-k8s-sa-provider as a workaround for expiring credentials.

The same idea can be adapted to refresh real AWS sessions.

hifi avatar Nov 29 '23 04:11 hifi