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

Suscription not found by id when witching to new verions of orion-ld #1316

Closed
pdmangel2 opened this issue Feb 2, 2023 · 9 comments
Closed

Comments

@pdmangel2
Copy link

I created a subscription in version fiware/orion-ld:1.1.1:

###
POST http://localhost:1026/ngsi-ld/v1/subscriptions
Fiware-Service: t_02
Content-Type: application/json

{
    "id": "urn:subscr:123457",
    "type": "Subscription",
    "description": "manual test",
    "entities": [
        {
            "idPattern": ".*",
            "type": "ParkingSpot"
        }
    ],
    "q": "status==%22occupied%22",
    "watchedAttributes": ["status"],
    "notification": {
        "endpoint": {
            "uri": "http://nginx:8080/api/tools/mock/httpNoAuth",
            "accept": "application/ld+json"
        },
        "format": "keyValues",
        "attributes": [
            "status"
        ]
    }
}

After switching to fiware/orion-ld:1.2.0-PRE-1247 following GET resulted in https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound


###
GET http://orion:1026/ngsi-ld/v1/subscriptions/urn:subscr:123457
Fiware-Service: t_02
@kzangeli
Copy link
Collaborator

kzangeli commented Feb 2, 2023

ok, interesting.
Might be that I've (by mistake) removed the support for the NGSIv2 HTTP headers (Fiware-Service in not NGSI-LD, it's NGSIv2).
That "little detail" would explain the whole thing.

I'm a bit busy this week, traveling for a European project.

So, meanwhile, why don't you try with the correct HTTP header (NGSILD-Tenant) ?
That just might fix the problem.

@kzangeli
Copy link
Collaborator

kzangeli commented Feb 2, 2023

One more thing, multi-tenancy isn't ON by default. You have to start the broker with -multiservice (something I need to change).
Make sure you start the broker with that option (or env var "ORIONLD_MULTISERVICE")

@pdmangel2
Copy link
Author

mmm ... we are not using this option, however NGSILD-Tenant is working as expected

@kzangeli
Copy link
Collaborator

kzangeli commented Feb 2, 2023

Seems like it's on by default in containers. My bad.
All is good then, just ... the subscription is lost.
When you say "however NGSILD-Tenant is working as expected" ... except that a subscription has disappeared ...
A problem with the tenant would provoke exactly that

I'd be happy to help you troubleshooting this, I'm just out for the week and not available until Monday afternoon.
Unless you're willing to work on weekends, of course :)

@pdmangel2
Copy link
Author

I meant that with version 1.1.1 the behaviour of the NGSILD-Tenant was ok, even without using the -multiservice option.

But no hurry, Ken. Thanks for the quick responses!

@kzangeli
Copy link
Collaborator

kzangeli commented Feb 2, 2023

I was able to reproduce the error and I've fixed the problem.
Will take me a few hours though to merge the PR.
Hopefully before I go to sleep, so you can test again tomorrow morning!

kzangeli added a commit that referenced this issue Feb 2, 2023
@kzangeli kzangeli mentioned this issue Feb 2, 2023
@kzangeli
Copy link
Collaborator

kzangeli commented Feb 3, 2023

Gonna take a little longer than I thought.
The fix to this problem gave me 5 errors in other functests, so, I will have to look it over more carefully.
Hope to have it solved before Monday morning.

@kzangeli
Copy link
Collaborator

kzangeli commented Feb 4, 2023

Modified the fix and all tests are now working, see PR #1319 .

Please test and if all is good, proceed and close this issue

@pdmangel2
Copy link
Author

Tested the fix and seems to be working.

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

2 participants