vendrhub / vendr-checkout

A ready made checkout flow for Vendr, the eCommerce solution for Umbraco v8+
https://vendr.net/add-ons/vendr-checkout/
MIT License
14 stars 17 forks source link

Problem creating the nodes #32

Open marcusjm opened 2 years ago

marcusjm commented 2 years ago

I get this issue when trying to create a new checkout tree under the root node. Using 2.1.0 of Checkout and 2.1.2 of Vendr.

An error occurred Value cannot be null. (Parameter 'dataType')

Exception Details System.ArgumentNullException, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e: Value cannot be null. (Parameter 'dataType')

mattbrailsford commented 2 years ago

@marcusjm What version of Umbraco are you using?

marcusjm commented 2 years ago

@marcusjm What version of Umbraco are you using?

This is the latest public release 9.4.1

mattbrailsford commented 2 years ago

Hmm, I've just setup 9.4.1 install and installed Vendr + Vendr Checkout and it installed as expected.

Is there anything custom about your setup? Have you removed any of the standard data type deinfitions?

marcusjm commented 2 years ago

I use the Vendr Usync plus some other like Contemtment etc but nothing dramatic.

marcusjm commented 2 years ago

ok I will try again and see if it works

Complete error msg.

` Value cannot be null. (Parameter 'dataType')

Exception Details System.ArgumentNullException, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e: Value cannot be null. (Parameter 'dataType')

at Umbraco.Cms.Core.Models.PropertyType..ctor(IShortStringHelper shortStringHelper, IDataType dataType) at Vendr.Checkout.Pipeline.Tasks.CreateVendrCheckoutDocumentTypesTask.Execute(PipelineArgs1 args) at Vendr.Common.Pipelines.Tasks.PipelineTaskBase2.Execute(PipelineArgs input) at Vendr.Common.Pipelines.InProcPipelineInvoker.gnext|2_0(PipelineArgs e, <>c__DisplayClass2_0& ) at Vendr.Common.Pipelines.InProcPipelineInvoker.gnext|2_0(PipelineArgs e, <>c__DisplayClass2_0& ) at Vendr.Common.Pipelines.InProcPipelineInvoker.Vendr.Common.Pipelines.IPipelineInvoker.Invoke(IEnumerable1 pipelineTasks, PipelineArgs args) at Vendr.Common.Pipelines.Pipeline.Invoke[TPipeline,TEntity](TEntity entity, IDictionary2 additionalData) at Vendr.Common.Pipelines.Pipeline.Invoke[TPipeline,TEntity](TEntity entity) at Vendr.Checkout.Services.InstallService.Install(Int32 siteRootNodeId, StoreReadOnly store) at Vendr.Checkout.Web.Controllers.VendrCheckoutApiController.InstallVendrCheckout(GuidUdi siteRootNodeId) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync() --- End of stack trace from previous location --- 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() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)`

marcusjm commented 2 years ago

Hmm, I've just setup 9.4.1 install and installed Vendr + Vendr Checkout and it installed as expected.

Is there anything custom about your setup? Have you removed any of the standard data type deinfitions?

It is multi language though if that matters? 4 different.

mattbrailsford commented 2 years ago

Hmm, I wouldn't really have thought so. Based on the exception, I'd say it's erroring here https://github.com/vendrhub/vendr-checkout/blob/v2/dev/src/Vendr.Checkout/Pipeline/Tasks/CreateVendrCheckoutDocumentTypesTask.cs#L295 but this get's called in a number of places such as these https://github.com/vendrhub/vendr-checkout/blob/v2/dev/src/Vendr.Checkout/Pipeline/Tasks/CreateVendrCheckoutDocumentTypesTask.cs#L157-L212 but these are all passed data types that are resolved here https://github.com/vendrhub/vendr-checkout/blob/v2/dev/src/Vendr.Checkout/Pipeline/Tasks/CreateVendrCheckoutDocumentTypesTask.cs#L50-L56 so it would appear like one of those is null which would suggest either one of the standard data type definitions isn't present for some reason, or the step picker data type failed to complete in a previous pipeline task which is set to run before that one https://github.com/vendrhub/vendr-checkout/blob/v2/dev/src/Vendr.Checkout/Pipeline/Tasks/CreateVendrCheckoutDataTypesTask.cs#L88

marcusjm commented 2 years ago

Aha so some store setting perhaps? I couldn't see any missing but. We use 4 currencies also. GBP, EUR, SEK and NOK. I compared with the Tea Store and they seem to be about the same (except the unique settings of course)

