0

Any idea what's wrong with the following curl statement? I am using this to upload files to a neptune database from an EC2 instance.

curl -X POST \
    -H 'Content-Type: application/json' \
    https://*my neptune endpoint*:8182/loader -d '
    {​​​​
    "source" : "s3://<file path>/<file name>.nq",
      "format" : "nquads",
      "iamRoleArn" : "arn:aws:iam::##########:role/NeptuneLoadFromS3",
      "region" : "us-east-1",
      "failOnError" : "FALSE",
      "parallelism" : "MEDIUM",
      "updateSingleCardinalityProperties" : "FALSE",
      "queueRequest" : "TRUE"
    }​​​​'

I have used this command template multiple times before without issue. The only things that i have changed here are the neptune endpoint and the file location on s3. When i run it now, i get the following error:

{"detailedMessage":"Json parse error: Unexpected character ('​' (code 8203 / 0x200b)): was expecting double-quote to
 start field name\n at [Source: (String)\"{​​​​\n    \"source\" : \"s3://<file path>/<file name>.nq\",\n      \"format\" 
: \"nquads\",\n      \"iamRoleArn\" : \"arn:aws:iam::#########:role/NeptuneLoadFromS3\",\n      \"region\" 
: \"us-east-1\",\n      \"failOnError\" : \"FALSE\",\n      \"parallelism\" : \"MEDIUM\",\n      
\"updateSingleCardinalityProperties\" : \"FALSE\",\n      \"queueRequest\" : \"TRUE\"\n    }​​​​\"; line: 1, column: 3]",
"requestId":"4ebb82c9-107d-8578-cf84-8056817e504e","code":"BadRequestException"}

Anything that i change in the statement does not seem to have an effect on the outcome. Is there something really obvious that i am missing here?

Stanislav Kralin
  • 11,070
  • 4
  • 35
  • 58
katseye
  • 23
  • 4
  • 1
    You have several [zero-width spaces](https://util.unicode.org/UnicodeJsps/character.jsp?a=200B) (U+200B) after the leading `{` and after the closing `}`. They aren't allowed as whitespace between elements in JSON. You can see that with some editors, but more usefully the error tells you explicitly what's wrong by saying *"Unexpected character ('​' (code 8203 / 0x200b)): was expecting double-quote"*. – T.J. Crowder Jan 15 '21 at 10:34
  • (**Thank you** for using copy-and-paste when doing your question, rather than retyping. You'd be shocked how many people retype, and as a result hide the problem.) – T.J. Crowder Jan 15 '21 at 10:34
  • **All:** This is effectively a typo (and separately there are plenty of duplicates on the site already). Please just vote to close as a duplicate of one of those or as a typo. We don't need Yet More Answers to this problem. – T.J. Crowder Jan 15 '21 at 10:36
  • 1
    thanks a ton for the prompt answer. The issue is now resolved. And i got to learn something new today! – katseye Jan 15 '21 at 11:26

0 Answers0