EOFException when uploading document

Gareth Western garwes at arkivverket.no
Mon Aug 23 15:33:53 CEST 2021


Aha,  I think I’ve narrowed the problem down to something less “magical” than hostname issues. It’s related to how the import script opens files when it sends the POST to upload a doc:

with open(filepath) as content:

should be:

with open(filepath, ‘rb’) as content:

This is probably a python2 -> 3 legacy thing?




From: Gareth Western <garwes at arkivverket.no>
Date: Monday, 23 August 2021 at 09:41
To: "nikita-noark at nuug.no" <nikita-noark at nuug.no>
Subject: EOFException when uploading document

Hi,

I hit an exception while uploading documents using the import-uttrekk test script [1]. After some debugging on the server side, it looks like there’s an EOFException being thrown from the DocumentObjectService when trying to make a copy of the incoming file (the call to IOUtils.copyLarge(…)).

Thomas, how did you test uploading files earlier?

Petter, I wonder if the problem is something in the use of urllib in the import-uttrekk script. Is there a reason you favoured the urllib library over the “requests” library? I thought the latter was more robust / well-known, but perhaps there is something in the history in your development of the script? I’ll try replacing it and see if that helps.

Mvh,

Gareth




  1.  https://github.com/petterreinholdtsen/noark5-tester/blob/master/import-uttrekk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.nuug.no/pipermail/nikita-noark/attachments/20210823/f47fdbcc/attachment.htm 


More information about the nikita-noark mailing list