Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Permission denied error on executing localstack init script file

I am trying to create s3 bucket on localstack ready hook using a bash file. But on trying to run the localstack container getting error as follow:

[ MainThread] localstack.runtime.init : Error while running script Script(path='/etc/localstack/init/ready.d/buckets.sh', stage=READY, state=ERROR): [Errno 13] Permission denied: '/etc/localstack/init/ready.d/buckets.sh'

The docker-compose volume section for localstack is as follow:

volumes:

  - ./internal/localstack-seed:/etc/localstack/init/ready.d
like image 863
ANANDA KRISHNAN Avatar asked Feb 01 '26 22:02

ANANDA KRISHNAN


1 Answers

please make sure the file is executable by running chmod +x buckets.sh, or you can cover the whole folder with find /path/to/folder -type f -exec chmod +x {} \;. this is mentioned in the init hooks documentation, but towards the end, which might make it less visible.

if you're using localstack init hooks with frameworks like testcontainers, you can explicitly set the mode of the file, or you need to watch out that the new permissions are being picked up.

like image 85
Anca G Avatar answered Feb 04 '26 01:02

Anca G



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!