Open noamblitz opened 6 months ago
@stephanie0x00 Could you see if we can get some logs / traces for this issue?
Testing on: commit 2195d81006dc912a989151ef7e407466d03e3f97 (HEAD -> main, origin/main, origin/HEAD)
Short version: it seems that rocky doesn't properly parse objects with a space (my guess is other characters as well) and instead handles names with a space. The debug trail is shown below.
I made 2 Service objects 'Hello World' and 'Foo bar' with L2 clearance. When going to the Reports page, I select 'Foo bar' and continue to the next page I observe the following:
The URL for this request. Observe that the Service object at the end is cut off after 'Foo'.
http://127.0.0.1:8000/en/aa/reports/generate-report/select/report-types/?observed_at=2024-06-20&clearance_level=2&clearance_level=3&clearance_level=4&clearance_type=declared&ooi=Service%7CFoo
Matching screenshot, observe that no objects are shown for the selection:
When selecting the 'Hello World' object, I observe the same behaviour.
Now I create another Service object called 'Hello' with L3 clearance.
I then select 'Hello World' (L2) clearance and this gets mapped to 'Hello' with L3 clearance, as shown below:
Selection of Hello World (L2):
The next page in the report flow now shows "Hello" with L3 clearance.
The rocky logs show notifications with "No data could be found for Service X".
...
rocky-1 | No data could be found for 'Service|Foo'
rocky-1 | [20/Jun/2024 14:22:22] "GET /en/aa/reports/generate-report/select/oois/?observed_at=2024-06-20&clearance_level=2&clearance_level=3&clearance_level=4&clearance_type=declared&ooi=Service%7CFoo HTTP/1.1" 200 46842
rocky-1 | [20/Jun/2024 14:22:22] "GET /static/dist/app.css HTTP/1.1" 304 0
rocky-1 | [20/Jun/2024 14:22:22] "GET /static/img/kat_logo.png HTTP/1.1" 304 0
rocky-1 | [20/Jun/2024 14:22:22] "GET /static/js/dropdown.js HTTP/1.1" 304 0
rocky-1 | [20/Jun/2024 14:22:22] "GET /static/dist/imports/manon.js HTTP/1.1" 304 0
rocky-1 | [20/Jun/2024 14:22:22] "GET /static/dist/tabler-icons.c16e726d.woff2 HTTP/1.1" 304 0
rocky-1 | [20/Jun/2024 14:22:22] "GET /static/js/checkboxToggler.js HTTP/1.1" 304 0
...
rocky-1 | No data could be found for 'Service|Hello'
rocky-1 | [20/Jun/2024 14:22:24] "GET /en/aa/reports/generate-report/select/report-types/?observed_at=2024-06-20&clearance_level=2&clearance_level=3&clearance_level=4&clearance_type=declared&ooi=Service%7CHello HTTP/1.1" 200 14045
Inspecting the object itself, it shows that in some parts of the database 'Hello World' is stored correctly, as shown below.
Describe the bug No reports are found for OOIs that have a space in their primary key.
To Reproduce Steps to reproduce the behavior:
Expected behavior KAT should handle these OOIs correctly.
Screenshots If applicable, add screenshots to help explain your problem.
OpenKAT version Note the release tag (and if possible: the installation method) here. If it concerns an in-development version, note the branch(es) and commit hash(es) here as well.
Desktop (please complete the following information if relevant):
Additional context Found by @MetaByte149