-
Notifications
You must be signed in to change notification settings - Fork 266
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
Error on StructuredValue attribute type when using commands on a IoT device #3363
Comments
You mean that if you do the provision of the device using this
Then it works as expected? |
Yes, If you don't add commands array to that object, then it work as expected. |
What about if you provision using the command array but you get the attribute individually, i.e.:
Is that working? |
Isn't working, the behaviour is the same. |
I'll try to reproduce the problem. Could you post the docker-compose.yml you are using (reduced to the relevant container) so I can replay your same test, please? |
Thanks @fgalan here you are. version: "3.7"
services:
orion:
image: fiware/orion:2.0.0
container_name: orion
restart: always
depends_on:
- mongo-orion
ports:
- "1026:1026"
command: -corsOrigin __ALL -corsMaxAge 600 -dbhost mongo-orion
iotagent-json:
image: fiware/iotagent-json:1.8.0
container_name: iotagent-json
restart: always
depends_on:
- mongo-orion
- orion
ports:
- "4041:4041"
- "7896:7896"
environment:
- "IOTA_CB_HOST=orion"
- "IOTA_CB_PORT=1026"
- "IOTA_NORTH_PORT=4041"
- "IOTA_REGISTRY_TYPE=mongodb"
- "IOTA_LOG_LEVEL=DEBUG"
- "IOTA_TIMESTAMP=true"
- "IOTA_MONGO_HOST=mongo-orion"
- "IOTA_MONGO_PORT=27017"
- "IOTA_MONGO_DB=iotagent-json"
- "IOTA_HTTP_PORT=7896"
- "IOTA_PROVIDER_URL=http://iotagent-json:4041"
mongo-orion:
image: mongo:3.4
container_name: mongo-orion
restart: always
ports:
- "27017:27017" |
For the records, an equivalente version of docker-compose.yml for version 1 (the one I have in the machine where I'm going to test).
|
Hint: using this for CB
|
I'm doing the same test, but getting a different result:
So it it working in almost all cases... except in the one associated to a structured value. For that case, the The log I get in Orion is the following one:
The lack of iota-json log in this case make me think that probably the Orion->IOTA-JSON connection is not working. I'll have a look to that next... |
I have confirmed the connection problems. Looking to the IOTA-JSON container IP:
Now accessing to Orion container:
Trying to ping by name:
Thus, I'm adding "172.17.0.4 iotagent-json" to /etc/hosts and now it works
Running again the above query:
Log:
I'm getting the same result but now the log shows Orion-IOTA-JSON interaction. The problem is not yet solved, but having that ok is a necesary condition to have the whole system to work. Maybe something is missing in docker-compose.yml so the name binding for IOTA-JSON gets created inside the Orion container. |
Let's analyze this iteration at IOTA: Context Broker forwards the query to IOTA (honouring the registration for the ping attribute):
and IOTA responses:
Is correct to responde with a 404 error here? I think so, as the IOTA is not prepared to process queries on command attributes (like ping). It is prepared to process updates on command attributes or queries on lazy attributes (at least in theory, as lazy attributes support is yet pending in that agent, see telefonicaid/iotagent-json#89). However, If my guessing is correct, what is not so correct is the reasonPhrase, as sensor001 do exists. |
After this debugging session, it seems we have two situations here:
In both situations, the Once the problem has been narrowed down, the next step is trying to create a .test able to reproduce the case isolately and debug it. This issue could be similar to #3162 although I'm not fully sure, as that issue in that case is seems that the |
Reference documents in orion-testservice DB (useful to implement the .test):
|
Fixed by PR #3379 |
The fix has landed in master branch. Please @tioperez redeploy using |
Thanks @fgalan |
You're welcome! "Thanks" means that you have tested and it is working now? :) |
Yeap works fine 👌 |
Thanks for the feedback! Based in your report I think we can close this issue. |
I've deployed the iot stack with docker. These are the used containers:
[other containers not involved in the issue ...]
Documentation consulted:
GIVEN: A device ready to receive a command called "ping"
Creating that Device through the IoT Agent JSON
WHEN: Update or append to that entity now in Orion CB an attribute of type StructuredValue
THEN: Retrieve an entity by ID sensor001 or List entities
The response does not contains the value for the attribute example_attr
So the issue appears when you use commands array creating a device through the IoT Agent JSON
The text was updated successfully, but these errors were encountered: