forem / selfhost

Selfhost your Forem Community on your own infrastructure 🎉
https://www.forem.com/get-started/
GNU Affero General Public License v3.0
1.43k stars 169 forks source link

S3 permissions not updated on repeated runs leads to server initialization error #60

Closed alberthuang24 closed 2 years ago

alberthuang24 commented 2 years ago

Describe the bug S3 permissions not updated on repeated runs leads to server initialization error.

When I ran ansible for the first time, for some reason I didn't set it up properly and ran it a second time, the S3 permissions were not updated. This resulted in the following image. forem.ign failed to download and resulted in a system initialization error

To Reproduce Steps to reproduce the behavior:

  1. Run ansible-playbook -i inventory/forem/setup.yml playbooks/providers/aws.yml
  2. Delete the old EC2 Instance
  3. Rerun ansible-playbook -i inventory/forem/setup.yml playbooks/providers/aws.yml
  4. Goto AWS dashboard show system logs
  5. See an error

Screenshots 3hV5IHqnVM

OS (please complete the following information):

Cloud Provider (please complete the following information):

Additional context Add any other context about the problem here.

jdoss commented 2 years ago

The playbooks are not fully idempotent. It's hard to say why that S3 bucket didn't get set with the correct permissions. Did Ansible die off with an error? That would be handy to help you debug this.

I'd delete the bucket and try again. If it still fails, please give us the current permissions on the bucket and policy. It should have this policy set:

https://github.com/forem/selfhost/blob/main/playbooks/providers/aws.yml#L105-L122

alberthuang24 commented 2 years ago

The playbooks are not fully idempotent. It's hard to say why that S3 bucket didn't get set with the correct permissions. Did Ansible die off with an error? That would be handy to help you debug this.

I'd delete the bucket and try again. If it still fails, please give us the current permissions on the bucket and policy. It should have this policy set:

https://github.com/forem/selfhost/blob/main/playbooks/providers/aws.yml#L105-L122

Yes, it worked after I deleted the old bucket