[SOLVED] AmazonS3 error connecting after upgrade to a new version

I have…

I’m submitting a…

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

Current behavior

Hi. I updated the cms version to the latest version 7.8.1 and set with my credentials for amazonS3 for assets. This worked in the previous version 6.4.0 and earlier but not in the new one.
I have error and flag disablePayloadSigning didnt help.
I cant understand what was changed. AmazonS3 settings have not changed.
Error:

System.AggregateException: ‘Some services are not able to be constructed (Error while validating the service descriptor ‘ServiceType: Squidex.Assets.AmazonS3AssetStore Lifetime: Singleton ImplementationType: Squidex.Assets.AmazonS3AssetStore’: Unable to resolve service for type ‘Squidex.Assets.AmazonS3AssetOptions’ while attempting to activate ‘Squidex.Assets.AmazonS3AssetStore’.)’

Expected behavior

Working amazonS3

Minimal reproduction of the problem

Set in appsettings and launch:
assetStore:type - AmazonS3
assetStore:amazonS3:bucket
assetStore:amazonS3:bucketFolder
assetStore:amazonS3:regionName
assetStore:amazonS3:accessKey
assetStore:amazonS3:secretKey
assetStore:amazonS3:disablePayloadSigning - false (true is nothing change in this case)

Environment

App Name:

  • [ x ] Self hosted with docker
  • [ x ] Local launch in VS
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [ ] Cloud version

Version: 7.8.1

Browser:

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

Others:

The releases checking shows that the problem started to appear from version 7.7.0.
The disablePayloadSigning flag may not be the cause of this behavior as it was introduced in an earlier version(7.5.0)

It looks like I found an error. Nuget package Squidex.Assets.S3 class AmazonS3AssetStore .
Constructor missing IOptions:
public AmazonS3AssetStore(AmazonS3AssetOptions options)

Found a temporary solution. Added object as Singleton.

[“AmazonS3”] = () =>
{
var amazonS3Options = config.GetSection(“assetStore:amazonS3”).Get() ?? new ();
services.AddSingleton(amazonS3Options);
services.AddAmazonS3AssetStore(config);
},

It looks like it works :sweat_smile: But you’d better take a look)

Thanks. I will have a look and fix it until next week wednesday.

I have pushed a fix.

1 Like

This topic was automatically closed after 2 days. New replies are no longer allowed.