[SOLVED] Backup restore fails with S3 asset store

I have…

  • [ x ] Checked the logs and have uploaded a log file and provided a link because I found something suspicious there. Please do not post the log file in the topic because very often something important is missing.

Stacktrace: https://i.imgur.com/N3Vz6OD.png

I’m submitting a…

  • [ ] Regression (a behavior that stopped working in a new release)
  • [ x ] Bug report
  • [ ] Performance issue
  • [ ] Documentation issue or request

Current behavior

If S3 is used as asset store, then restore fails when inner.Length is accessed:

// https://github.com/Squidex/squidex/blob/master/backend/src/Squidex.Infrastructure.Amazon/Assets/SeekFakerStream.cs:32
public override long Length
    get { return inner.Length; }

It seems like DeflateStream doesn’t support property Length.

This property is not supported and always throws a NotSupportedException.

Expected behavior

Minimal reproduction of the problem

  • Set S3 as asset store.
  • Upload an asset.
  • Create a backup.
  • Restore backup.


  • [ x ] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [ ] Cloud version

Version: 4.1.0


  • [ x ] Chrome (desktop)
  • [ ] Chrome (Android)
  • [ ] Chrome (iOS)
  • [ ] Firefox
  • [ ] Safari (desktop)
  • [ ] Safari (iOS)
  • [ ] IE
  • [ ] Edge


Hi, I think it is the same like this: [IMPLEMENTED] Upload Amazon S3 Bucket failed

The problem was not a duplicate. But it is solved now.

As a reference: the problem is that the S3 upload needs a content length, which is not available when reading from a zip archive: https://github.com/aws/aws-sdk-net/issues/1095

So for now, I copy the stream to a temporary file first before uploading it.

1 Like

Hey, that’s awesome! Thank you. I’ll give it a shot and let you know if it’s working OK