Error inspecting states in the "s3" backend: NoSuchBucket: The specified bucket does not exist
12,655
Solution 1
I was having the same issue.
Using aws command aws s3 ls
and aws s3api list-objects --bucket bucket-name
I could list the content but was still having the same issue.
Error inspecting states in the "s3" backend: NoSuchBucket: The specified bucket does not exist status code: 404, request id: xxxxx, host id: xxxxxx
Erased the ./terraform
directory and it fixed my issue.
Solution 2
I was getting the similar issue as below
Error inspecting states in the "s3" backend:
AccessDenied: Access Denied
status code: 403, request id: XXXXXX, host id: XXXXX
And after removing the .terraform file it worked (In my case I was using Jenkins, so I have to remove it from Jenkins server's project directory and it worked for me). Thanks !
Related videos on Youtube
Author by
Cool Eagle
Updated on July 12, 2022Comments
-
Cool Eagle almost 2 years
I am running
terraform init
on my terraform modules folder and I am getting below.Error inspecting states in the "s3" backend: NoSuchBucket: The specified bucket does not exist status code: 404, request id: 6667B0A661F9C62F, host id: 3mC8DNrS/gGHtp7mhVMRtpIUeMaNXs2cEozEY+akZf1ixFD6x2qQx7c3mX02M1BIbyfYowYt35s=
-
mihow over 5 yearsI had the same issue. Deleting the .terraform directory and running init again fixed the issue for me.
-
-
Try431 over 5 yearsErasing ./terraform helped us out! Thanks kind stranger!
-
sith over 5 yearsHoly ___ ! Erasing ./terraform helped us out! Thanks a lot. saved my day...
-
Davos over 4 yearsIn my case I changed the terraform backend, moving to a different S3 bucket. Inside the
.terraform
directory, theterraform.tfstate
file still listed the old bucket, editing that file then allowedterraform init
to work successfully. -
ashtonium over 4 yearsThis also resolved
Error inspecting states in the "s3" backend: AccessDenied
for me. thanks! -
tonymagz almost 4 yearsThank you so much, I was extremely frustrated with this!