Skip to content

API: events/channels/subscription issue with URL-encoded slash in ID #8012

@onnozweers

Description

@onnozweers

Dear dCache devs,

When I listen to a particular directory's events, I get a 404 when I try to get the subscriptions of the channel. Example:

[onno@mylaptop ~/git/Ada] % curl --config /Users/zweer001/.ada/headers/authorization_header_4DTngzWmmeVq -H 'accept: application/json' --fail --silent --show-error --ipv4 -X GET https://dcachetest.grid.surfsara.nl:20443/api/v1/events/channels/gWkCsOXFjWK5wmbr4GIHHQ/subscriptions
["https://dcachetest.grid.surfsara.nl:20443/api/v1/events/channels/gWkCsOXFjWK5wmbr4GIHHQ/subscriptions/inotify/AAB5PU%2FDAw5H1pOdcMt5EUnV"]

This call returns a subscription in the channel in the form of an URL. Then I request this URL:

[onno@mylaptop ~/git/Ada] % curl --config /Users/zweer001/.ada/headers/authorization_header_4DTngzWmmeVq -H 'accept: application/json' --fail --silent --show-error --ipv4 -X GET 'https://dcachetest.grid.surfsara.nl:20443/api/v1/events/channels/gWkCsOXFjWK5wmbr4GIHHQ/subscriptions/inotify/AAB5PU%2FDAw5H1pOdcMt5EUnV'
curl: (22) The requested URL returned error: 404

When listening to events in another directory, there's no problem and I get the subscription info, not a 404.

I've noticed that the 404 error always happens when I listen to evens in /users/onno/tape//integration_test. It looks like this path is always translated into the same subscription ID: AAB5PU%2FDAw5H1pOdcMt5EUnV. This ID seems to contain a URLencoded slash: %2F. I can imagine that this might cause problems. I've tried the decoded URL (AAB5PU/DAw5H1pOdcMt5EUnV) but this also returns a 404.

I removed the dir /users/onno/tape//integration_test and created it again, and now when I subscribe to it, it has another subscription ID, without %2F, and now the problem is gone. I guess the subscription ID is somehow based on the PNFSID or iNumber of the path.

I guess that the URL encoded slash breaks this call. I'm worried, that it could return with any directory.

I've tested it on this week's master snapshot of dCache.

Kind regards,
Onno

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions