title: Key does not exist, but only for a single folder
body: <p>I'm running into an issue with a folder in an S3 bucket, but I can't figure it out... I'm using the following bash script to keep the 10 most recent builds of our app in an S3 bucket. Every time we kick off the build, it just copies the builds down (1 -> 0, 2 -> 1, etc.) and drops the latest build in folder 9. It works well until I get to folder 9, then I get the error <code>An error occurred (404) when calling the HeadObject operation: Key "iv/9/" does not exist</code> even though folder 9 does actually exist. </p>
  
  <pre><code>declare -i i=0
  
  for j in `seq 1 9`
  do
      echo "Copying build # $j to build # $i"
      aws s3 mv s3://xvaws-builds/iv/$j/ s3://xvaws-builds/iv/$i/
      let i++
  done
  </code></pre>
  
  <p>I thought maybe folder 9 was being named something goofy, had some whitespace, etc., but after running 'aws s3 ls s3://myaws-builds/iv/' everything looks good...</p>
  
  <p>The results of the loop look like:</p>
  
  <pre><code>Copying build # 1 to build # 0
  move: s3://myaws-builds/iv/1/ to s3://myaws-builds/iv/0/
  Copying build # 2 to build # 1
  move: s3://myaws-builds/iv/2/ to s3://myaws-builds/iv/1/
  Copying build # 3 to build # 2
  move: s3://myaws-builds/iv/3/ to s3://myaws-builds/iv/2/
  Copying build # 4 to build # 3
  move: s3://myaws-builds/iv/4/ to s3://myaws-builds/iv/3/
  Copying build # 5 to build # 4
  move: s3://myaws-builds/iv/5/ to s3://myaws-builds/iv/4/
  Copying build # 6 to build # 5
  move: s3://myaws-builds/iv/6/ to s3://myaws-builds/iv/5/
  Copying build # 7 to build # 6
  move: s3://myaws-builds/iv/7/ to s3://myaws-builds/iv/6/
  Copying build # 8 to build # 7
  move: s3://myaws-builds/iv/8/ to s3://myaws-builds/iv/7/
  Copying build # 9 to build # 8
  An error occurred (404) when calling the HeadObject operation: Key "iv/9/" does not exist
  </code></pre>
  
  <p>The results of an ls on that directory returns:</p>
  
  <pre><code>PRE 0/ PRE 1/ PRE 2/ PRE 3/ PRE 4/ PRE 5/ PRE 6/ PRE 7/ PRE 8/ PRE 9/ 2017-02-06 10:06:51 0
  </code></pre>
  
  <p>Any thoughts?</p>