Tran_Van_Moi
Tran_Van_Moi

Reputation: 23

Upload document to cloudsearch use cs-import-documents

I installed cs-import-documents after run the follow command line:

cs-import-documents -d http://mydomain.cloudsearch.amazonaws.com --source Documents/data.json`

I get the following error:

Content is not allowed in prolog. Unable to unmarshall error response ({
   "message": "Request forbidden by administrative rules", 
    "__type": "CloudSearchException" } ) 
(Service: AmazonCloudSearchv2; Status Code: 403; Error Code: 403 Forbidden; Request ID: null)

What am I doing wrong?

Upvotes: 2

Views: 2433

Answers (2)

jonorri
jonorri

Reputation: 19

The error actually says it all Tran_Van_Moi. domainNames should be domainnames. The regular expression states [a-z][a-z0-9\-]+]. So no upper-case letters should fix this.

Upvotes: 0

alexroussos
alexroussos

Reputation: 2681

It sounds like you don't have you AWS access keys set up correctly and it's rejecting you for lacking authorization.

This is covered in the "Installing Command Line Tools" section of the docs below -- have another look at that and double-check that you've followed all the steps correctly (particularly step 7 which deals with credentials)
http://docs.aws.amazon.com/cloudsearch/latest/developerguide/using-cloudsearch-command-line-tools.html

Also for debugging (as mentioned in step 9 of the above link), try running cs-import-documents with no args. If you've set things up correctly, you should get the message "Expected at least one input source".

Upvotes: 1

Related Questions