I have a 'Create entity if does not exist' logic in my code.
In the code the GET returns no object but the POST returns a Duplicate error for some entities. Does anyone know how such an inconsistency can happen? Kindly help!
Looks like the resource with name 'Branch Data 1' already exists but not returned in GET and also not returned when queried on the Apigee front end.
GET response:
response.body = { "action" : "get", "application" : "xxxxxxxx", "params" : { "ql" : [ "name='Branch Data 1'" ] }, "path" : "/zzzz", "uri" : "https://api.usergrid.com/zzzz/yyyy/xxxx", "entities" : [ ], "timestamp" : 1442757941290, "duration" : 7, "organization" : "zzzz", "applicationName" : "yyyy", "count" : 0 }
POST to create Error:
response.body = {"error":"duplicate_unique_property_exists","timestamp":1442757947495,"duration":0,"exception":"org.apache.usergrid.persistence.exceptions.DuplicateUniquePropertyExistsException","error_description":"Entity yyyy requires that property named name be unique, value of Branch Data 1 exists"}
Are you for sure querying the correct collection? Can you reproduce this behaviour using cURL?
Can you please share a curl command which we can use to reproduce the problem? Thanks!
Thanks for your responses. I am using usergrid_iron in ruby to query the collection on production. I unfortunately do not have the curl command.
Also, The issue is reproducible from the apigee front end too.
Example when I submit this query through the front end, apigee does not return any data.
select * where name = 'Singapore Pools Great World City Branch'
But when I try to post the data { "name": "Singapore Pools Great World City Branch" } through the apigee front end I get this error:
error: Entity totocentre requires that property named name be unique, value of Singapore Pools Great World City Branch exists
There is some issue in some data being fetched. I am sure this data was inserted a few months ago but the GET query is not returning the data. Kindly help!
This is probably related to repair jobs needing to be run in Cassandra, which we will look into. Are you using api.usergrid.com?
was this resolved? I believe we have exactly the same issue in our Usergrid instance
Hi Apigee team, @jwest1, Can you kindly help with this issue. Is there any way to recover the data? Would really appreciate any work around for this. Its extremely critical for my app to recover this data.
The summary page shows the correct count for the entities, but when we try to query the data, more than half the data is missing.
Answer by williamking · Sep 21, 2015 at 02:06 PM
Do you get any results if you run your GET request without the QL parameter? I believe there might be something going on the backend processing requests with a QL value.
Hi William -
You have a paid instance of BaaS which is different from Apigee Developer and from other customers.
The description provided by @Mathew almost exactly matches the issues I've been having. A query against an entity that should provide a result does not. You can access the entity directly via its UUID or by iterating through all entities. But you you add in the QL to filter results, you get nothing back. The main difference is that his query is against the unique name property.
Yes, I understand the difference. api.usergrid.com runs version 1.0 whereas most customer instances run 2.0 which have major differences. In this case the duplicate unique property is related to something in Cassandra and how unique values are mangled on a per-collection basis. This would indicate that the unique value for the specified collection was not cleaned up when the entity was deleted. This is different than the issues you are experiencing with querying.
Answer by pchidambaram · Mar 18, 2016 at 06:52 AM
Hi,
We are now facing the kind of issue. When GET no resource returning, but try to POST, getting the below error.
Response:
{ "error": "duplicate_unique_property_exists", "timestamp": 1458282731176, "duration": 0, "error_description": "Entity \"payment_transaction\" requires that property named \"name\" be unique, value of 531b7f81-2710-2839-16af-8fb69f98f543 exists", "exception": "org.apache.usergrid.persistence.exceptions.DuplicateUniquePropertyExistsException" }
Note: We are using paid instance of BaaS.