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 !

Share:
12,655

Related videos on Youtube

Cool Eagle
Author by

Cool Eagle

Updated on July 12, 2022

Comments

  • Cool Eagle
    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
      mihow over 5 years
      I had the same issue. Deleting the .terraform directory and running init again fixed the issue for me.
  • Try431
    Try431 over 5 years
    Erasing ./terraform helped us out! Thanks kind stranger!
  • sith
    sith over 5 years
    Holy ___ ! Erasing ./terraform helped us out! Thanks a lot. saved my day...
  • Davos
    Davos over 4 years
    In my case I changed the terraform backend, moving to a different S3 bucket. Inside the .terraform directory, the terraform.tfstate file still listed the old bucket, editing that file then allowed terraform init to work successfully.
  • ashtonium
    ashtonium over 4 years
    This also resolved Error inspecting states in the "s3" backend: AccessDenied for me. thanks!
  • tonymagz
    tonymagz almost 4 years
    Thank you so much, I was extremely frustrated with this!