Missing key in mapping - aerospike

Trying to upload .csv file using Aerospike loader but I keep getting this error. I am trying to figure out what I am missing.
ERROR Parser :243 - "bin_list" Key is missing in mapping. Mapping: {"set":{"column_position":1,"type":"string"},"binlist":[{"name":"number_of_requests","value":{"column_position":3,"type":"integer"}},{"name":"size_of_the_content_returned","value":{"column_position":4,"type":"integer"}}],"key":{"column_position":2,"type":"string"}}
ERROR Parser :181 - Error in parsing mappingdef: {"set":{"column_position":1,"type":"string"},"binlist":[{"name":"number_of_requests","value":{"column_position":3,"type":"integer"}},{"name":"size_of_the_content_returned","value":{"column_position":4,"type":"integer"}}],"key":{"column_position":2,"type":"string"}}
ERROR AerospikeLoad :213 - java.lang.Exception: Config file parsing Error
my config.json file looks like:
{ "version" : "2.0", "dsv_config": {
"delimiter": "," ,
"n_columns_datafile": 4,
"header_exist": false}, "mappings": [
{
"key": {"column_position":2, "type": "string"},
"set": {"column_position":1, "type": "string"},
"binlist": [
{"name": "number_of_requests",
"value": {"column_position": 3, "type" : "integer"}},
{"name": "size_of_the_content_returned",
"value": {"column_position": 4, "type" : "integer"}}]}]}

wondering if "binlist" should be "bin_list". Looking in the code: public static final String BINLIST = "bin_list";

Related

Having issues reusing a stored variable in Graphql query in Karate framework