marcusjm commented 2 years ago

I will try to create a new setup and simply compy the doctypes over.

marcusjm commented 2 years ago

Hmm, I wouldn't really have thought so. Based on the exception, I'd say it's erroring here https://github.com/vendrhub/vendr-checkout/blob/v2/dev/src/Vendr.Checkout/Pipeline/Tasks/CreateVendrCheckoutDocumentTypesTask.cs#L295 but this get's called in a number of places such as these https://github.com/vendrhub/vendr-checkout/blob/v2/dev/src/Vendr.Checkout/Pipeline/Tasks/CreateVendrCheckoutDocumentTypesTask.cs#L157-L212 but these are all passed data types that are resolved here https://github.com/vendrhub/vendr-checkout/blob/v2/dev/src/Vendr.Checkout/Pipeline/Tasks/CreateVendrCheckoutDocumentTypesTask.cs#L50-L56 so it would appear like one of those is null which would suggest either one of the standard data type definitions isn't present for some reason, or the step picker data type failed to complete in a previous pipeline task which is set to run before that one https://github.com/vendrhub/vendr-checkout/blob/v2/dev/src/Vendr.Checkout/Pipeline/Tasks/CreateVendrCheckoutDataTypesTask.cs#L88

It looks like it works when doing from a clean vendr install. Not sure if something collided with other DocTypes then. Going to try using Usync to match them :).

wr-dev commented 2 years ago

I'm getting the same error, admittedly on a pretty heavily customised base site.

Although I don't think we've removed any standard Umbraco datatypes.

Same versions of Vendr too - Vendr 2.1.2, Vendr.Checkout 2.1.0 on Umbraco 8.17.1

Will carry on looking into it, maybe take the source and debug, see if I can work it out

An error occurred
Value cannot be null. Parameter name: dataType

Exception Details
System.ArgumentNullException: Value cannot be null. Parameter name: dataType
Stacktrace
at Umbraco.Core.Models.PropertyType..ctor(IDataType dataType) in D:\a\1\s\src\Umbraco.Core\Models\PropertyType.cs:line 41
   at Vendr.Checkout.Pipeline.Tasks.CreateVendrCheckoutDocumentTypesTask.CreatePropertyType(IDataType dataType, Action`1 config)
   at Vendr.Checkout.Pipeline.Tasks.CreateVendrCheckoutDocumentTypesTask.Execute(PipelineArgs`1 args)
   at Vendr.Common.Pipelines.Tasks.PipelineTaskBase`2.Execute(PipelineArgs input)
   at Vendr.Common.Pipelines.InProcPipelineInvoker.<Vendr.Common.Pipelines.IPipelineInvoker.Invoke>g__next|2_0(PipelineArgs e, <>c__DisplayClass2_0& )
   at Vendr.Common.Pipelines.InProcPipelineInvoker.<Vendr.Common.Pipelines.IPipelineInvoker.Invoke>g__next|2_0(PipelineArgs e, <>c__DisplayClass2_0& )
   at Vendr.Common.Pipelines.InProcPipelineInvoker.Vendr.Common.Pipelines.IPipelineInvoker.Invoke(IEnumerable`1 pipelineTasks, PipelineArgs args)
   at Vendr.Common.Pipelines.Pipeline.Invoke[TPipeline,TEntity](TEntity entity, IDictionary`2 additionalData)
   at Vendr.Checkout.Services.InstallService.Install(Int32 siteRootNodeId, StoreReadOnly store)
   at Vendr.Checkout.Web.Controllers.VendrCheckoutApiController.InstallVendrCheckout(GuidUdi siteRootNodeId)
   at lambda_method(Closure , Object , Object[] )
   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_2.<GetExecutor>b__2(Object instance, Object[] methodParameters)
   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)
   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()
wr-dev commented 2 years ago

Just for info (or if anyone else has this issue) adding the project src to my solution, and referencing directly from the web project worked a treat. Strange.

mattbrailsford commented 2 years ago

🤯

marcusjm commented 2 years ago

Cool. I will try that then.

marcusjm commented 2 years ago

Unfortunatelly that didn't work for me.

mattbrailsford commented 2 years ago

If this is an upgraded umbraco install, I think it’s probably because the new image picker data type isn’t being created. It only gets created on new installs after the version of umbraco in which it was added.

I think we may need to check for its existence before using it 🤔

marcusjm commented 2 years ago

I have not upgraded yet but it is at 9.5.