devicehive-java-server icon indicating copy to clipboard operation
devicehive-java-server copied to clipboard

Device registration request continuously fails with 409 (Conflict) when network already exists

Open sorjef opened this issue 10 years ago • 5 comments

In some cases, request to device PUT method continuously (retries do not help) fails with 409 conflict status. This is probably related to the already existing network. Here is an example JSON (notice that the network default should be already registered in the DH):

{ 
  name: 'some-name',
  key: '00000000-0000-0000-0000-000000000000',
  network: { name: 'default' },
  status: 'Online',
  deviceClass: { name: 'some-class', version: '0.1', equipment: [] } 
}

Here is an example of the response:

{
  "error": null,
  "message": "Error occurred. Please, retry again"
}

sorjef avatar May 20 '15 16:05 sorjef

Can it be that network with same name exists under different user/access token? In such case it cannot be reused by name neither can be duplicate created. The error is not informative though so hard to tell. I just tried registering devices using ws in existing network and it was ok for many many devices in a row.

demon-xxi avatar May 20 '15 17:05 demon-xxi

In the DH installation where this issue is reproducible, there is only 1 default admin user and only 1 Default access key. So I do no think this can be the case

sorjef avatar May 20 '15 19:05 sorjef

Is this a duplicate of issue #10 ?

demon-xxi avatar Jun 24 '15 13:06 demon-xxi

@demon-xxi Not sure about that. #10 says about concurrent registration requests with the same deviceClass. This issue might be related to the deviceClass but to reproduce it I did not use parallel requests.

sorjef avatar Jun 24 '15 14:06 sorjef

Moving this issue to the backlog cause it seems to be not reproducible on 2.0.2-SHAPSHOT version of DH (spring boot based server).

vikua avatar Jun 30 '15 10:06 vikua