Skip to content
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

IoT Agent and Orion Connection: [DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. #838

Closed
fadelcg opened this issue Jul 19, 2024 · 10 comments

Comments

@fadelcg
Copy link

fadelcg commented Jul 19, 2024

IoT Agent JSON version the issue has been seen with

latest

Bound or port used (API interaction)

Northbound (Provision API and NGSI Interactions)

NGSI version

NGSIv2

Are you running a container?

Yes, I am using a contaner (Docker, Kubernetes...)

Image type

None

Expected behaviour you didn't see

No response

Unexpected behaviour you saw

I am trying to read the IoT Device that I provide from the Context Broker:
image

But the device cannot be found in the Context Broker.

When I try to trace the problem of Orion from the docker logs of the IoT Agent: This error comes up:

image

Steps to reproduce the problem

The service group creation is successfull:
image

The Provision of the devoce in the IoT Agent is also successfull:
image

Configs

This is the docker-compose file i am using:

volumes:
mongodb: ~

services:
iot-agent:
image: fiware/iotagent-json:latest
hostname: iot-agent
container_name: fiware-iot-agent
depends_on:
- mongodb
expose:
- "4041"
- "7896"
ports:
- "4041:4041"
- "7896:7896"
environment:
- "IOTA_CB_HOST=orion"
- "IOTA_CB_PORT=1026"
- "IOTA_NORTH_PORT=4041"
- "IOTA_REGISTRY_TYPE=mongodb"
- "IOTA_MONGO_HOST=mongodb"
- "IOTA_MONGO_PORT=27017"
- "IOTA_MONGO_DB=iotagent-json"
- "IOTA_HTTP_PORT=7896"
- "IOTA_PROVIDER_URL=http://iot-agent:4041"

mongodb:
    image: mongo:4.4
    hostname: mongodb
    container_name: db-mongo
    ports:
        - "27017:27017"
    command: --bind_ip_all
    volumes:
        - mongodb:/data

orion:
    image: fiware/orion:latest
    hostname: orion
    container_name: fiware-orion
    depends_on:
        - mongodb
    expose:
        - "1026"
    ports:
        - "1026:1026"
    command: -dbhost mongodb

Log output

time=2024-07-19T19:27:58.817Z | lvl=DEBUG | corr=1ec9d5cc-93ec-4999-9f40-1fce9512965b | trans=1ec9d5cc-93ec-4999-9f40-1fce9512965b | op=IoTAgentNGSI.DeviceGroupService | from=n/a | srv=openiot | subsrv=/ | msg=validateGroup {"apikey":"4jggokgpepnvsb2uv4s40d59ov","cbroker":"
http://orion:1026","resource":"","type":"Thing","service":"openiot","subservice":"/"}
| comp=IoTAgent (node:1) [DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead. (Triggered by calling processImmediate on process.) (Use
node --trace-deprecation ...
to show where the warning was created)

Here below another logs when i run the docker with --trace deprecation:
{"op":"IoTAgentNGSI.JEXL","time":"2024-07-20T09:36:52.889Z","lvl":"INFO","msg":"Trasformations can be added to JEXL parser"}
(node:1) [DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead. (Triggered by calling emit on process.)
at emitMakeCallbackDeprecation (node:domain:143:13)
at process.topLevelDomainCallback (node:domain:157:5)
at process.callbackTrampoline (node:internal/async_hooks:128:24)

@fadelcg fadelcg added the bug label Jul 19, 2024
@fadelcg
Copy link
Author

fadelcg commented Jul 20, 2024

Solved: I changed the Docker Image version of the IoT Agent Json to 1.3.0 and it works. The Context Broker can now read the sensor i registered.

@fadelcg fadelcg closed this as completed Jul 20, 2024
@fgalan
Copy link
Member

fgalan commented Jul 22, 2024

Great to know you solved the issue!

However, note that IOTA JSON 1.3.0 is pretty old (released almost 8 years ago!). Newest version at the moment of writing this is IOTA-JSON 3.5.0.

@fadelcg
Copy link
Author

fadelcg commented Jul 26, 2024

Ok. Do you know how to solve this issue ([DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead. (Triggered by calling emit on process.) ? Thank you

@fadelcg fadelcg reopened this Jul 29, 2024
@fgalan
Copy link
Member

fgalan commented Jul 29, 2024

Ok. Do you know how to solve this issue ([DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead. (Triggered by calling emit on process.) ? Thank you

Could you confirm that the version you are using is the lastest one (IOTA-JSON 3.5.0)? Are you getting that message with that version?

@fadelcg
Copy link
Author

fadelcg commented Jul 29, 2024

Yes I am using IOTA-JSON 3.5.0. The problem alsways raises everytime I create a service group:

image

@fgalan
Copy link
Member

fgalan commented Jul 29, 2024

Probably that needs some modifications in the IOTA JSON or IOTA Lib code. However, it's a minor issue, as it is just a deprecation warning.

@AlvaroVega what do you think?

@fadelcg
Copy link
Author

fadelcg commented Jul 29, 2024

I included now the apikey at device provision, but the context broker cannot still read the device. The response for entities-query is still empty.

@AlvaroVega
Copy link
Member

I included now the apikey at device provision, but the context broker cannot still read the device. The response for entities-query is still empty.

DId you send a mesaure to that device? Entity is not going to be created in CB until measure arrives to device.

@fadelcg
Copy link
Author

fadelcg commented Jul 29, 2024

Sorry I did not do that step. I thought it can be directly accessed by CB after the provision. Now it works. Thank you very much!

@fadelcg fadelcg closed this as completed Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants