aws / aws-cli

Universal Command Line Interface for Amazon Web Services
Other
15.56k stars 4.13k forks source link

MalformedManifestException with CreateJob for import #1298

Closed edrozenberg closed 9 years ago

edrozenberg commented 9 years ago

Using valid import manifests I'm getting MalformedManifestException running aws cli under Slackware Linux. Tried various versions of aws cli - 1.7.21, 22, 23.

Something else I tried - I used the CloudBerry S3 tool to successfully generate an import job. I then took that same manifest used by CloudBerry and got MalformedManifestException when using aws cli.

I submitted a tech support case to AWS - they used the same manifest and it was OK on aws cli under Windows, but they got the same error as me when running aws cli under Amazon Linux. So it could be related to character sets or line endings in some way.

Manifest:

manifestVersion: 2.0
bucket: aws-import-20150410-items
logBucket: aws-import-20150410-logs
deviceId: mydevice
generator: Myself
returnAddress:
   name: Myname
   company: Mycompany
   street1: Mystreet
   city: Mycity
   stateOrProvince: NY
   postalCode: 12345
   phoneNumber: 123-456-7890
   country: USA
eraseDevice: yes
notificationEmail: myemail@test.com;otheremail@test.com
serviceLevel: standard

Command:

aws importexport create-job --job-type import --manifest /root/Downloads/aws-import-20150407-manifest.txt --validate-only

Result:

A client error (MalformedManifestException) occurred when calling the CreateJob operation: Your manifest is not well-formed
kyleknap commented 9 years ago

Interesting. Can you paste a copy of the debug log from running that command. You can do so by appending --debug to the command you ran.

edrozenberg commented 9 years ago

Sure, please see:

https://gist.github.com/edrozenberg/4afadd44192bd3166be4#file-awscli-importjob-errout

kyleknap commented 9 years ago

@edrozenberg

It looks like you need to prefix the file path with file://. So try runnning something like:

aws importexport create-job --job-type import --manifest file:///root/Downloads/aws-import-20150407-manifest.txt --validate-only

Let me know if that helps.

edrozenberg commented 9 years ago

That works thanks! Had no idea the manifest param requires a url format. I didn't not see this in any documentation - not documented on the Amazon AWS site anywhere, no examples.

kyleknap commented 9 years ago

I think the docs say that --manifest is the text of the manifest file: http://docs.aws.amazon.com/cli/latest/reference/importexport/create-job.html. In general when using the CLI, there are very few places that actually do not require the file:// prefix, when you are trying to use the contents of a local file.

We will look into adding an example to make it more obvious though.

edrozenberg commented 9 years ago

Thanks Kyle,

I had seen that in the docs but didn't have the insight at all to use file://. Even knowing what I know now I couldn't find any examples showing file:// anywhere after searching online. An example would be super helpful to others who are similarly challenged.

kyleknap commented 9 years ago

@edrozenberg

Example was added via this PR: https://github.com/aws/aws-cli/pull/1316 Closing issue. Please reopen if there is anything else you need related to this issue.

edrozenberg commented 9 years ago

Thanks that sounds great. I assume the new documentation will show up at http://docs.aws.amazon.com/cli/latest/reference/importexport/create-job.html eventually (which is where most aws cli users would stumble across it).

kyleknap commented 9 years ago

Yep it will show up in the next release of the CLI. If you pull the HEAD of the develop branch, it will be shown in the output of aws importexport create-job help