Hi,
Can you take the 8.0.1.1.sql file in EPiServer.Commerce.Core package, folder epiupdates_CMS/sql and run it manually to see if it solves your issue?
Regards.
/Q
I ran it. It didn't help. It says 'Verifying/creating Campaign root...' and then procedes to do nothing.
You pointed me in the right direction though, I was able to solve the issue. I started decompiling the EPiServer sources with DotPeek and starting looking into the database.
This is the EPiServer method that fails:
private static ContentReference GetCampaignRoot() { try { return ServiceLocator.Current.GetInstance<IContentLoader>().Get<IContent>(CampaignFolder.CampaignRootGuid).ContentLink; } catch (ContentNotFoundException ex) { throw new InvalidOperationException("Could not load SysCampaignRoot from tblContent that should have ContentGUID '48E4889F-926B-478C-9EAE-25AE12C4AEE2'"); } }
I could not figure out for the life of me how something simple as that could fail. I DID have a SysCampaignRoot in the tblContent, tblWorkContent, tblContentLanguage and tblContentType tables. It did have the correct Guid (the same one as the variable CampaignFolder.CampaignRootGuid)
private static readonly Guid CampaignRootGuid = new Guid("48E4889F-926B-478C-9EAE-25AE12C4AEE2");
It also had the same GUID in the database.
I DID finally notice two weird issues though. First, it was called "CampaignRoot", not "SysCampaignRoot", so I renamed it directly in the database. Second and worst of all (probably the only problem), was that the fkLanguageBranch for these entries was "23", which corresponds to "ja-JP" on our site. I found that very weird, as all other system content entries like the trash and root folder had fkLanguageBranchID = 1 (en). (Which is disabled though, our main lang has ID 2, (en-GB)).
Anyways, I changed it. And now the database is repaired!
Here's the script that fixed it:
/* Step 1, find the correct fkContentID */ SELECT TOP 1000 [pkID] ,[fkContentTypeID] ,[fkParentID] ,[ArchiveContentGUID] ,[CreatorName] ,[ContentGUID] ,[VisibleInMenu] ,[Deleted] ,[ChildOrderRule] ,[PeerOrder] ,[ExternalFolderID] ,[ContentAssetsID] ,[ContentOwnerID] ,[DeletedBy] ,[DeletedDate] ,[fkMasterLanguageBranchID] ,[ContentPath] ,[ContentType] ,[IsLeafNode] FROM [PiabComTest_EPiServerDB].[dbo].[tblContent] WHERE ContentGUID = '48E4889F-926B-478C-9EAE-25AE12C4AEE2' /* Step 2, put in the correct fkContentID before running this */ /* Select * from tblWorkContent where fkContentID = 58231 update tblWorkContent set fkLanguageBranchID = 1 where fkContentId = 58231 select * from tblContentLanguage where fkContentId = 58231 update tblContentLanguage set fkLanguageBranchID = 1 where fkContentId = 58231 */
Could this issue have been related to your earlier version of the same script? I don't have the sources for it anymore. But I did have problems with the exact same script in an earlier update as posted here:
http://world.episerver.com/forum/developer-forum/-EPiServer-75-CMS/Thread-Container/2014/12/episerver-7.19-update-script-bug/
This has been solved in one of the more recent releases, can't tell which.
Could not load SysCampaignRoot from tblContent that should have ContentGUID '48E4889F-926B-478C-9EAE-25AE12C4AEE2'
I am now getting this error message when trying to access the EPiServer CMS UI. On our site it is located at /EPiServer/CMS. Apart from that the site seems to be working as it should. All my unit tests are now working after upgrading EPiServer.CMS.Core to 7.19.1 from 7.19.0.
This error message appears on both my local machine and on our development machine after trying to publish the upgrade there and after runing the cmdlet "update-epidatabase".
The only thing I changed was this:
* Upgrade EPiServer.CMS from 7.19.0 -> 7.19.1
* Upgrade EPiServer.UI from 7.18.0. -> 7.18.2
* Finding out that I did not have the mother/father package EPiServer.Commerce installed at all, installing it
* Upgrading EPiServer.Commerce.Core from 8.5.0 -> 8.6.1 (in the process of upgrading installing the entire EPiServer.Commerce mother/father package)
(EPiServer Commerce was set up and working even without the EPiServer.Commerce package before though). I can not be sure every single part was working perfectly though as we just installed before christmas for evaluation).
The full stack trace can be found here: http://pastebin.com/zuwqnMEV
For now I will have to restore the database to a backup and perform a downgrade. Is this a bug with the newer EPiServer Commerce. Or something wrong with our setup? Or is our database corrupt somehow?