{"action":"closed","issue":{"url":"https://api.github.com/repos/telefonicaid/fiware-orion/issues/1774","repository_url":"https://api.github.com/repos/telefonicaid/fiware-orion","labels_url":"https://api.github.com/repos/telefonicaid/fiware-orion/issues/1774/labels{/name}","comments_url":"https://api.github.com/repos/telefonicaid/fiware-orion/issues/1774/comments","events_url":"https://api.github.com/repos/telefonicaid/fiware-orion/issues/1774/events","html_url":"https://github.com/telefonicaid/fiware-orion/issues/1774","id":132110552,"number":1774,"title":"[BUG] In v1/updateContext if servicePath exceed the max length allowed","user":{"login":"iariasleon","id":4330098,"avatar_url":"https://avatars.githubusercontent.com/u/4330098?v=3","gravatar_id":"","url":"https://api.github.com/users/iariasleon","html_url":"https://github.com/iariasleon","followers_url":"https://api.github.com/users/iariasleon/followers","following_url":"https://api.github.com/users/iariasleon/following{/other_user}","gists_url":"https://api.github.com/users/iariasleon/gists{/gist_id}","starred_url":"https://api.github.com/users/iariasleon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iariasleon/subscriptions","organizations_url":"https://api.github.com/users/iariasleon/orgs","repos_url":"https://api.github.com/users/iariasleon/repos","events_url":"https://api.github.com/users/iariasleon/events{/privacy}","received_events_url":"https://api.github.com/users/iariasleon/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/telefonicaid/fiware-orion/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/telefonicaid/fiware-orion/labels/P7","name":"P7","color":"5319e7"}],"state":"closed","locked":false,"assignee":{"login":"crbrox","id":1384296,"avatar_url":"https://avatars.githubusercontent.com/u/1384296?v=3","gravatar_id":"","url":"https://api.github.com/users/crbrox","html_url":"https://github.com/crbrox","followers_url":"https://api.github.com/users/crbrox/followers","following_url":"https://api.github.com/users/crbrox/following{/other_user}","gists_url":"https://api.github.com/users/crbrox/gists{/gist_id}","starred_url":"https://api.github.com/users/crbrox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crbrox/subscriptions","organizations_url":"https://api.github.com/users/crbrox/orgs","repos_url":"https://api.github.com/users/crbrox/repos","events_url":"https://api.github.com/users/crbrox/events{/privacy}","received_events_url":"https://api.github.com/users/crbrox/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/telefonicaid/fiware-orion/milestones/22","html_url":"https://github.com/telefonicaid/fiware-orion/milestones/0.28.0","labels_url":"https://api.github.com/repos/telefonicaid/fiware-orion/milestones/22/labels","id":1384056,"number":22,"title":"0.28.0","description":"","creator":{"login":"fgalan","id":1534240,"avatar_url":"https://avatars.githubusercontent.com/u/1534240?v=3","gravatar_id":"","url":"https://api.github.com/users/fgalan","html_url":"https://github.com/fgalan","followers_url":"https://api.github.com/users/fgalan/followers","following_url":"https://api.github.com/users/fgalan/following{/other_user}","gists_url":"https://api.github.com/users/fgalan/gists{/gist_id}","starred_url":"https://api.github.com/users/fgalan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fgalan/subscriptions","organizations_url":"https://api.github.com/users/fgalan/orgs","repos_url":"https://api.github.com/users/fgalan/repos","events_url":"https://api.github.com/users/fgalan/events{/privacy}","received_events_url":"https://api.github.com/users/fgalan/received_events","type":"User","site_admin":false},"open_issues":35,"closed_issues":20,"state":"open","created_at":"2015-10-29T18:56:23Z","updated_at":"2016-02-10T15:50:20Z","due_on":"2016-02-28T23:00:00Z","closed_at":null},"comments":5,"created_at":"2016-02-08T11:00:13Z","updated_at":"2016-02-10T15:50:20Z","closed_at":"2016-02-10T15:50:20Z","body":"Similar to https://github.com/telefonicaid/fiware-orion/issues/1423\r\n\r\nThe servicePath allowed ten levels with 50 char each one, but now if we use 50 or more in several levels, ex: /tester1testcom/12345678901234567890123456789012, it is returned an error. Reference: https://github.com/telefonicaid/fiware-orion/issues/1764.\r\n\r\n#### Append Request\r\n```\r\nPOST http://localhost:1026/v1/updateContext\r\nFiware-Service: default\r\nFiware-ServicePath: /tester1testcom/12345678901234567890123456789012\r\nContent-Type: application/json\r\n{\r\n    \"contextElements\": [\r\n        {\r\n            \"type\": \"House\",\r\n            \"isPattern\": \"false\",\r\n            \"id\": \"Room\",\r\n            \"attributes\": [\r\n            {\r\n                \"name\": \"temperature\",\r\n                \"type\": \"float\",\r\n                \"value\": \"23\"\r\n            }\r\n            ]\r\n        }\r\n    ],\r\n    \"updateAction\": \"APPEND\"\r\n}\r\n```\r\n\r\n#### Append response\r\n```\r\nStatus: 200: OK\r\n<updateContextResponse>\r\n  <contextResponseList>\r\n    <contextElementResponse>\r\n      <contextElement>\r\n        <entityId type=\"House\" isPattern=\"false\">\r\n          <id>Room</id>\r\n        </entityId>\r\n        <contextAttributeList>\r\n          <contextAttribute>\r\n            <name>temperature</name>\r\n            <type>float</type>\r\n            <contextValue></contextValue>\r\n          </contextAttribute>\r\n        </contextAttributeList>\r\n      </contextElement>\r\n      <statusCode>\r\n        <code>200</code>\r\n        <reasonPhrase>OK</reasonPhrase>\r\n      </statusCode>\r\n    </contextElementResponse>\r\n  </contextResponseList>\r\n</updateContextResponse>\r\n```\r\n\r\nIf we try to use the same previous request, returns an error, but if we reduce the `service-Path` length, works perfectly.\r\n\r\n\r\n#### Append response\r\n```\r\nStatus: 200: OK\r\n<updateContextResponse>\r\n  <contextResponseList>\r\n    <contextElementResponse>\r\n      <contextElement>\r\n        <entityId type=\"House\" isPattern=\"false\">\r\n          <id>Room</id>\r\n        </entityId>\r\n        <contextAttributeList>\r\n          <contextAttribute>\r\n            <name>temperature</name>\r\n            <type>float</type>\r\n            <contextValue></contextValue>\r\n          </contextAttribute>\r\n        </contextAttributeList>\r\n      </contextElement>\r\n      <statusCode>\r\n        <code>472</code>\r\n        <reasonPhrase>request parameter is invalid/not allowed</reasonPhrase>\r\n        <details>Database Error &#40;collection: orion-default.entities - insert&#40;&#41;: { _id: { id: \\&quot;Room\\&quot;, type: \\&quot;House\\&quot;, servicePath: \\&quot;/tester1testcom/12345678901234567890123456789012\\&quot; }, attrNames: [ \\&quot;temperature\\&quot; ], attrs: { temperature: { type: \\&quot;float\\&quot;, creDate: 1454929131, modDate: 1454929131, value: \\&quot;23\\&quot; } }, creDate: 1454929131, modDate: 1454929131 } - exception: OperationException: { index: 0, code: 11000, errmsg: \\&quot;insertDocument :: caused by :: 11000 E11000 duplicate key error index: orion-default.entities.$_id_  dup key: { : { id: \\&quot;Room\\&quot;, type: \\&quot;House\\&quot;, service...\\&quot;, op: { _id: { id: \\&quot;Room\\&quot;, type: \\&quot;House\\&quot;, servicePath: \\&quot;/tester1testcom/12345678901234567890123456789012\\&quot; }, attrNames: [ \\&quot;temperature\\&quot; ], attrs: { temperature: { type: \\&quot;float\\&quot;, creDate: 1454929131, modDate: 1454929131, value: \\&quot;23\\&quot; } }, creDate: 1454929131, modDate: 1454929131 } }&#41;</details>\r\n      </statusCode>\r\n    </contextElementResponse>\r\n  </contextResponseList>\r\n</updateContextResponse>\r\n\r\n```\r\n\r\n\r\n\r\n"}}