#3818 new defect

Writing at offset=0 using REST API fails for empty files

Reported by: derkades Owned by:
Priority: normal Milestone: undecided
Component: unknown Version: n/a
Keywords: Cc:
Launchpad Bug:

Description (last modified by derkades)

Trying to write a single byte at offset 0 to an empty SDMF file:

FILE_CAP=$(curl -X PUT 'http://10.0.1.1:26551/uri?format=sdmf')
curl -X PUT --data a "http://10.0.1.1:26551/uri/$FILE_CAP?offset=0" > error1.html

or MDMF:

FILE_CAP=$(curl -X PUT 'http://10.0.1.1:26551/uri?format=mdmf')
curl -X PUT --data a "http://10.0.1.1:26551/uri/$FILE_CAP?offset=0" > error2.html

Please find error files attached.

No offset works:

curl -X PUT --data a "http://10.0.1.1:26551/uri/$FILE_CAP"

Now that the file contains 1 byte ('a'), we can write at offset=1 to make it 2 bytes long ('aa'):

curl -X PUT --data a "http://10.0.1.1:26551/uri/$FILE_CAP?offset=1"

Also overwriting the first byte seems to work, but actually overwrites the entire file (unrelated issue?):

curl -X PUT --data b "http://10.0.1.1:26551/uri/$FILE_CAP?offset=0"

The file now contains 'b', while I would expect 'ba'.

Attachments (2)

error1.html (4.4 KB) - added by derkades at 2021-10-20T15:31:28Z.
SDMF error
error2.html (5.1 KB) - added by derkades at 2021-10-20T15:31:37Z.
MDMF error

Download all attachments as: .zip

Change History (3)

Changed at 2021-10-20T15:31:28Z by derkades

SDMF error

Changed at 2021-10-20T15:31:37Z by derkades

MDMF error

comment:1 Changed at 2021-10-20T15:32:58Z by derkades

  • Description modified (diff)
Note: See TracTickets for help on using tickets.