[SOLVED] Uploading assets fails with an unrecognised error

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.

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

When uploading assets using the sq sync in command we encounter the following errors on some of our assets:

Uploading f71da12b-689a-4a50-a5b1-604...failed: Validation error: Bu dosya formatının yüklenmesine izin verilmemektedir.

The error message appears to be in Turkish.
Please notice that we have not changed the assets or the process. The error seems to appear randomly across our uploaded assets.

Expected behavior

It should upload the asset as normal and return something like

Uploading e3370f47-cb0c-4921-b0d0-8ac...succeeded.

Minimal reproduction of the problem

sq sync in (…)

Environment

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

Version: [VERSION]

Browser:

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

Others:

I cannot find this text anywhere in the code. What is your app name again?

Do you know whether it is related to specific mime-types?

The app in question is 1480-gitlab

Could it be related to this

:wink:

would you be able to tell us where this is from?

actually i was just able to find it - we are unsure where this came from as we sync our apps from code and we have no such code. Is it possible it leaked from another user’s app?

so it looks like this was added to all of our apps in two different accounts and it’s not in any of our previous back ups.

@Sebastian is it possible that this (asset scripting) was introduced recently and somehow by accident all of the apps received one user’s setting? or was it a migration go wrong :wink: ?

Weird, I will have a look.

Fuck, you are totally right.

The asset definition was like this

public sealed record AssetScripts
{
   public string? Create { get; init; }
}

So from the compiler perspective this object is immutable. So I thought “When this is immutable we do not need multiple instances of this object and can keep one in memory”.

So I added this field:

public sealed record AssetScripts
{
    public static readonly AssetScripts Empty = new AssetScripts();

    public string? Create { get; init; }
}

And used it in the app object:

class App
{
   public AssetScripts AssetScripts { get; set; } = AssetScripts.Empty;
}

But when reading the value from the database, it does not create a new instance, it reuses the instance. And for the deserializer the object is mutable. So therefore the asset scripts have been leaked from one app to another.

I have fixed that and tried to make the necessary update to the apps. Due to the actor system it might not have an effect immediately.

Hello Sebastian,

I’m glad I could help find the bug. Thank you for responding and fixing so quickly!

cheers

1 Like

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