GroveStreams

Component IDs must be unique490

pat private msg quote post Address this user
I have the following error :
Msg Count: 1 UID: xxxxx-64c3-3c24-98d6-xxxxxxxx ObjType: component PathName: 0004 Msg: A Component with an ID '0004' already exists. Component IDs must be unique within an Organization. MsgType: ERROR


I don't understand as I am only sending more data to a previously created component with ID '0004'.
I am sending the data using compressed json.

Where should I look the error for ?
Post 1 IP   flag post
MikeMills private msg quote post Address this user
GS thinks you're trying to create a new component with the same ID as one that already exists.

How are you triggering this error message? Is it during a Feed PUT? What does the call look like? You can turn on API tracing via the API Key window and then look for the api call in System Notifications.

If you still don't figure it out from that, then post the body, including the call stack, from the System Notification and we'll try and figure out the reason (X out the api key before you post it )
Post 2 IP   flag post
JVL private msg quote post Address this user
I am using PUT and the request looks like that :

Call Details:
URL: 
http://grovestreams.com/api/feed?api_key=xxxxxxxx-27fc-3483-bfe6-xxxxxxxx
Method:	PUT
Process Time:	.127 seconds
Client Address:	193.xxx.xxx.xxx
Client Attributes:	{org.restlet.startTime=1525482547144, org.restlet.http.headers=[[content-type: application/json], [Content-Encoding: gzip], [X-Forwarded-For: 282981], [Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3], [accept: */*], [user-agent: Ruby], [host: grovestreams.com], [content-length: 5169]], org.restlet.http.version=1.1}
Request Body:
 
{"feed": {"component": [
    {
        "componentId": "01",
        "componentTemplateId": "temp01",
        "stream": [
            {
                "data": [2.932],
                "streamId": "stream1"
            },
            {
                "data": [28.989],
                "streamId": "stream2"
...


I am breaking the data into 2 PUT, one of 150 data and one of 107 data
There is an auto-component registration.
I never have all the data (150+107=257) at ounce.
I either have the 107 or the 150 data and there is an error for the next PUT like this one
Response Body:
 
{
    "errCode": "ENTITY_MISSING",
    "message": "Component with identifier 'xxxxxxx-0727-3aa9-a6bf-xxxxxxxxxx' does not exist in the store.",
    "success": false
}


or like this one
Response Body:
{
    "errCode": "REQUEST_VALIDATION_FAILURE",
    "message": "A Component already exists with the name '01'.",
    "success": false
}


If I do a PUT again of the 150+107 data if the component is already registered, I have no error and I find my 257 data.

I will try to pause more between the 2 sending of the data.What do you think?
Post 3 IP   flag post
MikeMills private msg quote post Address this user
Try the pause.

GS will lock a component as it or its data is changing. My guess is the lock logic happens after the component is created, but your 2nd call arrives while the first call was still creating the component.

We'll review the lock logic, but try the pause for now.
Post 4 IP   flag post
JVL private msg quote post Address this user
Yes it works with a 10 second pause.

1)What would be the minimum (and secure) pause I could use ?

Currently my PUT is breaked down to send a maximum of 150x8 streams=1350 data values . Is that OK ?
2)Up to how many can I send using advanced API PUT, json, compressed ?
Post 5 IP   flag post
MikeMills private msg quote post Address this user
It should only take milliseconds to create a component. My guess is that you're making two calls from the same IP address in under 10 seconds and violating our 10 second rule.

Search the forum for X-Forwarded-For for a solution.

The maximum number of streams in an upload is 2,000. Just a number we picked years ago. Could probably go higher if someone has a Use Case that justifies it.
Post 6 IP   flag post
JVL private msg quote post Address this user
I was already using the X-Forwarded-For with different values for each PUT (see call details in the example above).

Maybe the PUT are really close and that is why I had those errors.

Anyway, I'll try to lower the 10 second delay between each PUT as I am using the X-Forwarded-For and see when it starts bugging
Post 7 IP   flag post
MikeMills private msg quote post Address this user
Usually creating a component is fast - a few milliseconds, but you're creating it with a lot of streams so it could take longer like a second or two. Issues with the network between the device and GS could occasionally add time too.
Post 8 IP   flag post
2748 8 8
Log in or sign up to compose a reply.
destitute