Odd Shipment Error after upgrading 4.4 to 4.5.3

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
1 年 前
Hi,

I have just upgraded our site from 4.4 to 4.5, the upgrade went without any issues.  However,  there were a few shipments that had been added but not marked as shipped.  After the upgrade I am trying to mark them as shipped but some (not all) are throwing an error when I try and View the shipment in the order details screen.  The test order I put through after the upgrade is fine and I was able to mark as shipped in the normal way without any error.

Just wondered if anyone can tell me how to fix or how to mark these as shipped. I am fine with updating SQL tables directly.

TIA

Wurzel

The error (from the logs):

System.NullReferenceException: Object reference not set to an instance of an object.
   at Nop.Services.Shipping.ShipmentService.GetShipmentTrackerAsync(Shipment shipment)
   at Nop.Web.Areas.Admin.Factories.OrderModelFactory.PrepareShipmentModelAsync(ShipmentModel model, Shipment shipment, Order order, Boolean excludeProperties)
   at Nop.Web.Areas.Admin.Controllers.OrderController.ShipmentDetails(Int32 id)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Nop.Services.Authentication.AuthenticationMiddleware.InvokeAsync(HttpContext context)
   at StackExchange.Profiling.MiniProfilerMiddleware.Invoke(HttpContext context) in C:\projects\dotnet\src\MiniProfiler.AspNetCore\MiniProfilerMiddleware.cs:line 121
   at WebMarkupMin.AspNetCore6.WebMarkupMinMiddleware.ProcessAsync(HttpContext context, Boolean useMinification, Boolean useCompression)
   at WebMarkupMin.AspNetCore6.WebMarkupMinMiddleware.ProcessAsync(HttpContext context, Boolean useMinification, Boolean useCompression)
   at WebMarkupMin.AspNetCore6.WebMarkupMinMiddlewareBase.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Nop.Services.Installation.InstallUrlMiddleware.InvokeAsync(HttpContext context, IWebHelper webHelper)
   at Nop.Services.Common.KeepAliveMiddleware.InvokeAsync(HttpContext context, IWebHelper webHelper)
   at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
1 年 前
Run this SQL Query to see if you have any "orphans" (Shipments referencing an Order Id that does not exist).
SELECT *
  FROM [Shipment] s
  WHERE NOT Exists (select 1 from [Order] o WHERE o.Id = s.OrderId)
1 年 前
New York wrote:
Run this SQL Query to see if you have any "orphans" (Shipments referencing an Order Id that does not exist).
SELECT *
  FROM [Shipment] s
  WHERE NOT Exists (select 1 from [Order] o WHERE o.Id = s.OrderId)


Thanks for the suggestion but no results were returned.
1 年 前
This should not happen, but check just in case:

  SELECT *
  FROM [Shipment] s
  WHERE s.OrderId is null
1 年 前
New York wrote:
This should not happen, but check just in case:

  SELECT *
  FROM [Shipment] s
  WHERE s.OrderId is null


No results.  I thought all new shipments were good but it is actually all orders now.  I cannot mark any orders as shipped since I upgraded to 4.5.  I have run a trace on the database and the last statement to be executed before the error throws is:

exec sp_executesql N'SELECT
  [si].[Id],
  [si].[WarehouseId],
  [si].[Quantity],
  [si].[OrderItemId],
  [si].[ShipmentId]
FROM
  [ShipmentItem] [si]
WHERE
  [si].[ShipmentId] = @shipmentId
',N'@shipmentId int',@shipmentId=1198


There is data in each field.  The OrderItemId exists as does the ShipmentId.  The error is thrown when I click the View button on the shipment in order details screen.

If I go into the Shipments screen, check the order and "Set as Shipped (Selected)" it set the shipment as shipped as expected.
1 年 前
I presume your shipping plugins do not support version 4.50. Please see this topic (we'll fix it soon)
1 年 前
a.m. wrote:
I presume your shipping plugins do not support version 4.50. Please see this topic (we'll fix it soon)


Hi,

Thanks for the reply.

I sent this problem to FoxNetSoft when I realised what was causing the error.  They confirmed it as a NOP bug and submitted a bug report.

They also sent me a fix which has solved the problem.

Many Thanks

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