-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect response for "/v2/types" API of Orion 2.6.1 and Orion 3.7.0 #4216
Comments
As per Orion's official document 'https://fiware-orion.readthedocs.io/en/latest/user/walkthrough_apiv2.html' As per above investigation and analysis of the I have also confirmed that |
@ArqamFarooqui110719 thank you for so detail issue report :) Changes from 2.2.0 to 2.3.0 (2.2.0...2.3.0) show modification on src/lib/mongoBackend/mongoQueryTypes.cpp that could be the cause of the issue. However, in the 2.3.0 changelog at https://github.com/telefonicaid/fiware-orion/releases/tag/2.3.0 The changes seems to be have done in PR #3510 |
Function to fix mongoAttributesForEntityType() ? |
PR #4217 |
The issue should has been fixed in master branch. @ArqamFarooqui110719 could you please test it using the |
I've tested and
[root@fiware-stdsv5-20 telefonicaiot-fiware-orion]# docker pull telefonicaiot/fiware-orion:latest latest: Pulling from telefonicaiot/fiware-orion b85a868b505f: Pull complete 4e9601c6f42d: Pull complete c6e76a008e18: Pull complete Digest: sha256:c9cc4b081fdf01227030b977922bfa126be3069a8c8e0d54e5a2030ea23f4da6 Status: Downloaded newer image for telefonicaiot/fiware-orion:latest [root@fiware-stdsv5-20 telefonicaiot-fiware-orion]# [root@fiware-stdsv5-20 telefonicaiot-fiware-orion]# docker run --name mongodb -d mongo:4.4 Unable to find image 'mongo:4.4' locally 4.4: Pulling from library/mongo 675920708c8b: Pull complete 6f9c8c301e0f: Pull complete 73738965c4ce: Pull complete 7fd6635b9ddf: Pull complete 73a471eaa4ad: Pull complete 595a03cbac53: Pull complete cbc6ab7f7529: Pull complete 2e737d6ddcde: Pull complete 874be3f13403: Pull complete Digest: sha256:92ff83581bcd54a7e8a74df21acc958761dd3c155d143edad06a1d6a139a8c7e Status: Downloaded newer image for mongo:4.4 b6a5f53f04be9c524d84442a813f5f0edfbf2116b7deccbd3b5531741eddd4bd [root@fiware-stdsv5-20 telefonicaiot-fiware-orion]# [root@fiware-stdsv5-20 telefonicaiot-fiware-orion]# docker run -d --name orionlatest --link mongodb:mongodb -p 1036:1026 telefonicaiot/fiware-orion:latest -dbhost mongodb 9840e6fc4e0abcae338e080ce1823226f9f8839ef01edbd850f90ad9bfeae2c4 [root@fiware-stdsv5-20 telefonicaiot-fiware-orion]#
[root@fiware-stdsv5-20 telefonicaiot-fiware-orion]# curl localhost:1036/version { "orion" : { "version" : "3.7.0-next", "uptime" : "0 d, 0 h, 0 m, 59 s", "git_hash" : "7b45e6e4b80861dca5ac91f4c72806878756bcfd", "compile_time" : "Wed Sep 28 14:58:27 UTC 2022", "compiled_by" : "root", "compiled_in" : "2ef47310d08d", "release_date" : "Wed Sep 28 14:58:27 UTC 2022", "machine" : "x86_64", "doc" : "https://fiware-orion.rtfd.io/", "libversions": { "boost": "1_74", "libcurl": "libcurl/7.74.0 OpenSSL/1.1.1n zlib/1.2.11 brotli/1.0.9 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.3.0) libssh2/1.9.0 nghttp2/1.43.0 librtmp/2.3", "libmosquitto": "2.0.12", "libmicrohttpd": "0.9.70", "openssl": "1.1", "rapidjson": "1.1.0", "mongoc": "1.17.4", "bson": "1.17.4" } } } [root@fiware-stdsv5-20 telefonicaiot-fiware-orion]#
[root@fiware-stdsv5-20 telefonicaiot-fiware-orion]# curl -v localhost:1036/v2/entities -s -S -H 'Content-Type: application/json' -d @- < { > "id": "Room1", > "type": "Room", > "temperature": { > "value": 23, > "type": "Float" > }, > "pressure": { > "value": 720, > "type": "Integer" > } > } > EOF * About to connect() to localhost port 1036 (#0) * Trying ::1... * Connected to localhost (::1) port 1036 (#0) > POST /v2/entities HTTP/1.1 > User-Agent: curl/7.29.0 > Host: localhost:1036 > Accept: */* > Content-Type: application/json > Content-Length: 158 > * upload completely sent off: 158 out of 158 bytes < HTTP/1.1 201 Created < Connection: Keep-Alive < Content-Length: 0 < Location: /v2/entities/Room1?type=Room < Fiware-Correlator: 68f77ac0-3fae-11ed-a749-0242ac110008 < Date: Thu, 29 Sep 2022 04:23:04 GMT < * Connection #0 to host localhost left intact [root@fiware-stdsv5-20 telefonicaiot-fiware-orion]# entity-id=Room2, entity-type=Room: [root@fiware-stdsv5-20 telefonicaiot-fiware-orion]# curl -v localhost:1036/v2/entities -s -S -H 'Content-Type: application/json' -d @- < { > "id": "Room2", > "type": "Room", > "temperature": { > "value": 23, > "type": "Integer" > }, > "pressure": { > "value": 720, > "type": "Float" > } > } > EOF * About to connect() to localhost port 1036 (#0) * Trying ::1... * Connected to localhost (::1) port 1036 (#0) > POST /v2/entities HTTP/1.1 > User-Agent: curl/7.29.0 > Host: localhost:1036 > Accept: */* > Content-Type: application/json > Content-Length: 158 > * upload completely sent off: 158 out of 158 bytes < HTTP/1.1 201 Created < Connection: Keep-Alive < Content-Length: 0 < Location: /v2/entities/Room2?type=Room < Fiware-Correlator: 82e188b8-3fae-11ed-a240-0242ac110008 < Date: Thu, 29 Sep 2022 04:23:47 GMT < * Connection #0 to host localhost left intact [root@fiware-stdsv5-20 telefonicaiot-fiware-orion]# entity-id=Building1, entity-type=Building: [root@fiware-stdsv5-20 telefonicaiot-fiware-orion]# curl -v localhost:1036/v2/entities -s -S -H 'Content-Type: application/json' -d @- < { > "id": "Building1", > "type": "Building", > "temperature": { > "value": 11, > "type": "String" > }, > "pressure": { > "value": 111, > "type": "String" > } > } > EOF * About to connect() to localhost port 1036 (#0) * Trying ::1... * Connected to localhost (::1) port 1036 (#0) > POST /v2/entities HTTP/1.1 > User-Agent: curl/7.29.0 > Host: localhost:1036 > Accept: */* > Content-Type: application/json > Content-Length: 156 > * upload completely sent off: 156 out of 156 bytes < HTTP/1.1 201 Created < Connection: Keep-Alive < Content-Length: 0 < Location: /v2/entities/Building1?type=Building < Fiware-Correlator: b2066f32-3fae-11ed-958e-0242ac110008 < Date: Thu, 29 Sep 2022 04:25:06 GMT < * Connection #0 to host localhost left intact [root@fiware-stdsv5-20 telefonicaiot-fiware-orion]#
[root@fiware-stdsv5-20 telefonicaiot-fiware-orion]# curl localhost:1036/v2/types/Room -s -S -H 'Accept: application/json' | python -mjson.tool { "attrs": { "pressure": { "types": [ "Float", "Integer" ] }, "temperature": { "types": [ "Float", "Integer" ] } }, "count": 2 } [root@fiware-stdsv5-20 telefonicaiot-fiware-orion]# [root@fiware-stdsv5-20 telefonicaiot-fiware-orion]# curl localhost:1036/v2/types/Building -s -S -H 'Accept: application/json' | python -mjson.tool { "attrs": { "pressure": { "types": [ "String" ] }, "temperature": { "types": [ "String" ] } }, "count": 1 } [root@fiware-stdsv5-20 telefonicaiot-fiware-orion]# [root@fiware-stdsv5-20 telefonicaiot-fiware-orion]# curl localhost:1036/v2/types -s -S -H 'Accept: application/json' | python -mjson.tool [ { "attrs": { "pressure": { "types": [ "String" ] }, "temperature": { "types": [ "String" ] } }, "count": 1, "type": "Building" }, { "attrs": { "pressure": { "types": [ "Float", "Integer" ] }, "temperature": { "types": [ "Float", "Integer" ] } }, "count": 2, "type": "Room" } ] [root@fiware-stdsv5-20 telefonicaiot-fiware-orion]# |
Based on this positive report, we are going to close the issue. Thanks for the feedback! |
Bug description
I have run 3 different versions of Orion via docker i.e. :
Orion 3.7.0 + MongoDB 4.4 - on PORT 1026
Orion 2.6.1 + MongoDB 3.6 - on PORT 1027
Orion 2.1.0 + MongoDB 3.4 - on PORT 1028
When executing
/v2/types/
query, I'm getting INCORRECT response with Orion-2.6.1 and Orion-3.7.0 as response is including all the attribute types belonging to different entity type. Screenshot for the same is attached below:In the above entity, the
"types of location attribute"
is only "Integer", but inOrion2.6.1
andOrion3.7.0
, the response of/v2/types/
query is also returning the extra"types of location attribute"
i.e. registered with another Entity.Same behavior is occurring with
"uploadDate"
attribute type inOrion2.6.1
andOrion3.7.0
.How to reproduce it
Orion-2.1.0
Orion-2.6.1
Orion-3.7.0
Expected behavior
Expected response of
/v2/types/
request should be as per Orion-2.1.0 i.e. types oflocation
anduploadDate
attribute should belongs to same entity.Additional information
Comparison of
/v2/types/
query responses:The text was updated successfully, but these errors were encountered: