"message": "read tcp server_ip:8080->jump_ip:52182: i/o timeout", "extensions": {"code": "ErrorInvalidRequest"

Trying to insert data by curl in json format around 5k record, file size is 5.73 MB.
we are getting below error

“message”: “read tcp server_ip:8080->jump_ip:52182: i/o timeout”, “extensions”: {“code”: “ErrorInvalidRequest”}

Less than 2k record were inserted properly.

In alpha we are getting below logs:

Got connection request: cluster_info_only:true
1 no leader at term 2; dropping index reading msg
[0x1] Read index context timed out
1 no leader at term 2; dropping index reading msg
1 is starting a new election at term 2
1 became pre-candidate at term 2

Can you please help here.

Note: we are running dgraph(v20.07.2) on single VM using default configuration.

Hi @Swapnil,

Some points to start with:

  • alpha logs you posted are referring to a leader re-election, can you post the entire alpha log file
  • can you try inserting the data using live loader
  • Usually a ErrorInvalidReques might mean that the params are wrong or the file doesn’t exist. Can you paste here your cURL command
  • Are you using whitelistening ?

Thanks,

Curl command:
curl --location --request POST ‘http://localhost:8000/mutate?commitNow=true
–header ‘Content-Type: application/json’
–header ‘Cookie: JSESSIONID=14cuy85v9d3ux1bhcuc886r6y’
–data-raw ‘{
“set”: [
{
“crn”: ,
“pickup_date”: “2020-05-25”,
“status”: “completed”,
“actual_kms”: 3.5,
“trip_time”: 8.0,
“ride_time”: 8.0,
“gross_operator_bill”: 6.97,
“cash_to_driver”: 0.0,
“final_customer_bill_incl_service_tax”: 9.57,
“discount_amount”: 0.0,
“upfront_fare”: “8.45”,
“start_at”: “2020-05-24 19:37:19”,
“stop_at”: “2020-05-24 19:41:54”,
“actual_pickup_lat”: “-27.23571883982721”,
“actual_pickup_lng”: “152.98069548807385”,
“actual_drop_lat”: “-27.265015142063856”,
“actual_drop_lng”: “152.98156980439367”,
“upfront_time”: “5.0”,
“upfront_distance”: “3.5”,
“entered_drop_lat”: “-27.26528979999999”,
“entered_drop_lng”: “152.9815735”,
“user_lat”: “-27.26520126222378”,
“user_lng”: “152.98159059151354”,
“booking_received_at”: “2020-05-24 19:24:47”,
“client_located_at”: “2020-05-24 19:34:54”,
“cancellationreason”: “NULL”,
“vehicle”: [
{
“uid”: “:",
“car_number”: “”,
“original_car_category”: “”
}
],
“customer”: [
{
“uid”: "
:”,
“user_id”: ,
“user_imei”: “”,
“customer_email_id”: “”,
“customer_mobile_number”: “”
}
],
“driver”: [
{
“uid”: “:",
“driver_imei”: “”,
“service_city”: “”,
“original_car_category”: “”
}
],
“dt”: “2020-05-25”
},
{
“crn”: ,
“pickup_date”: “2020-05-25”,
“status”: “cancelled”,
“actual_kms”: 0.0,
“trip_time”: 0.0,
“ride_time”: 0.0,
“gross_operator_bill”: 0.0,
“cash_to_driver”: 0.0,
“final_customer_bill_incl_service_tax”: 0.0,
“discount_amount”: 0.0,
“upfront_fare”: “41.97”,
“start_at”: “”,
“stop_at”: “”,
“actual_pickup_lat”: “NULL”,
“actual_pickup_lng”: “NULL”,
“actual_drop_lat”: “NULL”,
“actual_drop_lng”: “NULL”,
“upfront_time”: “26.0”,
“upfront_distance”: “20.9”,
“entered_drop_lat”: “NULL”,
“entered_drop_lng”: “NULL”,
“user_lat”: “-37.7739147”,
“user_lng”: “144.9098671”,
“booking_received_at”: “2020-05-24 19:28:17”,
“client_located_at”: “2020-05-24 19:30:57”,
“cancellationreason”: “CANCEL_CUSTOMER_OTHERS”,
“vehicle”: [
{
“uid”: "
:”,
“car_number”: “”,
“original_car_category”: “”
}
],
“customer”: [
{
“uid”: “:",
“user_id”: ,
“user_imei”: “”,
“customer_email_id”: “”,
“customer_mobile_number”: “”
}
],
“driver”: [
{
“uid”: "
:”,
“driver_imei”: “”,
“service_city”: “”,
“original_car_category”: “”
}
],
“dt”: “2020-05-25”
}
]
}’

Yes we are using whitelisting.

Thank you Omar.

Hi @Swapnil

I was able to load data via curl but I had to validate your json as the one attached here is not a valid JSON.

Also the way you were specifying the uids for customer driver and vehicle is incorrect (as you were just passing a :) - you should either specify a blank uid (_:text) or give it a proper unique uid of your choice (0x123).

In my case the curl request look like:

curl -H 'Content-Type: application/json' "http://localhost:8080/mutate?commitNow=true" --data-binary @data.json

and the response is successful:

{
  "data": {
    "code": "Success",
    "message": "Done",
    "queries": null,
    "uids": {
      "customer": "0xb",
      "dg.2338800972.17": "0x8",
      "driver": "0xa",
      "vehicle": "0x9"
    }
  },
  "extensions": {
    "server_latency": {
      "parsing_ns": 206367,
      "processing_ns": 18924744,
      "assign_timestamp_ns": 1520144,
      "total_ns": 21081282
    },
    "txn": {
      "start_ts": 60,
      "commit_ts": 61,
      "preds": [
        "1-actual_drop_lat",
        "1-actual_drop_lng",
        "1-actual_kms",
        "1-actual_pickup_lat",
        "1-actual_pickup_lng",
        "1-booking_received_at",
        "1-cancellationreason",
        "1-car_number",
        "1-cash_to_driver",
        "1-client_located_at",
        "1-crn",
        "1-customer",
        "1-customer_email_id",
        "1-customer_mobile_number",
        "1-discount_amount",
        "1-driver",
        "1-driver_imei",
        "1-dt",
        "1-entered_drop_lat",
        "1-entered_drop_lng",
        "1-final_customer_bill_incl_service_tax",
        "1-gross_operator_bill",
        "1-original_car_category",
        "1-pickup_date",
        "1-ride_time",
        "1-service_city",
        "1-start_at",
        "1-status",
        "1-stop_at",
        "1-trip_time",
        "1-upfront_distance",
        "1-upfront_fare",
        "1-upfront_time",
        "1-user_id",
        "1-user_imei",
        "1-user_lat",
        "1-user_lng",
        "1-vehicle"
      ]
    }
  }
}

Will attach here the modified json file for your conveniencedata.json (1.3 KB)

If you are still getting the same error, please try from ratel or try with live loader.

Best,
Omar