Jumoo / uSync.Complete.Issues

Public Issue tracker and roadmap for uSync.Complete
https://jumoo.co.uk/usync/complete/
2 stars 1 forks source link

Media being copied by Publisher with 0 bytes #193

Closed ianleeder closed 1 year ago

ianleeder commented 1 year ago

Describe the bug At some point in the past we were able to pull media (using Publisher) from our Azure AppService to create a local dev environment. Recently something has changed, and when we pull media all files have size 0. Umbraco entries get created correctly, I can view details in the backoffice (size now shows 0), but the image is empty.
No doubt this is something that we have introduced, but I have tried to roll back code and have been unable to restore correct behaviour. I'm hoping that something in the code can help indicate the cause of the issue.

Version (please complete the following information):

To Reproduce Steps to reproduce the behavior:

  1. Set up a new local environment with SiteSeed URL and keys configured.
  2. Create local database and admin account.
  3. Seed database with all options checked (content, media, copy files)

Expected behavior Pull complete media files instead of empty ones.

Screenshots I have enabled debug logging on my source server (that I am pulling from), and found these lines (just an example, this is occurring for ALL media):

2022-12-29T22:32:14.293085179Z [22:32:14 DBG] CopyMediaFile: 1172 /home/site/wwwroot/umbraco/Data/TEMP/uSync/pack/t0nlovf1
2022-12-29T22:32:14.303283530Z [22:32:14 DBG] file path from property: /media/z5foiver/icon_education_01_rgb.svg
2022-12-29T22:32:14.303308130Z [22:32:14 DBG] file path from property: /media/z5foiver/icon_education_01_rgb.svg
2022-12-29T22:32:14.306239274Z [22:32:14 DBG] Saving File: /home/site/wwwroot/umbraco/Data/TEMP/uSync/pack/t0nlovf1/media/z5foiver/5c21438c448a4c9c9a3eb6a6287f4d48.svg
2022-12-29T22:32:14.366669667Z [22:32:14 DBG] Saving File: /home/site/wwwroot/umbraco/Data/TEMP/uSync/pack/t0nlovf1/media/z5foiver/_names.json [84]

If I look at the source file, I can see it has content:

root@4e376822d6e9:~/site/wwwroot/wwwroot/media/z5foiver# ls -lah
total 81K
drwxrwxrwx 2 nobody nogroup   0 Nov 28 03:00 .
drwxrwxrwx 2 nobody nogroup 80K Dec 15 04:10 ..
-rwxrwxrwx 1 nobody nogroup 686 Dec 15 04:10 icon_education_01_rgb.svg

If I look at the sync pack destination file (catch it before cleanup), it has 0 bytes

./t0nlovf1/media/z5foiver:
total 4.5K
drwxrwxrwx 2 nobody nogroup    0 Dec 29 22:32 .
drwxrwxrwx 2 nobody nogroup 4.0K Dec 29 22:32 ..
-rwxrwxrwx 1 nobody nogroup    0 Dec 29 22:32 5c21438c448a4c9c9a3eb6a6287f4d48.svg
-rwxrwxrwx 1 nobody nogroup   84 Dec 29 22:32 _names.json

Something seems to be happening during the pack export. Are there any configuration gotchas which would explain this behaviour?

I suspect this is a different issue, but if I right-click the media item in my local instance and attempt to pull from remote, I get this error: image

{
   "ExceptionMessage":"Value cannot be null. (Parameter 'No request info sent')",
   "ExceptionType":"System.ArgumentNullException, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e",
   "StackTrace":"   at uSync.Publisher.Services.SyncPublisherActionService.PerformAction(PublisherActionRequest request)\r\n   at uSync.Publisher.Controllers.uSyncPublisherApiController.PerformAction(PublisherActionRequest request)\r\n   at lambda_method1790(Closure , Object )\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(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)"
}
ianleeder commented 1 year ago

I ended up using Publisher to (push) sync to Azure and it seems to have resolved the issue. Not sure what was wrong with the Umbraco state of media, but now it's syncing media down (pull) with content again.