gaseous-project / gaseous-server

A game ROM manager, with a built in web based emulator using multiple sources to identify and provide metadata
GNU Affero General Public License v3.0
336 stars 12 forks source link

JSON deserialization error trying to import ROMs #368

Closed an0t8 closed 3 months ago

an0t8 commented 4 months ago

Describe the bug Just getting started with Gaseous. I have installed using docker (v1.7.3) & mariadb (latest) the website is up and running. I have installed the local signatures. My host is ubuntu 22.04.4 LTS

Trying to upload a ROM, or when trying to scan the import folder I get the following error:

"System.AggregateException: One or more errors occurred. (Cannot deserialize the current JSON object (e.g. {\"name\":\"value\"}) into type 'System.Collections.Generic.List`1[System.Collections.Generic.KeyValuePair`2[System.String,System.Object]]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.
    To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List<T>) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.
    Path 'signature.rom.attributes.h', line 35, position 12.)
     ---> Newtonsoft.Json.JsonSerializationException: Cannot deserialize the current JSON object (e.g. {\"name\":\"value\"}) into type 'System.Collections.Generic.List`1[System.Collections.Generic.KeyValuePair`2[System.String,System.Object]]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.
    To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List<T>) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.
    Path 'signature.rom.attributes.h', line 35, position 12.
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
       at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
       at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
       at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
       at HasheousClient.WebApp.HttpHelper.Post[T](String url, Object contentValue)
       at HasheousClient.Hasheous._RetrieveFromHasheousAsync(HashLookupModel hashLookup)
       --- End of inner exception stack trace ---
       at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
       at System.Threading.Tasks.Task`1.get_Result()
       at HasheousClient.Hasheous.RetrieveFromHasheousAsync(HashLookupModel hash)
       at gaseous_server.Classes.FileSignature._GetFileSignatureFromHasheous(hashObject hash, String ImageName, String ImageExtension, Int64 ImageSize, String GameFileImportPath) in /App/gaseous-server/Classes/FileSignature.cs:line 267
       at gaseous_server.Classes.FileSignature._GetFileSignature(hashObject hash, String ImageName, String ImageExtension, Int64 ImageSize, String GameFileImportPath, Boolean IsInZip) in /App/gaseous-server/Classes/FileSignature.cs:line 192
       at gaseous_server.Classes.FileSignature.GetFileSignature(LibraryItem library, hashObject hash, FileInfo fi, String GameFileImportPath) in /App/gaseous-server/Classes/FileSignature.cs:line 19
       at gaseous_server.Classes.ImportGame.ImportGameFile(String GameFileImportPath, Platform OverridePlatform) in /App/gaseous-server/Classes/ImportGames.cs:line 102
       at gaseous_server.Classes.ImportGame.ProcessDirectory(String ImportPath) in /App/gaseous-server/Classes/ImportGames.cs:line 34
       at gaseous_server.ProcessQueue.QueueItem.Execute() in /App/gaseous-server/ProcessQueue.cs:line 267"

To Reproduce Steps to reproduce the behavior:

  1. set up Gaseous 1.7.3 & mariadb (latest).
  2. Install the latest signatures (TOSEC v2024-05-17 & MAME 265)
  3. Set up admin account
  4. Try to upload Super Mario Bros.nes (working ROM, playable with emulatorJS) MD5: 3c89d9e821a2b2000aae1b8ddc864ac3
  5. Upload fails with Server 500 error and above log.

Expected behavior Rom uploads correctly and is available

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

an0t8 commented 3 months ago

Are there no thoughts on this? I am assuming that I am doing something wrong, but I am using the same roms with no issue in Romm.

michael-j-green commented 3 months ago

Hi @an0t8; apologies - I've been bug hunting for a 1.7.4 release; this was on my radar but I just hadn't gotten to it yet.

I'll do some testing today and see if I can reproduce the error - note that from what you've described it does not look like you're doing anything wrong.

michael-j-green commented 3 months ago

I was able to replicate the error. It should be resolved in 1.7.4.

an0t8 commented 3 months ago

Awesome, thanks! I look forward to trying gaseous out.