I have an issue with the variable usage. Tried different options(storing variable differently, declaring, using text for defining the query, storing the query as a variable).
Still have the below error:
"errors": [
{
"message": "invalid input syntax for type uuid: \"#(queueID)\"",
"locations": [
{
"line": 1,
"column": 11
}
],
"path": [
"deleteQueue"
],
"extensions": {
"code": "INTERNAL_SERVER_ERROR",
"exception": {
"name": "SequelizeDatabaseError",
"parent": {
"length": 109,
"name": "error",
"severity": "ERROR",
"code": "22P02",
"position": "34",
"file": "uuid.c",
"line": "137",
"routine": "string_to_uuid",
"sql": "DELETE FROM \"Queue\" WHERE \"id\" = '#(queueID)'"
This are my Gherkin steps:
Given request { query: 'mutation {createQueue(input: {name: "BDD-delete" }) {id} }'}
When method POST
Then status 200
And match response.data.createQueue.name == "BDD-delete"
* def queueID = response.data.createQueue.id
* print queueID
Given request { query: 'mutation {deleteQueue (id:"#(queueID)")} '}
And this is the output, when I print the queueID:
13:14:16.745 [main] INFO com.intuit.karate - [print] 758c0524-b18d-41f6-96aa-9db5eb8a7ac8
Tried using variable for the query
Given text payload =
"""
mutation {
createQueue(input: {name: "BDD-delete" })
{id, name}
}
"""
And the same tried for the deleteQueue
Feels like the issue is related with str and uuid. I must pass a uuid between the brackets in "#(queueID)"
First read this to get a sense of why this is happening: https://github.com/karatelabs/karate#rules-for-embedded-expressions
So try this:
Given request `{ query: 'mutation {deleteQueue (id:"${queueID}")} '}`
The good thing is that Karate supports JS-style placeholder replacement in strings within back-ticks.
Also refer: https://stackoverflow.com/a/69349118/143475

AppSync request mapping template errors not logged in CloudWatch

Crosspost from: https://repost.aws/questions/QUp5jDZ6bsRkeXhIwHgQaWkg/app-sync-request-mapping-template-errors-not-logged-in-cloud-watch
I have a simple resolver that has a simple Lambda function as a data source. This function always throws an error (to test out logging).
The resolver has request mapping template enabled and it is configured as follows:
$util.error("request mapping error 1")
The API has logging configured to be as verbose as possible yet I cannot see this request mapping error 1 from my CloudWatch logs in RequestMapping log type:
{
"logType": "RequestMapping",
"path": [
"singlePost"
],
"fieldName": "singlePost",
"resolverArn": "xxx",
"requestId": "bab942c6-9ae7-4771-ba45-7911afd262ac",
"context": {
"arguments": {
"id": "123"
},
"stash": {},
"outErrors": []
},
"fieldInError": false,
"errors": [],
"parentType": "Query",
"graphQLAPIId": "xxx"
}
The error is not completely lost because I can see this error in the query response:
{
"data": {
"singlePost": null
},
"errors": [
{
"path": [
"singlePost"
],
"data": null,
"errorType": null,
"errorInfo": null,
"locations": [
{
"line": 2,
"column": 3,
"sourceName": null
}
],
"message": "request mapping error 1"
}
]
}
When I add $util.appendError("append request mapping error 1") to the request mapping template so it looks like this:
$util.appendError("append request mapping error 1")
$util.error("request mapping error 1")
Then the appended error appears in the RequestMapping log type but the errors array is still empty:
{
"logType": "RequestMapping",
"path": [
"singlePost"
],
"fieldName": "singlePost",
"resolverArn": "xxx",
"requestId": "f8eecff9-b211-44b7-8753-6cc6e269c938",
"context": {
"arguments": {
"id": "123"
},
"stash": {},
"outErrors": [
{
"message": "append request mapping error 1"
}
]
},
"fieldInError": false,
"errors": [],
"parentType": "Query",
"graphQLAPIId": "xxx"
}
When I do the same thing with response mapping template then everything works as expected (errors array contains $util.error(message) and outErrors array contains $util.appendError(message) messages.
Is this working as expected so the $util.error(message) will never show up in RequestMapping type CloudWatch logs?
Under what conditions will errors array in RequestMapping log type be populated?
Bonus question: can the errors array contain more than 1 item for either RequestMapping or ResponseMapping log types?

How to create a bug using zoho API via postman?

I am working on Zoho API. Using postman I want to create/issue a bug in the system. For this, I am looking into Zoho Bug API. For creating a bug below are the request parameters list in the link.
Create a Bug
POST /portal/[PORTALID]/projects/[PROJECTID]/bugs/
Creates a bug.
Request Parameters
title* String Name of the bug.
description String Description of the bug.
assignee Long Assignee for the bug.
flag String Bug flag must be Internal or External.
classification_id Long Classification ID of the project.
milestone_id Long Milestone ID of the project.
due_date String [MM-DD-YYYY] Due date of the bug.
module_id Long Module ID of the project.
severity_id Long Severity ID of the project.
reproducible_id Long Reproducible ID of the project.
affectedmile_id Long Milestone ID of the project.
bug_followers Long Follower ID of the user.
uploaddoc File The maximum size to upload a file is 128 MB.
Custom Fields
CHAR1 - CHAR12 String Any text type of custom fields with string or picklist values.
LONG1 - LONG4 Long Numeric type of custom field.
DATE1 - DATE4 String [MM -DD-YYYY] Bug custom field in date format.
Sample Response
Status: 201 Created
Content Type: application/json;charset=utf-8
{
"bugs": [{
"id": 170876000001851001,
"key": "543",
"project": {
"id": 170876000000147021
},
"flag": "Internal",
"title": "UI issue in Status text box",
"reporter_id": "2060758",
"reported_person": "Patricia Boyle",
"created_time": "05-27-2014 08:38 AM",
"created_time_long": 1401188920000,
"assignee_name": "Not Assigned",
"classification": {
"id": 170876000000133041,
"type": "Feature(New)"
},
"severity": {
"id": 170876000000065005,
"type": "Major"
},
"status": {
"id": 170876000001077429,
"type": "known limitation"
},
"closed": false,
"reproducible": {
"id": 170876000000133005,
"type": "Always"
},
"module": {
"id": 170876000000494013,
"name": "ERP Phase I"
},
"link": {
"self": {
"url": "https://projectsapi.zoho.com/restapi/portal/2063927/projects/
170876000000147021/bugs/170876000001851001/"
},
"timesheet": {
"url": "https://projectsapi.zoho.com/restapi/portal/2063927/projects/
170876000000147021/bugs/170876000001851001/logs/"
}
}
}]
}
What I am doing
My request param
https://projectsapi.zoho.com/restapi/portal/[PORTALID]/projects/[PROJECTID]/bugs/
Key
`Authorization: myKey`
`Content Type: application/json`
In body
[{
"title": "My First Bug",
"description" :"This is my first bug",
"assignee" : "engr.usman" ,
"flag": "internal",
"classification_id": "1139168000000297069",
"milestone_id": "",
"due_date": "02-15-2018",
"module_id" : "1139168000000019372",
"severity_id" : "1139168000000007003",
"reproducible_id" : "1139168000000017069",
"status_id" :"1139168000000007045",
"resolution": "",
"affectedmile_id" : "",
"customfields": [
{
"column_name": "LONG1",
"label_name": "MSN#",
"value": "2999000190"
},
{
"column_name": "CHAR1",
"label_name": "Circle-Division-SubDivision",
"value": "Hyderabad - Latifabad - Tando Jam"
},
{
"column_name": "CHAR3",
"label_name": "LCD Indication",
"value": "S7"
},
{
"column_name": "CHAR2",
"label_name": "Reference #",
"value": "28371430034961U"
}
],
"uploaddoc" : [""]
}]
Response
{
"error": {
"code": 6831,
"message": "Input Parameter Missing"
}
}
Update 1
So just for testing it again. I have tried to send only mandatory and by default fields.
[{
"title": "My First Bug",
"flag": "internal",
"classification_id": "1139168000000297069",
"module_id" : "1139168000000019372",
"severity_id" : "1139168000000007003",
"customfields": [
{
"column_name": "CHAR2",
"label_name": "Reference #",
"value": "28371430034961U"
}
]
}]
But again I am getting same error Input Parameter Missing
I don't know why this error is generating. As there is no method of sending a request in the link.
Any help would be highly appreciated.

Bigquery fails to load data from Google Cloud Storage

I have a json record which looks like
{"customer_id":"2349uslvn2q3","order_id":"9sufd23rdl40",
"line_item": [{"line":"1","sku":"10","amount":10},
{"line":"2","sku":"20","amount":20}]}
I am trying to load record stated above into the table which has schema definition as,
"fields": [
{
"mode": "NULLABLE",
"name": "customer_id",
"type": "STRING"
},
{
"mode": "NULLABLE",
"name": "order_id",
"type": "STRING"
},
{
"mode": "REPEATED",
"name": "line_item",
"type": "STRING"
}
]
I am getting following error "message":
JSON parsing error in row starting at position 0 at file:
gs://gcs_bucket/file0. JSON object specified for non-record field:
line_item
I want line_item json string which can have more than 1 row as array of json string in line item column in table.
Any suggestion?
The first thing is that your input JSON should't have a "\n" character, so you should save it like:
{"customer_id":"2349uslvn2q3","order_id":"9sufd23rdl40", "line_item": [{"line":"1","sku":"10","amount":10}, {"line":"2","sku":"20","amount":20}]}
One example of how your JSON file should look like:
{"customer_id":"2349uslvn2q3","order_id":"9sufd23rdl40", "line_item": [{"line":"1","sku":"10","amount":10}, {"line":"2","sku":"20","amount":20}]}
{"customer_id":"2","order_id":"2", "line_item": [{"line":"2","sku":"20","amount":20}, {"line":"2","sku":"20","amount":20}]}
{"customer_id":"3","order_id":"3", "line_item": [{"line":"3","sku":"30","amount":30}, {"line":"3","sku":"30","amount":30}]}
And also your schema is not correct. It should be:
[
{
"mode": "NULLABLE",
"name": "customer_id",
"type": "STRING"
},
{
"mode": "NULLABLE",
"name": "order_id",
"type": "STRING"
},
{
"mode": "REPEATED",
"name": "line_item",
"type": "RECORD",
"fields": [{"name": "line", "type": "STRING"}, {"name": "sku", "type": "STRING"}, {"name": "amount", "type": "INTEGER"}]
}
]
For a better understanding of how schemas work, I've tried writing sort of a guide in this answer. Hopefully it can be of some value.
If your data content is saved for instance in a filed called gs://gcs_bucket/file0 and your schema in schema.json then this command should work for you:
bq load --source_format=NEWLINE_DELIMITED_JSON dataset.table gs://gcs_bucket/file0 schema.json
(supposing you are using the CLI tool as it seems to be the case in your question).

JSON syntax error

{
"manifest_version" : 2,
"name": "kittenbook",
"description" : "Replace photos on Facebook with kittens",
"version": "0.0.1"
"content_scripts": [
{
"matches": ["*://www.facebook.com/*"],
"js": [kittenbook.js"]
}
}
Can someone explain to me what is wrong with this?
Failed to load extension from: ~\kittenbook.html Manifest is not valid
JSON. Line: 6, column: 3, Syntax error.
You have 3 errors here.
at the end of "version":"0.0.1" << missing ,
at the end of "js":[kittenbook.js"] << missing " and the start of the string
also missing closing [] on the "content_scripts" :[
This is the correct JSON syntaxis.
{
"manifest_version": 2,
"name": "kittenbook",
"description": "Replace photos on Facebook with kittens",
"version": "0.0.1",
"content_scripts": [
{
"matches": [
"://www.facebook.com/"
],
"js": [
"kittenbook.js"
]
}
]
}
For future testing use JSONLint