Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • iand123 23 posts 53 karma points
    Mar 24, 2018 @ 09:54
    iand123
    0

    Value was either too large or too small for an Int32 after install of Merchello

    Umbraco 7.7.9

    Merchello 2.6.0

    I am using MYSQL as my database.

    I tried adding the package via the Umbraco backend and it looked like it had worked it said your browser is refreshing

    Now i cannot load Umbraco backend and i get this failure

    Value was either too large or too small for an Int32.
    

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.OverflowException: Value was either too large or too small for an Int32.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [OverflowException: Value was either too large or too small for an Int32.] System.Convert.ToInt32(UInt64 value) +6306924 System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) +568 Umbraco.Core.Persistence.Database.ExecuteScalar(String sql, Object[] args) +403 Merchello.Core.Persistence.Migrations.Upgrades.TargetVersionTwoThreeOne.AlterProductAttributeColumnToNtext.Up() +247 Merchello.Core.Persistence.Migrations.CoreMigrationManager.InitializeMigrations(List1 migrations, Database database, DatabaseProviders databaseProvider, Boolean isUpgrade) +202 Merchello.Core.Persistence.Migrations.CoreMigrationManager.UpgradeMerchello(Database database) +1365 Merchello.Core.Persistence.Migrations.CoreMigrationManager.EnsureMerchelloVersion() +188 Merchello.Web.UmbracoApplicationEventHandler.ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) +905 Umbraco.Core.ApplicationEventHandler.OnApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) +50 Umbraco.Core.CoreBootManager.<Complete>b__38_0(IApplicationEventHandler x) +381 Umbraco.Core.EnumerableExtensions.ForEach(IEnumerable1 items, Action1 action) +166 Umbraco.Core.CoreBootManager.Complete(Action1 afterComplete) +416 Umbraco.Web.WebBootManager.Complete(Action`1 afterComplete) +136 Umbraco.Core.UmbracoApplicationBase.StartApplication(Object sender, EventArgs e) +381

    [HttpException (0x80004005): Value was either too large or too small for an Int32.] System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +535 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +166 System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +169 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +372 System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +329

    [HttpException (0x80004005): Value was either too large or too small for an Int32.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +525 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +118 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +708

    Looking at the there were many successes in the upgrade but it then failed with this

    2018-03-24 09:44:37,952 [P9912/D8/T25] INFO Merchello.Core.Persistence.Migrations.CoreMigrationManager - Added UPGRADE migration 'AlterAppliedPaymentDescriptionFieldSize' to context 2018-03-24 09:44:39,292 [P9912/D8/T25] ERROR Umbraco.Core.Persistence.UmbracoDatabase - Exception (34dfe29c). System.OverflowException: Value was either too large or too small for an Int32. at System.Convert.ToInt32(UInt64 value) at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) at Umbraco.Core.Persistence.Database.ExecuteScalar[T](String sql, Object[] args) 2018-03-24 09:44:39,293 [P9912/D8/T25] ERROR Merchello.Core.Persistence.Migrations.CoreMigrationManager - Merchello Database Schema Upgrade Failed

    Please can someone advise? How do i fix this or remove it and try again?

    Ian

  • iand123 23 posts 53 karma points
    Mar 24, 2018 @ 10:43
    iand123
    0

    Ok i seem to have resolved this (although someone with better knowledge of the code may be able to advise)

    I located the error in the code to this migration - https://github.com/Merchello/Merchello/blob/75184df80cd0482468aa482ad294b74ad125167d/src/Merchello.Core/Persistence/Migrations/Upgrades/TargetVersionTwoThreeOne/AlterProductAttributeColumnToNtext.cs

    It seems to be trying to migrate the column to NTEXT which is a sql server type. The field in MYSQL was originally set to be LONGTEXT which seems to be an equivalent (see here https://dev.mysql.com/doc/workbench/en/wb-migration-database-mssql-typemapping.html)

    The code of the migration checked to see if the existing field size was greater than 500 and if it was wouldnt do the migration (it thinks it has already been done) so to fix this i changed the following

    Table: merchproductattribute

    Field: detachedContentValues to be a VARCHAR(1000)

    After this the error goes away and the migrations work and the umbraco backend loads

    I will continue looking into using Merchello but if someione who contributes to the code can let me know the impact of my change that would be appreciated

    Is this better posted as a GitHub Issue?

  • iand123 23 posts 53 karma points
    Mar 24, 2018 @ 11:05
    iand123
    0

    There seems to be various issues with MYSQL even once past this issue. Im getting a lot of mysql errors when using Fasttrack, which ive deleted. Just showing products the back end fails and so does deleting any existing products left in by fasttrack

Please Sign in or register to post replies

Write your reply to:

Draft