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)
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?
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...
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.
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?
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.
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.
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?
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)
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.
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.
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.
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??
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)
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)
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?
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...
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.
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
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.
Hi Lucuma,
If it's not fixed in more recent versions, don't forget to report it at http://issues.umbraco.org. ; :-)
Thanks Damiaan, since you guys posted a month and a half ago I just assumed you already had!
Never had time to try it in newer versions. Site is in production, can't mess with it now.
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
Looking at the test database we upgraded to v7 the issue still exists, dataNvarchar (nvarchar(500)
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:
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
Thanks Thomas,
Just came across this problem and this solved it for me:
Thanks again,
Darren
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?
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, 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, SqlDataReader ds) 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 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)This solved our issue: UPDATE [dbo].[cmsDataType] SET dbType = 'Ntext' WHERE dbType = 'Nvarchar'.
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.
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.
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 -_-
This is definitely still an issue.
This is still happening in my 7.4.2 installation.
It's occurring within a rich text editor property editor.
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
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
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??
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.
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
is working on a reply...