Skip to content

Unable to translate documents on new Web Client #143

@mwesnitzerSiloking

Description

@mwesnitzerSiloking

Hello,

I saw there is a webclient available now, which I wanted to try out. I tried both the Quick Deployment and the manual deployment written in the Readme file, but I always end up with the same errors, when I try to translate a document or batch translation.

This is from the logstream of the containerapp when I try to translate a document:

2025-08-14T05:57:57.859836283Z info: DocumentTranslation.Web.Services.DocumentTranslationWebService[0]
2025-08-14T05:57:57.859870227Z       Document Translation Web Service initialized successfully
2025-08-14T05:57:57.960777463Z info: DocumentTranslation.Web.Services.DocumentTranslationWebService[0]
2025-08-14T05:57:57.960805467Z       Blob container 'translated' ensured to exist
2025-08-14T05:58:01.147092265Z info: DocumentTranslation.Web.Services.DocumentTranslationWebService[0]
2025-08-14T05:58:01.147128927Z       Document Translation Web Service initialized successfully
2025-08-14T05:58:01.148320063Z fail: Microsoft.AspNetCore.Server.Kestrel[13]
2025-08-14T05:58:01.148346039Z       Connection id "0HNEQDI6RLVV0", Request id "0HNEQDI6RLVV0:00000005": An unhandled exception was thrown by the application.
2025-08-14T05:58:01.148352501Z       System.NotSupportedException: Serialization and deserialization of 'DocumentTranslationService.LocalFormats.ConvertToMarkdown' instances is not supported. Path: $.ConvertToMarkdown.
2025-08-14T05:58:01.148357000Z        ---> System.NotSupportedException: Serialization and deserialization of 'DocumentTranslationService.LocalFormats.ConvertToMarkdown' instances is not supported.
2025-08-14T05:58:01.148362312Z          at System.Text.Json.Serialization.Converters.UnsupportedTypeConverter`1.Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options)
2025-08-14T05:58:01.148365976Z          at System.Text.Json.Serialization.JsonConverter`1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state)
2025-08-14T05:58:01.148369575Z          at System.Text.Json.Serialization.Metadata.JsonPropertyInfo`1.GetMemberAndWriteJson(Object obj, WriteStack& state, Utf8JsonWriter writer)
2025-08-14T05:58:01.148373300Z          at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.OnTryWrite(Utf8JsonWriter writer, T value, JsonSerializerOptions options, WriteStack& state)
2025-08-14T05:58:01.148376855Z          at System.Text.Json.Serialization.JsonConverter`1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state)
2025-08-14T05:58:01.148380089Z          at System.Text.Json.Serialization.Converters.ListOfTConverter`2.OnWriteResume(Utf8JsonWriter writer, TCollection value, JsonSerializerOptions options, WriteStack& state)
2025-08-14T05:58:01.148383468Z          at System.Text.Json.Serialization.JsonCollectionConverter`2.OnTryWrite(Utf8JsonWriter writer, TCollection value, JsonSerializerOptions options, WriteStack& state)
2025-08-14T05:58:01.148386499Z          at System.Text.Json.Serialization.JsonConverter`1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state)
2025-08-14T05:58:01.148389511Z          at System.Text.Json.Serialization.JsonConverter`1.WriteCore(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state)
2025-08-14T05:58:01.148392697Z          --- End of inner exception stack trace ---
2025-08-14T05:58:01.148395694Z          at System.Text.Json.ThrowHelper.ThrowNotSupportedException(WriteStack& state, Exception innerException)
2025-08-14T05:58:01.148398745Z          at System.Text.Json.Serialization.JsonConverter`1.WriteCore(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state)
2025-08-14T05:58:01.148402176Z          at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.SerializeAsync(PipeWriter pipeWriter, T rootValue, Int32 flushThreshold, CancellationToken cancellationToken, Object rootValueBoxed)
2025-08-14T05:58:01.148405261Z          at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.SerializeAsync(PipeWriter pipeWriter, T rootValue, Int32 flushThreshold, CancellationToken cancellationToken, Object rootValueBoxed)
2025-08-14T05:58:01.148408357Z          at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.SerializeAsync(PipeWriter pipeWriter, T rootValue, Int32 flushThreshold, CancellationToken cancellationToken, Object rootValueBoxed)
2025-08-14T05:58:01.148411464Z          at Microsoft.AspNetCore.Mvc.Formatters.SystemTextJsonOutputFormatter.WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)
2025-08-14T05:58:01.148414933Z          at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|30_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
2025-08-14T05:58:01.148428055Z          at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
2025-08-14T05:58:01.148431640Z          at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
2025-08-14T05:58:01.148434894Z          at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()
2025-08-14T05:58:01.148437940Z       --- End of stack trace from previous location ---
2025-08-14T05:58:01.148441062Z          at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
2025-08-14T05:58:01.148444095Z          at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
2025-08-14T05:58:01.148455492Z          at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
2025-08-14T05:58:01.148462458Z          at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
2025-08-14T05:58:01.148466789Z          at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
2025-08-14T05:58:01.148484293Z          at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
2025-08-14T05:58:01.150959459Z info: DocumentTranslation.Web.Services.DocumentTranslationWebService[0]
2025-08-14T05:58:01.151014325Z       Blob container 'translated' ensured to exist
2025-08-14T05:58:09.894506775Z info: DocumentTranslation.Web.Services.DocumentTranslationWebService[0]
2025-08-14T05:58:09.894535015Z       Document Translation Web Service initialized successfully
2025-08-14T05:58:09.897956295Z info: DocumentTranslation.Web.Services.DocumentTranslationWebService[0]
2025-08-14T05:58:09.898004245Z       Blob container 'translated' ensured to exist
2025-08-14T05:58:13.005609639Z fail: DocumentTranslation.Web.Services.DocumentTranslationWebService[0]
2025-08-14T05:58:13.006324509Z       Failed to translate document from fr to de
2025-08-14T05:58:13.006343165Z       System.ArgumentNullException: List of translatable extensions cannot be null. (Parameter 'Extensions')
2025-08-14T05:58:13.006349098Z          at DocumentTranslationService.Core.DocumentTranslationBusiness.RunAsync(List`1 filestotranslate, String fromlanguage, String[] tolanguages, List`1 glossaryfiles, String targetFolder) in C:\Projects\DocumentTranslation\DocumentTranslationService\DocumentTranslationBusiness.cs:line 139
2025-08-14T05:58:13.006353601Z          at DocumentTranslation.Web.Services.DocumentTranslationWebService.TranslateDocumentAsync(IFormFile file, String fromLanguage, String toLanguage, String category) in C:\Projects\DocumentTranslation\DocumentTranslation.Web\Services\DocumentTranslationWebService.cs:line 154
2025-08-14T05:58:13.006765145Z fail: DocumentTranslation.Web.Controllers.TranslationController[0]
2025-08-14T05:58:13.006778176Z       Error translating document
2025-08-14T05:58:13.006783683Z       System.ArgumentNullException: List of translatable extensions cannot be null. (Parameter 'Extensions')
2025-08-14T05:58:13.006788094Z          at DocumentTranslationService.Core.DocumentTranslationBusiness.RunAsync(List`1 filestotranslate, String fromlanguage, String[] tolanguages, List`1 glossaryfiles, String targetFolder) in C:\Projects\DocumentTranslation\DocumentTranslationService\DocumentTranslationBusiness.cs:line 139
2025-08-14T05:58:13.006829430Z          at DocumentTranslation.Web.Services.DocumentTranslationWebService.TranslateDocumentAsync(IFormFile file, String fromLanguage, String toLanguage, String category) in C:\Projects\DocumentTranslation\DocumentTranslation.Web\Services\DocumentTranslationWebService.cs:line 154
2025-08-14T05:58:13.006834246Z          at DocumentTranslation.Web.Controllers.TranslationController.TranslateDocument(DocumentTranslationRequest request) in C:\Projects\DocumentTranslation\DocumentTranslation.Web\Controllers\TranslationController.cs:line 96

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions