You are viewing limited content. For full access, please sign in.

Question

Question

"GUID should contain 32 digits with 4 dashes" when trying to upload a document with self-hosted API

asked on December 6, 2023

I am attempting to upload a pdf document to our Laserfiche repository via the self-hosted API.
specifically: POST.../Entries/{Parent ID}/{document name} returns a 203 (full error below)

I can see that it Does create a file in the appropriate repository and directory, with the appropriate name and metadata from my request body, however, when I try to view it, it says "this document contains no pages" under Image, and "this document does not contain an electronic file" under Electronic File.
i know from sending my request to 'http://httpbin.org/post' that I am, in fact, sending:
files: {"electronicDocument":"<long data>"}​

here is the associated full-stack-trace from the log:

Message: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
Type: System.FormatException
StackTrace:    at System.Guid.GuidResult.SetFailure(Boolean overflow, String failureMessageID)
   at System.Guid.TryParseExactN(ReadOnlySpan`1 guidString, GuidResult& result)
   at System.Guid.TryParseGuid(ReadOnlySpan`1 guidString, GuidResult& result)
   at System.Guid..ctor(String g)
   at Laserfiche.RepositoryAccess.ProtocolUtil.DecodeMultiStatusCreateDocFromUploadFileResponse(HttpResponse response, CreateDocumentContent& createdContent)
   at Laserfiche.RepositoryAccess.Upload.UploadFile.CreateDocument(CreateDocumentContent contentData, ISession session, CreateDocumentContent& createdContent)
   at Laserfiche.Repository.LFSConnector.Connectors.EntryConnector.CreateEntryWithEdocAndMetadata_V1(String repositoryId, Int32 parentEntryId, String fileName, IFormFile file, PostEntryWithEdocMetadataRequest request, Boolean autoRename) 

Other API calls work fine. This error appears whether I am using swagger or my own program.

api response 203 to document upload.png
0 0

Replies

replied on December 6, 2023

Hi,

 

It's hard to tell what causing the error just from the response. Could you also share what's the request body and headers look like?

 

Could you also try upload a file with our sample project with self host configuration to see if it also get the error? https://github.com/Laserfiche/lf-sample-repository-api-dotnet-srv/tree/v1#self-hosted-prerequisites

There is a ImportDocument method that would upload a document to the sample project folder. https://github.com/Laserfiche/lf-sample-repository-api-dotnet-srv/blob/v1/Program.cs#L54

 

1 0
replied on December 11, 2023

thank you for your response!
yes, i ended up just using the sample project, whose document upload methods work.
the server still throws the above GUID error, but it turns out that it doesn't stop the document from being uploaded. i must have been doing something else wrong, and that error sent me on a goose chase.

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.