Product import from L7 to L8

If I take an export with all fields in Litium 7.7.1 and try to import that in Litium 8.
Is that expected to work? Even if channel/pricelists/fields are not the same, I would expect the file to still load, but not map to the correct fields.

I’m getting an error:

2021-11-12 13:22:17.1352 [App:01] [] [ERROR] [] Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware - An unhandled exception has occurred while executing the request. System.FormatException: Input string was not in a correct format.

   at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)

   at Litium.Web.Administration.Products.Import.ImportFromExcel.GetExcelColumns(DataTable dataTable, Boolean distinct, PredefinedImportSettings mappedColumns)

   at Litium.Web.Administration.WebApi.Products.Controllers.ImportProductsController.Get(Guid systemId)

   at lambda_method11799(Closure , Object , Object[] )

   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.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.<InvokeNextExceptionFilterAsync>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ExceptionContextSealed context)

   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)

   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeNextResourceFilter()

--- End of stack trace from previous location ---

   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()

--- End of stack trace from previous location ---

   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)

   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)

   at Microsoft.AspNetCore.Builder.AppBuilderExtensions.<>c.<<UseLitiumCart>b__3_0>d.MoveNext()

--- End of stack trace from previous location ---

   at Microsoft.AspNetCore.Builder.AppBuilderExtensions.<>c.<<UseLitiumCart>b__3_0>d.MoveNext()

--- End of stack trace from previous location ---

   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)

   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)

   at Microsoft.AspNetCore.Builder.AppBuilderExtensions.<>c__DisplayClass2_0.<<UseLitiumRouting>b__0>d.MoveNext()

--- End of stack trace from previous location ---

   at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)

   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)

   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)

   at IdentityServer4.Hosting.IdentityServerMiddleware.Invoke(HttpContext context, IEndpointRouter router, IUserSession session, IEventService events, IBackChannelLogoutService backChannelLogoutService)

   at IdentityServer4.Hosting.MutualTlsEndpointMiddleware.Invoke(HttpContext context, IAuthenticationSchemeProvider schemes)

   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)

   at IdentityServer4.Hosting.BaseUrlMiddleware.Invoke(HttpContext context)

   at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)

   at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)

   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Litium version: 8

Okey, so that’s not the issue.
Apperently it’s the same if i export a file in Litium 8 and try to import the same file.

Can the import not handle around 700 product fields?

I tested with about 740 fields and the file loads just fine.

In your case it’s throwing an error when it’s processing the column headers. Maybe it’s something with the naming? Do they contain any special characters?

If it’s reproducible in a different environment as well (you could try the Demo site for example), report it as a bug and attach the file.

The naming could be a problem, do not work in other solutions. The solution is uppgraded from 6 to 7, but how can the namings be wrong? Isen’t it the same validation on the creation of fields as the export?

The validation rules for the field id has historically been somewhat loose, until a recent change for Litium 7.7. Are there any # signs in the field names?

No #, but there are “+”, “(”, “)”, “ø”, and “*” (asterix).

I guess the upgrade script to 7.7.2 just adds them to the db without any checks?

Yeah, there’s no validation in the upgrade script. The only allowed characters now are: a-z 0-9 . _ -

I can’t reproduce the issue by just adding those characters to the column header, but # breaks it. But maybe you can report it as a bug and the product team can take a look. Don’t forget to attach the file. I suppose you can strip everything but the column headers.

Sorry, i missunderstood. It was the same for me now, # is breaking the import. There are hashtags in the translation. I only looked at the Id. So no # in translations aswell i suppose. Thanks

Yeah, it was my mistake to reference the field id. It’s the name that can’t contain the #, like you found.

1 Like

I created a bug for this. Hopefully it’s changable. I supposed there are some reason for this to throw an error.
But it’s causing issuses for a customer with very technical namings on the fields.
https://docs.litium.com/support/bugs/bug_details?id=58111

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