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

Incorrect parent can result in 500 #319

Closed
donaldgray opened this issue Mar 14, 2025 · 0 comments · Fixed by #339
Closed

Incorrect parent can result in 500 #319

donaldgray opened this issue Mar 14, 2025 · 0 comments · Fixed by #339
Assignees
Labels
bug Something isn't working

Comments

@donaldgray
Copy link
Member

#272 updated requirements for parent to be a fully qualified URL. I accidentally encountered a bug where I submitted a parent using localhost URL, rather than expected development environment URL.

e.g. https://localhost:7230/7/collections/root rather than https://presentation-api.dlcs.digirati.io//7/collections/root

This resulted in a 500 exception, rather than a 400. From logs:

[16:11:25 DBG API.Features.Manifest.ManifestWriteService b8023e41-1ac1-44d6-b51c-f89cf55191b7] Manifest staging_test for Customer 7 doesn't exist, creating
[16:11:25 ERR API.Features.Manifest.ManifestWriteService b8023e41-1ac1-44d6-b51c-f89cf55191b7] Error upserting manifest staging_test for customer 7
System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string. (Parameter 'startIndex')
at System.String.ThrowSubstringArgumentOutOfRange(Int32 startIndex, Int32 length)
at System.String.Substring(Int32 startIndex)
at Repository.Paths.PathParser.GetHierarchicalFullPathFromPath(String presentationParent, Int32 customerId, String baseUrl) in /src/Repository/Paths/PathParser.cs:line 62
at API.Helpers.ParentSlugParser.RetrieveParentFromPresentation(IPresentation presentation, Int32 customerId, CancellationToken cancellationToken) in /src/API/Helpers/ParentSlugParser.cs:line 163
at API.Helpers.ParentSlugParser.TryGetParentFromPresentation[T](IPresentation presentation, Int32 customerId, CancellationToken cancellationToken) in /src/API/Helpers/ParentSlugParser.cs:line 127
at API.Helpers.ParentSlugParser.TryGetParent[T](IPresentation presentation, Int32 customerId, CancellationToken cancellationToken)
at API.Helpers.ParentSlugParser.Parse[T](T presentation, Int32 customerId, String id, CancellationToken cancellationToken)
at API.Features.Manifest.ManifestWriteService.CreateInternal(WriteManifestRequest request, String manifestId, CancellationToken cancellationToken) in /src/API/Features/Manifest/ManifestWriteService.cs:line 152
at API.Features.Manifest.ManifestWriteService.Upsert(UpsertManifestRequest request, CancellationToken cancellationToken) in /src/API/Features/Manifest/ManifestWriteService.cs:line 110

@donaldgray donaldgray added the bug Something isn't working label Mar 14, 2025
p-kaczynski added a commit that referenced this issue Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants