500 error in AWS s3 code

SiteSetting.s3_upload_bucket = SiteSetting.s3_backup_bucket does indeed bring the site back up. It’s not really what I want to do with uploaded files though.