Upload fail: Unexpected end of Stream, the content may have already been read by another component

I am running an Umbraco 13.6 website with a Local/Staging/Prod setup. We use Git push-to-deploy to push code and uSync configuration files to Staging, and uSync to push content between environments. Staging and Prod are on Azure App Service. I am getting the following error when I try to push content from any environment to any other:

Error while processing Push - (export/Push/0/)
Unexpected end of Stream, the content may have already been read by another component.

Pulling seems to work fine, just not pushing. The servers are set up as “Connected servers” on each other. When I go into uSync Publisher and do Check Access, the environments I’m trying to push to show up as Available. If I export and import a configuration package, uSync works as expected. This happens every time, even with only one content node selected.

uSync publishing worked on this site at one point, but both Umbraco and uSync have been updated minor versions since I last remember it working.

What would cause this?

Full trace :

Step: Push (4)
PageNumber: 0
ClassName: <UploadFile>d__14
Method: MoveNext
Trace:
Upload fail: 244bf1f5-99cd-4726-98db-3e354c7fbcf2 - {"code":500,"message":"Unexpected end of Stream, the content may have already been read by another component. ","exceptionMessage":"System.IO.IOException: Unexpected end of Stream, the content may have already been read by another component. \r\n   at Microsoft.AspNetCore.WebUtilities.MultipartReaderStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken)\r\n   at Microsoft.AspNetCore.WebUtilities.StreamHelperExtensions.DrainAsync(Stream stream, ArrayPool`1 bytePool, Nullable`1 limit, CancellationToken cancellationToken)\r\n   at Microsoft.AspNetCore.WebUtilities.MultipartReader.ReadNextSectionAsync(CancellationToken cancellationToken)\r\n   at uSync.Publisher.Controllers.uSyncReceiveApiController.GetFileFromRequest(String folder)\r\n   at uSync.Publisher.Controllers.uSyncReceiveApiController.GetFileFromRequest(Boolean allowBlankGuid)\r\n   at uSync.Publisher.Controllers.uSyncReceiveApiController.PushPack()\r\n   at lambda_method3562(Closure, Object)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()\r\n--- End of stack trace from previous location ---\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)"}
    at uSync.Publisher.Publishers.SyncPublisherBase.UploadFile(String url, Stream stream, uSyncCallbacks callbacks)

   at uSync.Publisher.Publishers.SyncRealtimePublisher.PushToServer(PublisherActionRequest request)

   at uSync.Publisher.Services.SyncPublisherActionService.PerformAction(PublisherActionRequest request, ISyncPublisher publisher, IUser user)

@KevinJump

Hi,

I would just check you are running the latest version of usync.complete for v13 (v13.1.9)

Something changed in a later release of Umbraco v13. (never quite figured out which version it was) around how content streams where buffered, but we did update uSync to work withing this, so if you go to the latest version you should see this go away.

You’re right, I was on 13.1.3. Updating to 13.1.9 fixed it. Thanks!

Could you please mark the answer of Kevin as a solution :slight_smile:

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.