smartstore / Smartstore

A modular, scalable and ultra-fast open-source all-in-one eCommerce platform built on ASP.NET Core 7
http://www.smartstore.com/
GNU Affero General Public License v3.0
1.2k stars 447 forks source link

Shipping rate computation methods on linux are empty? #832

Closed Algorithman closed 1 year ago

Algorithman commented 1 year ago

Describe the bug I disabled all payment methods except Prepayment, pay in store, credit card (manual) and cash on delivery. Since we have free shipping to our customers I didn't change anything in the shipping configuration. If I run the shop on linux (test deployment) I get this error message:

Exception: At least one shipping rate computation method provider is required to be active.
Smartstore.Core.Checkout.Shipping.ShippingService.LoadEnabledShippingProviders(int storeId, string systemName) in F:\Source\SmartstoreRepo\src\Smartstore.Core\Checkout\Shipping\Services\ShippingService.cs, line 79

If I run the shop within Visual Studio (accessing the same database) it runs without problems. Another clue is that on linux my Shipping rate computation method page looks like this:

Screenshot Capture - 2023-09-27 - 10-06-40

Same page when I start it from visual studio (again, connecting to the same database):

Screenshot Capture - 2023-09-27 - 10-17-00

To Reproduce Steps to reproduce the behavior:

  1. Remove all payment methods but Prepayment, pay in store, credit card (manual) and cash on delivery
  2. Don't set any Shipping by weight/Shipping by total
  3. Restart the server (important)
  4. Try to buy something, it should error out right after you choose your address
  5. See error

Stacktrace

Exception: At least one shipping rate computation method provider is required to be active.
Smartstore.Core.Checkout.Shipping.ShippingService.LoadEnabledShippingProviders(int storeId, string systemName) in F:\Source\SmartstoreRepo\src\Smartstore.Core\Checkout\Shipping\Services\ShippingService.cs
Smartstore.Core.Checkout.Shipping.ShippingService.GetShippingOptionsAsync(ShippingOptionRequest request, string allowedShippingRateComputationMethodSystemName) in F:\Source\SmartstoreRepo\src\Smartstore.Core\Checkout\Shipping\Services\ShippingService.cs
Smartstore.Web.Models.Checkout.CheckoutPaymentMethodMapper.MapAsync(ShoppingCart from, CheckoutPaymentMethodModel to, object parameters) in F:\Source\SmartstoreRepo\src\Smartstore.Web\Models\Checkout\Mappers\CheckoutPaymentMethodMapper.cs
Smartstore.Web.Controllers.CheckoutController.PaymentMethod() in F:\Source\SmartstoreRepo\src\Smartstore.Web\Controllers\CheckoutController.cs
Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor+TaskOfIActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, object controller, object[] arguments)
Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker)
Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
Smartstore.Core.Bootstrapping.CheckoutBootstrappingExtensions+<>c+<<UseCheckoutState>b__0_0>d.MoveNext() in F:\Source\SmartstoreRepo\src\Smartstore.Core\Checkout\Bootstrapping\CheckoutBootstrappingExtensions.cs
Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
Smartstore.Web.Api.Startup+<>c+<<BuildPipeline>b__3_6>d.MoveNext()
Smartstore.ExceptionExtensions.ReThrow(Exception exception) in F:\Source\SmartstoreRepo\src\Smartstore\Extensions\ExceptionExtensions.cs
Smartstore.Web.Api.Startup.ProcessException(HttpContext context, Exception ex)
Smartstore.Web.Api.Startup+<>c+<<BuildPipeline>b__3_6>d.MoveNext()
StackExchange.Profiling.MiniProfilerMiddleware.Invoke(HttpContext context) in C:\projects\dotnet\src\MiniProfiler.AspNetCore\MiniProfilerMiddleware.cs
Smartstore.Core.Localization.RequestCultureMiddleware.Invoke(HttpContext context, IWorkContext workContext) in F:\Source\SmartstoreRepo\src\Smartstore.Core\Platform\Localization\Services\RequestCultureMiddleware.cs
Smartstore.Core.Logging.RequestLoggingMiddleware.InvokeAsync(HttpContext httpContext, IWebHelper webHelper, IWorkContext workContext) in F:\Source\SmartstoreRepo\src\Smartstore.Core\Platform\Logging\Serilog\RequestLoggingMiddleware.cs
Smartstore.Core.Bootstrapping.CommonBuilderExtensions+<>c+<<UseWorkContext>b__1_0>d.MoveNext() in F:\Source\SmartstoreRepo\src\Smartstore.Core\Platform\Common\Bootstrapping\CommonBuilderExtensions.cs
Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
Smartstore.Core.Bootstrapping.LocalizationBuilderExtensions.OnAfterRouting(HttpContext context, Func<Task> next) in F:\Source\SmartstoreRepo\src\Smartstore.Core\Platform\Localization\Bootstrapping\LocalizationBuilderExtensions.cs
Smartstore.Core.Bootstrapping.LocalizationBuilderExtensions.OnBeforeRouting(HttpContext context, Func<Task> next) in F:\Source\SmartstoreRepo\src\Smartstore.Core\Platform\Localization\Bootstrapping\LocalizationBuilderExtensions.cs
Microsoft.AspNetCore.OData.Batch.ODataBatchMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.OData.Query.ODataQueryRequestMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.OData.Routing.ODataRouteDebugMiddleware.Invoke(HttpContext context)
Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
Smartstore.Core.Bootstrapping.CommonBuilderExtensions+<>c+<<UseSecurityHeaders>b__3_0>d.MoveNext() in F:\Source\SmartstoreRepo\src\Smartstore.Core\Platform\Common\Bootstrapping\CommonBuilderExtensions.cs
Smartstore.Core.Bootstrapping.CommonBuilderExtensions+<>c+<<UsePoweredBy>b__2_0>d.MoveNext() in F:\Source\SmartstoreRepo\src\Smartstore.Core\Platform\Common\Bootstrapping\CommonBuilderExtensions.cs
Smartstore.Web.Bundling.BundleMiddleware.InvokeAsync(HttpContext httpContext) in F:\Source\SmartstoreRepo\src\Smartstore.Web.Common\Bundling\BundleMiddleware.cs
Smartstore.Engine.Initialization.ApplicationInitializerMiddleware.Invoke(HttpContext context) in F:\Source\SmartstoreRepo\src\Smartstore\Engine\Initialization\ApplicationInitializerMiddleware.cs
Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

Desktop (please complete the following information):

Additional info After looking into the database itself, I have no rules/rulesets defined and therefore no ruleset mappings. The only shipping method in ShippingSettings.ActiveShippingRateComputationMethodSystemNames is Shipping.FixedRate (as I want it to be the only one).

More in-depth debugging seems to indicate that _providerManager.GetAllProviders(storeId) returns an empty list. see here

Michael-Herzog commented 1 year ago

Hi, have you checked that the modules are present in the file system on your Linux machine? Regards, Michael

Algorithman commented 1 year ago

Sure, I always make a full build and copy the whole artefacts folder.

drwxr-xr-x  4 chris chris  4096 Sep 27 12:41 Smartstore.Shipping
drwxr-xr-x  4 chris chris  4096 Sep 27 12:41 Smartstore.ShippingByWeight
muratcakir commented 1 year ago

They are present on the file system, yes, but the plugins do not seem to be installed. Can you check please?

Algorithman commented 1 year ago

You're absolutely right, thank you :)