Closed harlanbarnes closed 9 years ago
@benesch Do you have any thoughts on this?
Do you get the same error with other providers? I've only tried Vagrant with containers once and I couldn't get it to work (independent of s3auth).
You can test that you're box is OK by downloading it from s3 yourself (via Curl), then manually adding it to vagrant with vagrant box add
. Does that work?
Metadata-wise, I see that we use sha1
while you're using sha256
. Probably not the issue.
When we upload the metadata file, we specify a content-type of application/json
to S3. Try that; I think I recall having strange problems before because I let AWS guess the content type.
As soon as I saw your content-type response, I knew that was going to be it. And it was! I've been bitten by that before in various other scenarios.
Thanks so much for that (and for the plugin). That was the last glitch in the most rockin' private image distribution configuration I've ever made. I can't even describe the horrendous ideas I had to trying to make a private image repo before I found this plugin.
Anyway, using Packer, plus some Ruby glue to make the metadata boxes and this plugin has made it all work nicely.
Thanks again,
hb
Yikes. I got bit by this. For those that stumble here, you'll need to upload your file to S3 with "application/json" as your content encoding.
It's easy to do with the awscli tools:
aws s3 put --content-encoding "application/json" local_file s3://bucket/remote_file
Re-opening this until I can add a note to the README documenting this.
Cheers!
I'm sure I'm doing something wrong, but I'm stuck. I feel positive I'm doing something stupid, but I can't spot it.
I have a json file called
base-precise64.json
and it is in a private space on an S3 bucket. We'll call that S3 bucketmycompany
.I'm simply trying a
vagrant up --provider lxc
. (I tried it with other providers as well with no luck.)Here's my relevant Vagrant config:
The
base-precise64.json
looks something like this:The error I am getting is:
I've turned on the VAGRANT_LOG and added some
sleep 30
statements in Vagrant'sexecute_curl
method inVagrant::Util::Downloader
to see what files are being created. (I was first concerned that the AWS creds weren't making it or some other general auth problem.)From the logs, I can see curl being executed twice ... apparently for the same
base-precise64.json
file. The first time, the logs say this:but don't seem to download the file (even though it says it is). Then again, I guess a
HEAD
should't produce an actual download.The second time, it produces a file like
/home/hbarnes/.vagrant.d/tmp/box20d6fd9a9557f951fbee211ce1308ddcd42d9b44
. The contents of this tmp file is the contents ofbase-precise64.json
. So it's successfully authenticating against S3 to pull down the metadata file.Here's where the breakage happens. Vagrant seems to think this is a normal box file and not a metadata file to lookup the ACTUAL box file from. And, obviously, that's why the
bsdtar
command fails.As a side note, I also tried using the metadata JSON file locally and THAT seems to work fine. It figures out that it needs to download the box from the information in the file and continues on like normal.
Here's the full log: https://gist.github.com/harlanbarnes/0eb56fa5fec2c0caa140
Do you have any ideas/pointers from me to look?
Thanks for your time.