Copied to clipboard

Flag this post as spam?

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


  • Stefan Arngrimsson 36 posts 59 karma points
    Apr 22, 2013 @ 11:44
    Stefan Arngrimsson
    0

    Unable to publish - String or binary data would be truncated

    Hi,

    Using Umbraco v6.03

    I'm getting this error when trying to save or save and publish.

    We have been working on this site for serveral weeks now without problems until this morning.

    Any ideas?

    Stefan

     

    2013-04-22 09:35:30,421 [6] ERROR Umbraco.Core.UmbracoApplicationBase - [Thread 31] An unhandled exception occurred

    System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Data.SqlClient.SqlException (0x80131904): String or binary data would be truncated.

    The statement has been terminated.

       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)

       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)

       at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)

       at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()

       at System.Data.SqlClient.SqlDataReader.get_MetaData()

       at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)

       at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite)

       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)

       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)

       at System.Data.SqlClient.SqlCommand.ExecuteScalar()

       at Umbraco.Core.Persistence.Database.Insert(String tableName, String primaryKeyName, Boolean autoIncrement, Object poco)

       at Umbraco.Core.Persistence.Database.Insert(Object poco)

       at Umbraco.Core.Persistence.Repositories.ContentRepository.PersistUpdatedItem(IContent entity)

       at Umbraco.Core.Persistence.Repositories.RepositoryBase`2.PersistUpdatedItem(IEntity entity)

       at Umbraco.Core.Persistence.UnitOfWork.PetaPocoUnitOfWork.Commit()

       at Umbraco.Core.Services.ContentService.SaveAndPublishDo(IContent content, Boolean omitCacheRefresh, Int32 userId, Boolean raiseEvents)

       at umbraco.cms.businesslogic.web.Document.PublishWithResult(User u)

       at umbraco.dialogs.publish.doPublishSubs(Document d)

       at umbraco.dialogs.publish.Page_Load(Object sender, EventArgs e)

       at umbraco.BasePages.BasePage.OnLoad(EventArgs e)

       at System.Web.UI.Control.LoadRecursive()

       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    ClientConnectionId:8c049137-6f3d-4cce-84d8-0604e7406326

       at System.Web.UI.Page.HandleError(Exception e)

       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

       at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

       at System.Web.UI.Page.ProcessRequest()

       at System.Web.UI.Page.ProcessRequest(HttpContext context)

       at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

  • Gary Bronson 137 posts 46 karma points
    Jun 03, 2013 @ 20:17
    Gary Bronson
    0

    I just started getting theis error as well. I have a site hosted on Azure and i get this error all of a sudden when trying to save content. I switched to NText as i have seen in other posts but no help. Anyone have any ideas?

     

  • Arman 16 posts 50 karma points
    Jun 28, 2013 @ 13:14
    Arman
    1

    I'm having the same problem too. since I add more text to a data field, I think there is a limitation in database fieald ( here : http://forums.asp.net/t/1564418.aspx/1)

     

    I didn't have this problem in previous versions, in Data Types section, my data type has a "NVarchar" db type which I think should support large texts.

    maybe it's a bug and we should report it via issue tracker... 

  • Arman 16 posts 50 karma points
    Jun 28, 2013 @ 14:06
    Arman
    3

    well, I found the problem

    It was from the Database table definition, they've limited "NVarchar" field in table "CMSPropertyData" to only 500 characters which is very very small size.

    I dropped the   "CMSPropertyData" table and re created it with the field "Nvarchar" of type "Nvarchar(MAX)". everythink works just fine and no more  "String or binary data would be truncated" errors occured with large texts.

  • Damiaan 442 posts 1301 karma points MVP 6x c-trib
    Jun 29, 2013 @ 19:33
    Damiaan
    1

    Hi Arman,

    I have the same problem.  There is also a ntext field CMSPropertyData table, which should be able to contain the same amount of data as an nvarchar(max) field.  The problem with nvarchar(max) is that it is not supported on older SQL servers (pre 2005, I believe).

    The problem I had, was with the label datatype.  The label stores apparently in the varchar field while a RTE is using the Ntext field in the database.  Which dataType are u using for the property which is throwing an error? 

    Kind regards
    Damiaan

  • lucuma 261 posts 563 karma points
    Aug 13, 2013 @ 20:35
    lucuma
    0

    Thanks, we are running into this issue on a v6.0.0 site (can't upgrade, too many custom changes to support webapi). The problem was on the richtext field which man, makes this bug kind of a big one. I'd guess it has been fixed in some of the recent releases.

  • Damiaan 442 posts 1301 karma points MVP 6x c-trib
    Aug 13, 2013 @ 23:51
    Damiaan
    0

    Hi Lucuma,

    If it's not fixed in more recent versions, don't forget to report it at http://issues.umbraco.org. ; :-)

     

  • lucuma 261 posts 563 karma points
    Aug 13, 2013 @ 23:53
    lucuma
    0

    Thanks Damiaan, since you guys posted a month and a half ago I just assumed you already had!

  • Damiaan 442 posts 1301 karma points MVP 6x c-trib
    Aug 14, 2013 @ 00:34
    Damiaan
    0

    Never had time to try it in newer versions.  Site is in production, can't mess with it now.

  • lucuma 261 posts 563 karma points
    Aug 14, 2013 @ 15:20
    lucuma
    0

    Thanks Damiaan, I'm in the same boat however I did a quick search and see that the issue was addressed but not necessarily fixed. I don't think the db has been changed though and I wonder why a richtext editor on v6.0.0 isn't storing its data on the text field.

    http://issues.umbraco.org/issue/U4-2437#tab=Comments

  • rob 75 posts 170 karma points
    Dec 09, 2013 @ 15:17
    rob
    1

    Looking at the test database we upgraded to v7 the issue still exists, dataNvarchar (nvarchar(500)

  • Thomas Egebrand Gram 63 posts 138 karma points
    Dec 15, 2013 @ 01:42
    Thomas Egebrand Gram
    7

    I too ran into this problem with Umbraco 7.0.1, whilst trying to import a package with content-nodes (from Umbraco 6) in the developer section.

    Solved it connecting to the MSSQL with SQL Server Management Studio - and then running this query:

    ALTER TABLE dbo.cmsPropertyData
    ALTER COLUMN dataNvarchar nvarchar(max)

    Clearly a problem that still needs to be solved. I'll see what i can do with contributing it to the umbraco-issues. :)
    Thanks for the pointers above!

    // Thomas G

  • Darren Eccles 59 posts 298 karma points
    Jan 16, 2018 @ 13:55
    Darren Eccles
    0

    Thanks Thomas,

    Just came across this problem and this solved it for me:

    ALTER TABLE dbo.cmsPropertyData
    ALTER COLUMN dataNvarchar nvarchar(max)
    

    Thanks again,

    Darren

  • Kyle Weems 42 posts 296 karma points MVP 7x c-trib
    Jan 05, 2015 @ 20:49
    Kyle Weems
    0

    I'm experiencing this problem as well. Is there any fix other than Thomas' SQL query? Or, conversely, is there any implications long term in upgrading a 7.2.1 site to future versions if I use that query?

  • Atoosa Khoda 96 posts 148 karma points
    Feb 19, 2015 @ 07:33
    Atoosa Khoda
    0

    I have "save and publish" issue as well, on umbraco 7.2.1. It's not every node, but some content nodes. Can't figure out what it is related to. I have used the query above (by Thomas) to alter limitation on cmsPropartyData data column. but that hasn't changed anything.

    Thee error i get is, has anyone else have any more ideas please? Thank you.

    2015-02-19 17:27:43,206 [21] INFO Umbraco.Core.Persistence.UmbracoDatabase - [Thread 42] at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteScalar() at StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteScalar() at Umbraco.Core.Persistence.PetaPocoCommandExtensions.<>cDisplayClassa.9() at Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func) at Umbraco.Core.Persistence.Database.Insert(String tableName, String primaryKeyName, Boolean autoIncrement, Object poco)

  • Atoosa Khoda 96 posts 148 karma points
    Feb 23, 2015 @ 04:19
    Atoosa Khoda
    0

    This solved our issue: UPDATE [dbo].[cmsDataType] SET dbType = 'Ntext' WHERE dbType = 'Nvarchar'.

  • Squazz 35 posts 111 karma points
    Nov 05, 2015 @ 08:25
    Squazz
    0

    I'm not sure that changing the dataNvarchar to nvarchar(max) is the solution...

    Have you considered that you might be storing the data at the wrong place? Afterall, you do have dataNtext that stores the data as ntext, where dataNvarchar stores the data as nvarchar.

    If you have data longer than the 500 characters, maybe you should consider placing that data in dataNtext instead?

    If you design nvarchar columns much larger than the greatest size you need, you will consume more memory than you have to. This affects cache efficiency, sorting speed, etc.

  • Andrew Barta 8 posts 101 karma points
    Apr 29, 2016 @ 20:11
    Andrew Barta
    0

    For anyone's future reference, I believe this was a bug that was logged and fixed at http://issues.umbraco.org/issue/U4-5063.

    Upgrading to 7.2.0 + should solve the issue ... however based on @cssquirrel reply it sounds like it still might be an issue that needs to be re-opened depending on which property editor is being used.

  • Dan Sørensen 102 posts 327 karma points
    Jun 02, 2016 @ 08:35
    Dan Sørensen
    0

    Im in 7.4.1 and still godt this ...

    Like Ricardo say on this issue http://issues.umbraco.org/issue/U4-5063

    I created my own rte I think that made the problem -_-

  • Mark Drake 133 posts 457 karma points c-trib
    Jun 06, 2016 @ 17:38
    Mark Drake
    0

    This is definitely still an issue.

    ERROR Umbraco.Core.Persistence.UmbracoDatabase - Database exception occurred
    System.Data.SqlClient.SqlException (0x80131904): String or binary data would be truncated.
    The statement has been terminated.
    

    This is still happening in my 7.4.2 installation.

    It's occurring within a rich text editor property editor.

  • Devin Gleason Lambert 27 posts 89 karma points
    Jun 21, 2016 @ 21:06
    Devin Gleason Lambert
    1

    I changed my Umbraco.MultiNode TreePicker to dbType Ntext in the CMSDataType table.

    update cmsDataType

    set dbType = 'Ntext'

    where nodeID = 1044

    So far this seems to be working. I have saved and published since with no issues.

    Devin

  • Tom Madden 252 posts 454 karma points MVP 4x c-trib
    Jul 18, 2016 @ 15:23
    Tom Madden
    1

    As mentioned in this bug report http://issues.umbraco.org/issue/U4-5063

    There appear to be 2 rich text editor data types

    Rich text editor Rich Text Editor - use this one and it's okay

    just fell into this today :(

    no need to edit the underlying database

  • Jacob Alvarez 7 posts 98 karma points
    Aug 11, 2016 @ 16:24
    Jacob Alvarez
    0

    I get this error when trying to delete a content node. One of my pages, "Services", was using a macro that loaded content from child content nodes that used a custom RTE data type. I was able to enter data into them, saved, and published.

    Everything worked fine until just today. I noticed all of the content was missing from the page. So I tried editing it and got the error. I then moved all the content to another page and tried deleting the original page, but still get the error. I can't even delete this page now??

  • MarcC 49 posts 356 karma points
    Feb 06, 2018 @ 16:15
    MarcC
    4

    For those who get this error via a custom property type, and find themselves on this forum

    Following the issues listed in the link at the bottom, you must make sure your editor has a value type of text within your package.manifest.

    editor: {
             valueType: "TEXT",
              view: "~/App_Plugins/AngularLiveHtml/angularLiveHtml.html"
            }
    

    If you make this update after creating the custom data type in the back office, you will need to recreate it or update the datatype in the cmsDataType table explained above by Devin Gleason, Atoosa Khoda.

    This will then allow the property type to use Ntext and not Nvarchar(500)

    https://our.umbraco.org/documentation/Umbraco-Cloud/Troubleshooting/Plugins-Known-Issues/

    M

Please Sign in or register to post replies

Write your reply to:

Draft