Issue with community portal repository v29.3.0.5 - sql erros on startup
I had an older version of the portal running locally. I decided to use a newer version to see the implementations. Mostly to learn from it. Installing the 29.3.0.5 version of the portal gave me some issues with the SQL Database. Once starting up the project I receive SQL errors.
I tries to lower my version and installed the 29.2.0.6. This one does work and I have no issues with this.
Query:
INSERT INTO CMS_EventLog ([EventType], [EventTime], [Source], [EventCode], [UserID], [UserName], [IPAddress], [EventDescription], [EventUrl], [EventMachineName], [EventUserAgent], [EventUrlReferrer])
VALUES (@EventType, @EventTime, @Source, @EventCode, @UserID, @UserName, @IPAddress, @EventDescription, @EventUrl, @EventMachineName, @EventUserAgent, @EventUrlReferrer);
SELECT SCOPE_IDENTITY() AS [ID]
Caused exception:
String or binary data would be truncated.
The statement has been terminated.
Exception type: System.Exception
Stack trace:
at CMS.DataEngine.AbstractDataConnection.HandleError(String queryText, Exception ex)
at CMS.DataEngine.AbstractDataConnection.ExecuteScalar(String queryText, QueryDataParameters queryParams, QueryTypeEnum queryType, Boolean requiresTransaction)
at CMS.DataEngine.GeneralConnection.ExecuteScalar(QueryParameters query)
at CMS.DataEngine.DataQueryBase`1.GetScalarResult()
at CMS.DataEngine.DataQueryBase`1.GetScalarResult[T](T defaultValue)
at CMS.DataEngine.DataClassDataSqlStore.Insert(IDataClass dataClass, Boolean initializeId)
at CMS.DataEngine.AbstractInfoBase`1.InsertData()
at CMS.DataEngine.AbstractInfoProvider`3.SetInfo(TInfo info)
at CMS.EventLog.EventLogProvider.LogEventInternal(EventLogInfo eventObject)
at CMS.EventLog.EventLogProvider.LogEventInternal(EventLogInfo eventObject, Boolean logDirectly)
at CMS.EventLog.EventLogProvider.LogEventCore(EventLogInfo eventObject, Boolean logDirectly)
Environment
- Xperience by Kentico version: [29.3.0]
- .NET version: [8]
- Deployment environment: local
- Link to relevant Xperience by Kentico documentation
Answers
Hmm. I don't know what would cause an exception when logging events to the Event Log.
I did truncate that table at one point - that might be what is causing the issue?
I released a new version of the Community Portal.
Try restoring that database backup and see if it works for you.
I know the database does work because the CI/CD pipeline restores the database backup, then restores the CI repository, and then registers member accounts (which would cause a write to the Event Log).
Hello @seangwright, Thank you for your reply. I managed to get the 29.3.3.0 working.
Just some information: I needed to use a different location for the project (it is not my own project so I have it stored in sub folders), it did cause the issue that some yaml files are in a too long file path. Not much to do about that, but maybe some information for others to keep in mind if they are using the portal source code.
@Danny-Paul
I've heard about long path issues from someone else. I always have it enabled (because of these kinds of scenarios) so I didn't think to add it to the docs.
So, thanks for the suggestion and I'll make sure to add a note and some links in the Troubleshooting section for setup.
To answer this question, you have to login first.