Monday, December 4, 2017

Sitecore Fix Personalize Button is not Opening Personalization Dialog

Hi,

Have you ever encountered an issue where clicking "Personalize button" ain't doing nothing?

The solution is pretty simple, Just move the rendering down or up and save, it should work then.



Hope this help :)
.
.
.
.
.
.
.
.
.
On a serious note, somehow the rendering layout got missed up and  that will reset the layout of the item.

Sunday, December 3, 2017

Importing BACPAC(Azure) to Local SQL Server

Good day all,
To import a BACPAC file exported from Azure for example follow the following steps:

  • Make sure you have a compatible version of SQL database installed, in this example, the BACPAC file has been imported from Azure, and I have MS SQL Server 2017 installed, so they are compatible.
  • Open Microsoft SQL Server Management Studio, and login.
  • Righ click on "Databases" and select "Import Data-tier Application"
  • Click Next on "Introduction" screen.
  • Specify the BACPAC to import and click next.
  • Specify the settings for the new database information and click Next
  • Review the information and click Finish.


Errors that may occur while importing:

  • Error SQL72014: .Net SqlClient Data Provider: Msg 12824, Level 16, State 1, Line 5 The sp_configure value 'contained database authentication' must be set to 1 in order to alter a contained database. You may need to use RECONFIGURE to set the value_in_use .
    That means the SQL Instance level, you have contained databases disabled (ie contained database authentication is not set to 1) and then the script is trying to set containment to partial.

    You will need to set Contained database authentication to 1 by executing this statement on master database:

    EXEC sp_configure 'contained database authentication', 1
    RECONFIGURE

    More details are in the this blog
  • Error SQL72045: Script execution error. The executed script: IF EXISTS (SELECT 1 FROM [master].[dbo].[sysdatabases] WHERE [name] = N'$(DatabaseName)') BEGIN ALTER DATABASE [$(DatabaseName)] SET CONTAINMENT = PARTIAL WITH ROLLBACK IMMEDIATE; END Error SQL72014: .Net SqlClient Data Provider: Msg 5069, Level 16, State 1, Line 5 ALTER DATABASE statement failed. Error SQL72045: Script execution error. The executed script: IF EXISTS (SELECT 1 FROM [master].[dbo].[sysdatabases] WHERE [name] = N'$(DatabaseName)') BEGIN ALTER DATABASE [$(DatabaseName)] SET CONTAINMENT = PARTIAL WITH ROLLBACK IMMEDIATE; END (Microsoft.SqlServer.Dac)
    Issue should be solved similar to the previous one, or by solving the previous one and try to import the BACPAC file again
    EXEC sp_configure 'contained database authentication', 1
    RECONFIGURE

  • Internal Error. The database platform service with type Microsoft.Data.Tools.Schema.Sql.SqlAzureV12DatabaseSchemaProvider is not valid. You must make sure the service is loaded, or you must provide the full type name of a valid database platform service. (Microsoft.Data.Tools.Schema.Sql)

    That means your version of SQL Management Studio is not compatible, try updating it.
  • Could not import package.Warning SQL0: A project which specifies Microsoft Azure SQL Database v12 as the target platform may experience compatibility issues with SQL Server 2012.Warning SQL72012: The object [database] exists in the target, but it will not be dropped even though you selected the 'Generate drop statements for objects that are in the target database ut that are not in the source' check box.Warning SQL72012: The object [Log] exists in the target, but it will not be dropped even though you selected the 'Generate drop statements for objects that are in the target database but that are not in the source' check box.Error SQL72014: .Net SqlClient Data Provider: Msg 12824, Level 16, State 1, Line 5 The sp_configure value 'contained database authentication' must be set to 1 in order to alter a contained database.  You may need to use RECONFIGURE to set the value_in_use.Error SQL72045: Script execution error.  The executed script:IF EXISTS (SELECT 1           FROM   [master].[dbo].[sysdatabases]           WHERE  [name] = N'$(DatabaseName)')    BEGIN        ALTER DATABASE [$(DatabaseName)]            SET CONTAINMENT = PARTIAL             WITH ROLLBACK IMMEDIATE;    END

    Error SQL72014: .Net SqlClient Data Provider: Msg 5069, Level 16, State 1, Line 5 ALTER DATABASE statement failed.
    Error SQL72045: Script execution error.  The executed script:IF EXISTS (SELECT 1           FROM   [master].[dbo].[sysdatabases]           WHERE  [name] = N'$(DatabaseName)')    BEGIN        ALTER DATABASE [$(DatabaseName)]            SET CONTAINMENT = PARTIAL             WITH ROLLBACK IMMEDIATE;
        END


    That means your version of database is not compatible, ex: you are trying to import a BACPAC created on MS SQL Server 2017 into MS SQL Server 2012, one solution is to install MS SQL Server 2017 and do the import.

Hope that helps



Monday, May 1, 2017

Workaround to Minimize Laptop Overheating on Windows 10

I am using Windows 10 on MacBook Pro laptop, and I used to encounter an overheating problem, sometimes it becomes as hot as fire, to minimize that I've changed some values in power settings for the processor power management node wich obviously reduced the temperature, and extended the battery life markedly, with very little drop in the performance.



The settings are:

From power options in the control panel, change the plan settings for the selected plan, and change the advanced power settings, to match below:



Active system cooling policy means that windows will increase fan speed before attempting to slow the processor.

and for the value of maximum/minimum processor state, you can optimize to meet your requirements, in my case 65% on battery and 75% while plugged in was perfect serves my needs, and instead of having the CPU temperature 105C it is now around 58C.

- I am using Core Temp to measure the CPUs temperature.


Tuesday, April 11, 2017

Sitecore Habitat Hanging on 05-Sync-Unicorn

I was setting up Sitecore Habitat on my local environment, and while running the "default" gulp task, everything went smoothly except 05-Sync-Unicorn, it's hanging for ages, if you have the same issue follow the steps below:

  • Make sure MongoDB is running.
  • Make sure WFFM is installed.
  • Make sure to unblock following files in the code repository, you can do so by right click on each one of them and click on "Unblock":
    • Habitat-master\scripts\Unicorn\MicroCHAP.dll
    • Habitat-master\scripts\Unicorn\Sync.ps1
    • Habitat-master\scripts\Unicorn\Unicorn.psm1

  • If the task 05-Sync-Unicorn still hangs then 
    • Navigate to [Code Folder]\scripts\Unicorn\Sync.ps1 and comment out the line
      • $ErrorActionPreference = 'Stop' by adding # in the begining.
    • Navigate to [Code Folder]\scripts\Unicorn\Unicorn.psm1 and comment out the same line $ErrorActionPreference = 'Stop' by adding #.
    • Now run the step 05-Sync-Unicorn and you should start receiving actual errors that cause this step to hang, in my case I received this error
      • Could not load file or assembly 'file:///<Path>  Error: r\scripts\Unicorn\MicroCHAP.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded, And this was caused by PowerShell version, the installed version on my machine was V2 while the required version is V4 so I solved this issue by upgrading PowerShell to V4 (I installed Windows Management Framework 4.0) and the Sync unicorn task worked like a charm.
Hope that solved the issue at your end :).

Friday, March 31, 2017

Sitecore With Oracle

It is expected that Sitecore is supporting Oracle database as a part of cross-platform compatibility, but before you decide to use Oracle as a database for Sitecore, there are some areas you need to consider.

Sitecore Version Compatibility

Not all Sitecore's versions support Oracle database, have a look on this compatibility table to ensure that Sitecore version you are intending to use is supporting Oracle database


CMS
6.0
CMS
6.1
CMS
6.2
CMS
6.3
CMS
6.4
CMS
6.5
CMS
6.6
CMS
7.0
CMS
7.1
CMS
7.2
XP
7.5
XP
8.0
XP
8.1
XP
8.2
Oracle 12c
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Oracle 11g R2
[7]
-
-
-
[12]
Oracle 11g
[7]
-
-
-
-
-
-
Oracle 10g
-[8]
-
-
-
-
-
-
-
-

As you can see Sitecore 7.5, 8.0, and 8.1 are not supporting Oracle database, and until the moment of writing this blog Oracle database 12c is not supported yet.

Sitecore as CMS only

According to Sitecore installation guide: "The Oracle database storage setup is only available when Sitecore XP is running in Sitecore Experience Management mode (CMS-only mode), which lets you to run Sitecore XP without the Experience Database (xDB) enabled. Sitecore supports: 
 Oracle Database 11g R2 (11.2)"

Issues While Running Sitecore with Oracle DB

We faced multiple issues while connecting Sitecore to Oracle database, but with Sitecore support, and some of luck we managed to get over all of them, I felt it would be useful if I shared those issues with you, so here we go:

License Related Issues:

If you receive this error, it is most likely license related.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   System.Web.HttpResponse.End() +11948915
   System.Web.HttpResponse.Redirect(String url, Boolean endResponse, Boolean permanent) +472
   Sitecore.Nexus.Licensing.NexusLicenseApi.DemandModule(String moduleName) +401
   Sitecore.Data.Oracle.OracleDataApi..ctor(String connectionString) +38
   Sitecore.Data.Oracle.OracleLinkDatabase..ctor(String connectionString) +41


Is the License Supports Oracle

You need to check if the license you are using is supporting Oracle database, if not then you may receive the above error.

License does not exist in the correct location

If the license used is supporting Oracle database and you still receiving the above issue then most likely the license is missing, if you installed the instance using Sitecore web application installer  then the license file will be placed inside [web root]/[instance]/Data folder, while the config files are pointing to [web root]/[instance]/Website/data folder so you can either move the license to correct location or change the config to point to correct location.

Item Creation, and Package Installation Issues

After we fixed above problems, we had our instance up and running, we started our party. Suddenly one of our team members jumped off his chair and said: "Stop the celebration, we have another problem" he discovered that we still unable to create any item, as well as we were unable to install any package the error we were receiving is below, 

Sitecore Fix Personalize Button is not Opening Personalization Dialog

Hi, Have you ever encountered an issue where clicking "Personalize button" ain't doing nothing? The solution is pretty si...