Umbraco nuget Update, 7.2.8 > 7.3.4, Invalid Column Name
Hi all,
Been attempting to upgrade a client website from 7.2.8 to 7.3.4 using nuget. While the packages update fine and the solution builds we are having issues on the installer screen when booting into the website to complete the update.
Once you click to proceed update on the site you get an error stating an error during installation, then the following in the logs:
Error Number:207,State:1,Class:16
2015-12-17 13:28:38,375 [P4100/D2/T8] WARN Umbraco.Core.Services.UserService - An error occurred attempting to save a user instance during upgrade, normally this warning can be ignored. Exception: System.Data.SqlClient.SqlException (0x80131904): Invalid column name 'securityStampToken'.
Invalid column name 'lastLoginDate'.
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.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, Boolean describeParameterEncryptionRequest)
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.InternalExecuteNonQuery(TaskCompletionSource1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Umbraco.Core.Persistence.PetaPocoCommandExtensions.<>c__DisplayClass1.<ExecuteNonQueryWithRetry>b__0()
at Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func1 func)
at Umbraco.Core.Persistence.Database.Update(String tableName, String primaryKeyName, Object poco, Object primaryKeyValue, IEnumerable1 columns)
at Umbraco.Core.Persistence.Database.Update(Object poco, Object primaryKeyValue, IEnumerable1 columns)
at Umbraco.Core.Persistence.Repositories.UserRepository.PersistUpdatedItem(IUser entity)
at Umbraco.Core.Persistence.Repositories.RepositoryBase2.PersistUpdatedItem(IEntity entity)
at Umbraco.Core.Persistence.UnitOfWork.PetaPocoUnitOfWork.Commit(Action1 transactionCompleting)
at Umbraco.Core.Services.UserService.Save(IUser entity, Boolean raiseEvents)
ClientConnectionId:57392c19-3e7d-4806-8599-8c81ebce0de2
...So, from my end it appears that I am missing some database user table rows, but the reason for this is unclear. Is there a specific interim version which includes / generates these rows as part of the updater which is not included?
VS2013 solution if that has any impact. Any help appreciated...
Those are added for 7.3.0. But they should also be added when just upgrading to 7.3.4.
Just to make sure: when you upgrade, you should not change umbracoConfigurationStatus in your web.config, it should have a value of 7.2.8.
Also, don't change anything to your connection string, it should point to the database where Umbraco is currently installed (your 7.2.8 database).
Also make sure that all files are copied over, maybe start by deleting (moving out) all of the files in your bin folder and doing a rebuild of your project in Visual Studio. See if that makes a difference.
The web config should have been left intact in this instance and was not removed, ditto for the connection string.
Since posting attempted an upgrade on a personal project of mine without issue, so thinking it is something specific to this particular project. Thinking the solution should be fine with the database configs as it got far enough into the process to identify individual table columns were not present so it must have connected at least.
Will keep plugging away this end and see if I can narrow it down. Thanks for getting back to me.
Making no progress on this one. Everything appears to be fine in terms of the solution. The main issue seems to be in the creation of these user table rows.
Is there any way to kick-off a process to perform just that section of the install to ensure those rows get created, or any issue in me cloning / replicating the table structure from another updated project of the same version for the UmbracoUser table?
Ran through the process from scratch from my pre-update code, and ensured all installation instructions were followed - no removal of the version in web.config etc...
Can you send me your zipped VS solution + database so I can help and possibly fix if the problem is in Umbraco? A DropBox / WeTransfer link can be sent to [email protected]
@Sebastiaan, I would have to get client / business approval first. They may be willing for us to do this, but our main contacts are unavailable for the next week or two due to the holidays.
Will ask and provide if possible, and in the interim backup + clone the DB locally and try copying across the structure from a successful upgrade to see if that will help the update go through.
@Sebastiaan I had a simple site upgrade from 7.2.8 and tried to go to 7.3.4 and it failed. I have tried manual and nuget and get the same result. Frontend is blank with unknown error and the backend is all still there. I am now just rebuilding the site in 7.3.4.
When I upgraded to v7.3.4, from v7.2.8, I found that I had to go to v7.3.0 first. Although, I am doing it manually, so maybe I messed it up the first time I tried to upgrade it.
2016-02-04 07:21:42,874 [28] WARN Umbraco.Core.Services.UserService - An error occurred attempting to save a user instance during upgrade, normally this warning can be ignored. Exception: System.Data.SqlClient.SqlException (0x80131904): Invalid column name 'securityStampToken'.
Invalid column name 'lastLoginDate'.
I upgraded the staging DB on this site successfully but the live DB returns this error.
did anyone one else figure this out. I am also stuck.
BOTH
7.2.1 => 7.3.0
7.2.1 => 7.4.1
I am looking at doing a schema compare and see manually doing that step will help
Umbraco.Core.Services.UserService - An error occurred attempting to save a user instance during upgrade, normally this warning can be ignored.
Exception: System.Data.SqlClient.SqlException (0x80131904): Invalid column name 'securityStampToken'. Invalid column name 'lastLoginDate'.
...
ERROR UmbracoExamine.DataServices.UmbracoLogService - Provider=InternalMemberIndexer, NodeId=-1 System.Exception: Cannot index queue items, the index doesn't exist!,, IndexSet: InternalMemberIndexSet
2016-02-18 14:41:52,385 [P8640/D3/T24] ERROR UmbracoExamine.DataServices.UmbracoLogService - Provider=InternalIndexer, NodeId=-1 System.Exception: Cannot index queue items, the index doesn't exist!,, IndexSet: InternalIndexSet
2016-02-18 14:41:52,385 [P8640/D3/T24] ERROR UmbracoExamine.DataServices.UmbracoLogService - Provider=ExternalIndexer, NodeId=-1 System.Exception: Cannot index queue items, the index doesn't exist!,, IndexSet: ExternalIndexSet
2016-02-18 14:42:22,402 [P8640/D3/T24] INFO Umbraco.Core.UmbracoApplicationBase - Application shutdown. Details: ConfigurationChange
I'm getting the same error as Angel and Kieran when trying to upgrade from 7.2.8 to 7.4.1. Has anyone figured out a resolution to this (short of doing a complete manual schema compare as Kieran did)?
I have been trying to upgrade Umbraco from version 6.1.6 to 7.4.1 and i ran into the mentioned problem. I have compared clean Umbraco 7 installation with an upgraded version (6.1.6 -> 7.4.1) and i have noticed that membership providers in web.config have not been updated.
Apart from different type, few attributes are missing. Upon updating these values in web.config i have been able to log in and complete database upgrade.
I have had a similar problem, but this error was a red herring.
Like @Dan Evans above, I successfully upgraded development and staging sites to 7.4.1 (from 7.2.2), but then when running the same process on the live DB I got the error:
2016-03-21 08:03:08,108 [P5736/D2/T12] INFO Umbraco.Core.Security.BackOfficeSignInManager - Event Id: 0, state: User: ****** logged in from IP address **.**.**.**
2016-03-21 08:03:08,155 [P5736/D2/T12] ERROR Umbraco.Core.Persistence.UmbracoDatabase - Database exception occurred
System.Data.SqlClient.SqlException (0x80131904): Invalid column name 'securityStampToken'.
Invalid column name 'lastLoginDate'.
at [...stacktrace...]
Error Number:207,State:1,Class:16
2016-03-21 08:03:08,171 [P5736/D2/T12] WARN Umbraco.Core.Services.UserService - An error occurred attempting to save a user instance during upgrade, normally this warning can be ignored. Exception: System.Data.SqlClient.SqlException (0x80131904): Invalid column name 'securityStampToken'.
Invalid column name 'lastLoginDate'.
at [...stacktrace...]
I checked the logs from the staging server, and they also had these errors, but the server had upgraded and run fine! Notice the line "normally this warning can be ignored".
In my case there was a further error just afterwards:
Error Number:207,State:1,Class:16
2016-03-21 08:03:09,999 [P5736/D2/T11] ERROR Umbraco.Core.UmbracoApplicationBase - An unhandled exception occurred
System.Web.HttpCompileException (0x80004005): [...path...]\umbraco\Install\Views\Index.cshtml(9): error CS0103: The name 'ViewBag' does not exist in the current context
This was the real problem. It was caused by a new Web.config file in \umbraco\Install\Views that was put there by the Umbraco 7.4 install from NuGet (Stack Overflow answer). Our custom deployment script to live sites ignores Web.config files because they often need generating specially for each server, but I didn't notice this new one so didn't put anything in place to create it.
To those of you experiencing this securityStampToken error, I urge you to look further down your log file!
Had to pick up this upgrade again and encountered the same issue. It looks like many column name fields are not being created correctly on update...
To recap - previously I was attempting v7.2.8 to 7.3.4. On this attempt I took it back a step so I could go to the next stable release after 7.2.8. As such since 7.3.0 had Nuget issues the next stable version was seemingly 7.3.1.
As an aside, should a release with faults of that nature in a version not be flagged on the affected version with a note to go to the next stable release? Would not have known to check and only found out by fortune... Ditto if it has a known security issue for example.
A comparison in the DB's against my upgraded site vs a new site showed that the following columns were missing from the dbo.umbracoUser table:
securityStamptoken
failedLoginAttempts
lastLockoutdate
lastPasswordChangeDate
lastLoginDate
To me, this looks like something that should be added in the update process is missing relating to adding these columns to the database for user management. I saw config amends related to OWIN which could maybe be a factor, but is speculation.
Regardless, do we know what version of Umbraco introduced these DB fields and potential suggestions on how to rectify please?
We do everything we can to make upgrades as smooth as possible.
I suspect what happened is that you've updated the version number in web.config to 7.3.0 or higher manually, which means the migrations for 7.3.0 didn't run. This is when those properties were introduced. You can simply set the version in web.config to 7.2.8 right now and run through the upgrade installer again, the properties will then be created for you.
As an aside: when upgrading, we always recommend going to the latest version so you don't run into security issues for example.
The web config on this branch has always been at 7.2.8 and has not been manually modified. The latest post for me above was on a clean 7.2.8 branch, which then had a Nuget package update to 7.3.0 (and then subsequently 7.3.1 when spotting the issues noted in 7.3.0).
The Post Install step of this then fails when trying to authorise the upgrade.
Firstly thanks for taking the time to record the process... Mine was pretty much the same to be honest.
Started off at 7.2.8, did a Nuget update to 7.3.0 and a corresponding update to Umbraco.Core 7.3.0 for any class libraries that required it due to references. If the config option appeared we entered no.
Built the project and booted, had an issue with some System.Web.Http references. At this stage I have not gotten to the authorise upgrade point due to a yellow screen on those references. Noticed the notes on 7.3.1, and repeated the process with 7.3.1.
After updating to 7.3.1 I did a rebuild and opened my site. The yellow screens had gone, and the authorise upgrade login was presented.
Chrome inspector showed the failed request:
Just going to dig out the trace log, comment again in a sec...
First of all: at this point I recommend you just upgrade to 7.4.3, there's no reason to stick with 7.3 and certainly no reason to do upgrades version by version, you can go straight from 7.2.8 to 7.4.3.
I watched your video and tried to duplicate it. I was able to perform an upgrade from 7.1.6 to 7.4.3 and, with a bit of tweaking to various config files, get it to build. However, when I got to the login page, I'm unable to login.
Checking the logs I see:
WARN Umbraco.Core.Services.UserService - An error occurred attempting to save a user instance during upgrade, normally this warning can be ignored.
Exception: System.Data.SqlClient.SqlException (0x80131904):
Invalid column name 'securityStampToken'.
Invalid column name 'failedLoginAttempts'.
I cannot proceed with the upgrade because I cannot log in. It seems pretty clear that there's some break in the upgrade process which is putting the database and authentication code in a mismatched state. What should I do to attempt to resolve this issue?
Ha, tried it but the editor only seemed to highlight the top line :)
Thanks for the quick responses... Normally mid reply when they come in ;)
Thinking you are right and it may be worth going straight to 7.4.3 and reporting back. Generally been in the mindset of upgrading to the nearest non-minor revision when having to jump a few versions... helps me understand the new bits introduced at each stage (such as new optional flexible LB in 7.3.0) and take any actions. Any minor revisions or a diff of only a few version increments then happy to just skip to latest, unfortunately just a little behind on the updates on this one so decided to do it incrementally...
As you have shown, the updates seem to work on your end - so will see if the leap to 7.4.3 has any joy.
I don't know what your rewrite rules look like but the error you posted points at that being the problem, just disable all the rewrite rules before you upgrading and try again!
Yep, correct... one of the rewrites was catching the request. The inclusion of that rule above was not enough on its own as one of the others took precedence.
Currently reviewing the rules and looking at how they can be implemented or adjusted to correct this.
Umbraco nuget Update, 7.2.8 > 7.3.4, Invalid Column Name
Hi all,
Been attempting to upgrade a client website from 7.2.8 to 7.3.4 using nuget. While the packages update fine and the solution builds we are having issues on the installer screen when booting into the website to complete the update.
Once you click to proceed update on the site you get an error stating an error during installation, then the following in the logs:
...So, from my end it appears that I am missing some database user table rows, but the reason for this is unclear. Is there a specific interim version which includes / generates these rows as part of the updater which is not included?
VS2013 solution if that has any impact. Any help appreciated...
Those are added for 7.3.0. But they should also be added when just upgrading to 7.3.4.
Just to make sure: when you upgrade, you should not change
umbracoConfigurationStatus
in your web.config, it should have a value of7.2.8
.Also, don't change anything to your connection string, it should point to the database where Umbraco is currently installed (your 7.2.8 database).
Also make sure that all files are copied over, maybe start by deleting (moving out) all of the files in your bin folder and doing a rebuild of your project in Visual Studio. See if that makes a difference.
Hi Sebastiaan,
The web config should have been left intact in this instance and was not removed, ditto for the connection string.
Since posting attempted an upgrade on a personal project of mine without issue, so thinking it is something specific to this particular project. Thinking the solution should be fine with the database configs as it got far enough into the process to identify individual table columns were not present so it must have connected at least.
Will keep plugging away this end and see if I can narrow it down. Thanks for getting back to me.
Hi all,
Making no progress on this one. Everything appears to be fine in terms of the solution. The main issue seems to be in the creation of these user table rows.
Is there any way to kick-off a process to perform just that section of the install to ensure those rows get created, or any issue in me cloning / replicating the table structure from another updated project of the same version for the UmbracoUser table?
Ran through the process from scratch from my pre-update code, and ensured all installation instructions were followed - no removal of the version in web.config etc...
Can you send me your zipped VS solution + database so I can help and possibly fix if the problem is in Umbraco? A DropBox / WeTransfer link can be sent to [email protected]
Thanks!
@Sebastiaan, I would have to get client / business approval first. They may be willing for us to do this, but our main contacts are unavailable for the next week or two due to the holidays.
Will ask and provide if possible, and in the interim backup + clone the DB locally and try copying across the structure from a successful upgrade to see if that will help the update go through.
@Sebastiaan I had a simple site upgrade from 7.2.8 and tried to go to 7.3.4 and it failed. I have tried manual and nuget and get the same result. Frontend is blank with unknown error and the backend is all still there. I am now just rebuilding the site in 7.3.4.
When I upgraded to v7.3.4, from v7.2.8, I found that I had to go to v7.3.0 first. Although, I am doing it manually, so maybe I messed it up the first time I tried to upgrade it.
Hi Keith,
Do you have a solution to your issue? I am having the same problem.
I'm getting the same error when trying to upgrade from 7.2.6 > 7.3.6
This is the specific error we are getting:
2016-02-04 07:21:42,874 [28] WARN Umbraco.Core.Services.UserService - An error occurred attempting to save a user instance during upgrade, normally this warning can be ignored. Exception: System.Data.SqlClient.SqlException (0x80131904): Invalid column name 'securityStampToken'. Invalid column name 'lastLoginDate'.
I upgraded the staging DB on this site successfully but the live DB returns this error.
did anyone one else figure this out. I am also stuck. BOTH
I am looking at doing a schema compare and see manually doing that step will help
...
Getting a new project with correct DB schema then doing a schema compare and update on the target seemed to work.
I was planning to give the upgrade direct to 7.4 a go but will hold off now. Interested to hear if you find a resolution to this.
I am also having this problem when upgrading from 7.2.6 > 7.4.1
I'm getting the same error as Angel and Kieran when trying to upgrade from 7.2.8 to 7.4.1. Has anyone figured out a resolution to this (short of doing a complete manual schema compare as Kieran did)?
I have been trying to upgrade Umbraco from version 6.1.6 to 7.4.1 and i ran into the mentioned problem. I have compared clean Umbraco 7 installation with an upgraded version (6.1.6 -> 7.4.1) and i have noticed that membership providers in web.config have not been updated.
Clean Umbraco 7.4.1:
Updated 6.1.6 to 7.4.1
Apart from different type, few attributes are missing. Upon updating these values in web.config i have been able to log in and complete database upgrade.
Hope this helps.
I have had a similar problem, but this error was a red herring.
Like @Dan Evans above, I successfully upgraded development and staging sites to 7.4.1 (from 7.2.2), but then when running the same process on the live DB I got the error:
I checked the logs from the staging server, and they also had these errors, but the server had upgraded and run fine! Notice the line "normally this warning can be ignored".
In my case there was a further error just afterwards:
This was the real problem. It was caused by a new Web.config file in
\umbraco\Install\Views
that was put there by the Umbraco 7.4 install from NuGet (Stack Overflow answer). Our custom deployment script to live sites ignores Web.config files because they often need generating specially for each server, but I didn't notice this new one so didn't put anything in place to create it.To those of you experiencing this securityStampToken error, I urge you to look further down your log file!
Hi all,
Had to pick up this upgrade again and encountered the same issue. It looks like many column name fields are not being created correctly on update...
To recap - previously I was attempting v7.2.8 to 7.3.4. On this attempt I took it back a step so I could go to the next stable release after 7.2.8. As such since 7.3.0 had Nuget issues the next stable version was seemingly 7.3.1.
A comparison in the DB's against my upgraded site vs a new site showed that the following columns were missing from the dbo.umbracoUser table:
To me, this looks like something that should be added in the update process is missing relating to adding these columns to the database for user management. I saw config amends related to OWIN which could maybe be a factor, but is speculation.
Regardless, do we know what version of Umbraco introduced these DB fields and potential suggestions on how to rectify please?
We do everything we can to make upgrades as smooth as possible.
I suspect what happened is that you've updated the version number in web.config to 7.3.0 or higher manually, which means the migrations for 7.3.0 didn't run. This is when those properties were introduced. You can simply set the version in web.config to 7.2.8 right now and run through the upgrade installer again, the properties will then be created for you.
As an aside: when upgrading, we always recommend going to the latest version so you don't run into security issues for example.
Ps. I've written a blog post which describes how upgrading the database works in detail, it might be beneficial to learn about the inner workings: https://cultiv.nl/blog/using-umbraco-migrations-to-deploy-changes/
Hi Sebastiaan,
The web config on this branch has always been at 7.2.8 and has not been manually modified. The latest post for me above was on a clean 7.2.8 branch, which then had a Nuget package update to 7.3.0 (and then subsequently 7.3.1 when spotting the issues noted in 7.3.0).
The Post Install step of this then fails when trying to authorise the upgrade.
I don't understand what you mean? What fails? What did you do (steps)? What do you see? What's the error message? :)
This is what it looks like for me to upgrade from 7.2.8 to 7.3.1, make sure to skip around in it because some things take a little long.
Note that I say NO to overwriting config files at 2:43 and that I run a build at 3:08 after which the video gets a bit more exciting.
https://www.youtube.com/watch?v=JEBS045p5fI&feature=youtu.be
I have the following log messages as well, showing what it tried to do.
What's different in your upgrade?
Hi Sebastiaan,
Firstly thanks for taking the time to record the process... Mine was pretty much the same to be honest.
Started off at 7.2.8, did a Nuget update to 7.3.0 and a corresponding update to Umbraco.Core 7.3.0 for any class libraries that required it due to references. If the config option appeared we entered no.
Built the project and booted, had an issue with some System.Web.Http references. At this stage I have not gotten to the authorise upgrade point due to a yellow screen on those references. Noticed the notes on 7.3.1, and repeated the process with 7.3.1.
After updating to 7.3.1 I did a rebuild and opened my site. The yellow screens had gone, and the authorise upgrade login was presented.
Chrome inspector showed the failed request:
Just going to dig out the trace log, comment again in a sec...
First of all: at this point I recommend you just upgrade to 7.4.3, there's no reason to stick with 7.3 and certainly no reason to do upgrades version by version, you can go straight from 7.2.8 to 7.4.3.
Thanks for the error, you might have conflicting rewrite rules: http://issues.umbraco.org/issue/U4-5019
I watched your video and tried to duplicate it. I was able to perform an upgrade from 7.1.6 to 7.4.3 and, with a bit of tweaking to various config files, get it to build. However, when I got to the login page, I'm unable to login.
Checking the logs I see:
I cannot proceed with the upgrade because I cannot log in. It seems pretty clear that there's some break in the upgrade process which is putting the database and authentication code in a mismatched state. What should I do to attempt to resolve this issue?
Unfortunately no idea how to format the following nicely in the editor - apologies...
If only we had a button for that ;-)
Anyway, make sure to check out my comment above!
Ha, tried it but the editor only seemed to highlight the top line :)
Thanks for the quick responses... Normally mid reply when they come in ;)
Thinking you are right and it may be worth going straight to 7.4.3 and reporting back. Generally been in the mindset of upgrading to the nearest non-minor revision when having to jump a few versions... helps me understand the new bits introduced at each stage (such as new optional flexible LB in 7.3.0) and take any actions. Any minor revisions or a diff of only a few version increments then happy to just skip to latest, unfortunately just a little behind on the updates on this one so decided to do it incrementally...
As you have shown, the updates seem to work on your end - so will see if the leap to 7.4.3 has any joy.
Just updated to 7.4.3 from 7.3.1 and still have the same issue unfortunately... same errors.
The trace logs show the application as starting up as 7.4.3 but no luck at the authorise stage again.
Also worth noting that I have included the rewrite rule provided in one of the links provided for:
I don't know what your rewrite rules look like but the error you posted points at that being the problem, just disable all the rewrite rules before you upgrading and try again!
If you post the rewrites I can have a look. :)
Hi Sebastiaan,
Yep, correct... one of the rewrites was catching the request. The inclusion of that rule above was not enough on its own as one of the others took precedence.
Currently reviewing the rules and looking at how they can be implemented or adjusted to correct this.
Thanks for the assistance, much appreciated.
I have a similar issue, but the solution provided here didn't work. Could anybody help?
https://our.umbraco.org/forum/using-umbraco-and-getting-started/90947-installer-not-working-upgrading-from-756-to-792
Jeroen
is working on a reply...