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

Using API to get a data element that doesn't exist responds with 500 instead of 404 #889

Open
MagnusNordboe opened this issue Nov 6, 2024 · 0 comments
Labels
kind/bug Something isn't working status/triage

Comments

@MagnusNordboe
Copy link

MagnusNordboe commented Nov 6, 2024

Description of the bug

If I have a valid user logged in, that has created an instance with a valid instanceId, and I ask for an not existing but valid data id on the data/{dataGuid} GET endpoint, the server responds with 500 internal server error.

Expected behavior: The server should respond with a 404 not found, as I'm asking for an element that doesn't exist. Potentially a 403 bad request. This works properly if the request is not a properly formatted guid, but with proper guid formatting the server assumes it made a mistake.

Steps To Reproduce

  1. Authenticate as a test user with access to vpfo : user_id: 160616; party_id: 51882621
  2. Create instance: POST https://brg.apps.tt02.altinn.no/brg/aarsregnskap-vpfo-202405/instances?instanceOwnerPartyId=51882621
  3. Get data element with a valid Guid that does not exist: GET https://brg.apps.tt02.altinn.no/brg/aarsregnskap-vpfo-202405/instances/51882621/{{schema_instance_id}}/data/82a351d9-807f-4949-9d6b-3cc7eea38a17
  4. The server will respond with 500

Additional Information

The bug is not exclusive to VPFO, and should be reproduceable with any app / data element

@MagnusNordboe MagnusNordboe added the kind/bug Something isn't working label Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working status/triage
Projects
Status: No status
Development

No branches or pull requests

1 participant