Skip to content

v15rc: Error when trying to save/publish with new RTE with a large amount of text #17460

Closed
@tristanjthompson

Description

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

15.0.0-rc3

Bug summary

When I add a block into the new RTE and try to save a document, I get an error.
New RTE is saving to the wrong column in the database - it's using varcharValue which is limited to 512 chars instead of textValue which uses nvarchar(max)

Specifics

No response

Steps to reproduce

Edit - ignore the below - simply try to save a long piece of text (e.g more than 512 chars) in the new RTE - see my extra comment on the issue

  • Install Umbraco using the Release Candidate Guide - note, I set it up with SQL Server Express LocalDB (this may be a factor!)
  • Create an element type
    • Name: Heading Block
    • Property1: Heading (textstring) - mandatory
    • Property2: Sub Heading (textstring) - optional
  • Update the existing "Richtext editor" datatype
    • Available Blocks to include the Heading Block & "display inline"
    • Add the "Insert block" button to the toolbar
  • Create a doctype
    • Name: Page
    • Tab: Content
      • Property: Content (Richtext Editor) - optional
    • Structure: Allow at root = true
  • Create a content item using the "Page" doctype
    • Name: Page 1
    • Content: Insert a block - "Heading block" - set the value of Heading to "Heading 1"
    • Click update to close the editor
  • Save and publish the page

Expected result / actual result

Expected result: Saves & publishes successfully
Actual: Receive an error notification saying "Unknown error. Please see the log for more details.
A fatal server error occurred. If this continues, please reach out to your administrator."

Looking in the logs, I can see this error - given it's SQL, maybe it's specific to SQL Express?

Microsoft.Data.SqlClient.SqlException (0x80131904): String or binary data would be truncated in table 'D:\\WORKING.GIT\\TRISTANJTHOMPSON\\UMBRACO-V15\\SRC\\UMBRACOV15\\UMBRACO\\DATA\\UMBRACO.MDF.dbo.umbracoPropertyData

Full exception

{"@t":"2024-11-07T15:03:21.6050440Z","@mt":"Content save operation failed","@l":"Error","@x":"Microsoft.Data.SqlClient.SqlException (0x80131904): String or binary data would be truncated in table 'D:\\WORKING.GIT\\TRISTANJTHOMPSON\\UMBRACO-V15\\SRC\\UMBRACOV15\\UMBRACO\\DATA\\UMBRACO.MDF.dbo.umbracoPropertyData', column 'varcharValue'. Truncated value: '{\"markup\":\"\\u003Cp\\u003E\\u003Cumb-rte-block-inline data-content-key=\\u002246b63ef3-4440-436f-b3c1-6d'.\r\nThe statement has been terminated.\r\n   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, SqlCommand command, Boolean callerHasConnectionLock, Boolean asyncClose)\r\n   at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)\r\n   at Microsoft.Data.SqlClient.SqlDataReader.TryConsumeMetaData()\r\n   at Microsoft.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)\r\n   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean isAsync, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)\r\n   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String method)\r\n   at Microsoft.Data.SqlClient.SqlCommand.ExecuteScalar()\r\n   at Umbraco.Cms.Infrastructure.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func)\r\n   at NPoco.Database.ExecuteScalarHelper(DbCommand cmd)\r\n   at NPoco.Database.InsertAsyncImp[T](PocoData pocoData, String tableName, String primaryKeyName, Boolean autoIncrement, T poco, Boolean sync)\r\n   at NPoco.Database.Insert[T](String tableName, String primaryKeyName, Boolean autoIncrement, T poco)\r\n   at NPoco.Database.Insert[T](T poco)\r\n   at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.DocumentRepository.PersistNewItem(IContent entity)\r\n   at Umbraco.Cms.Core.Cache.DefaultRepositoryCachePolicy`2.Create(TEntity entity, Action`1 persistNew)\r\n   at Umbraco.Cms.Core.Services.ContentService.Save(IContent content, Nullable`1 userId, ContentScheduleCollection contentSchedule)\r\n   at Umbraco.Cms.Core.Services.ContentEditingService.Save(IContent content, Guid userKey)\r\nClientConnectionId:8b28b3f1-72f2-43d5-9c5f-06f0e1267ece\r\nError Number:2628,State:1,Class:16","@tr":"452a275f96c11e1f4cec0fcabe0edce4","@sp":"b52688e5ffa630c8","SourceContext":"Umbraco.Cms.Core.Services.ContentEditingService","ActionId":"700b4ba8-5cb1-4ae8-bbd9-94a15d0f6ed9","ActionName":"Umbraco.Cms.Api.Management.Controllers.Document.CreateDocumentController.Create (Umbraco.Cms.Api.Management)","RequestId":"0HN7V5UODEJCU:00000013","RequestPath":"/umbraco/management/api/v1/document","ConnectionId":"0HN7V5UODEJCU","ProcessId":39304,"ProcessName":"UmbracoV15","ThreadId":55,"ApplicationId":"fba7298e5d601f8f14775162228d60fe803d42d8","MachineName":"MANDO","Log4NetLevel":"ERROR","HttpRequestId":"1a263315-01e7-4c5f-a2ba-ae4d12d27804","HttpRequestNumber":88,"HttpSessionId":"fb23e0bc-7049-5bc7-767e-4324d7807994"}

Notification

image

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions