SCSM 2012 Data Warehouse jobs keep failing

I often run into the same problem with the SCSM 2012 Data Warehouse, that the cubes jobs all fail. When resuming one of the jobs the following errors appear in the log:

Message : An Exception was encountered while trying during cube processing. Message= Processing warning encountered - Location: , Source: Microsoft SQL Server 2008 R2 Analysis Services Code: 1092550657, Description: Errors in the OLAP storage engine: The attribute key cannot be found when processing: Table: 'ConfigItemDim', Column: 'ConfigItemDimKey', Value: '13760'. The attribute is 'ConfigItemDimKey'..  

And / Or

Message : An Exception was encountered while trying during cube processing. Message= Processing warning encountered - Location: , Source: Microsoft SQL Server 2008 R2 Analysis Services Code: 1092550657, Description: Errors in the OLAP storage engine: The attribute key cannot be found when processing: Table: 'ProcessorDim', Column: 'ProcessorDimKey', Value: '156'. The attribute is 'ProcessorDimKey'..      

And / Or

Message : An Exception was encountered while trying during cube processing.  Message=  Processing error encountered - Location: , Source: Microsoft SQL Server 2008 R2 Analysis Services Code: -1055129595, Description: Server: The operation has been cancelled due to memory pressure..       Processing error encountered - Location: , Source: Microsoft SQL Server 2008 R2 Analysis Services Code: -1055129598, Description: Server: The operation has been cancelled.. 

When the cube processing is started, the Analysis service slowly consumes all available memory and does not stop until it cancels the process due to memory pressure.

Connecting to the server hosting the analysis service and looking at the properties of the cubes, shows that the cubes haven’t been processed and looking in SCSM all the jobs are set to failed:

Looking at the errors that are logged, they often relate to errors in the dimensions and their attributes. Reading the SCSM 2012 Administration guide, there is a script that processes all the dimensions in one step.

The script is not entirely correct, so I've changed it to:

  [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.AnalysisServices")

$Server = New-Object Microsoft.AnalysisServices.Server
$Server.Connect("serverdw.blog.com")
$Databases = $Server.Databases
$DWASDB = $Databases["DWASDataBase"]
$Dimensions = New-Object Microsoft.AnalysisServices.Dimension
$Dimensions = $DWASDB.Dimensions

foreach ($Dimension in $Dimensions){
    Write-host "Processing: " $Dimension
$Dimension.Process("ProcessFull")
}

Login to the server hosting the Analysis service and run the powershell script, just remember to change the $Server.Connect and the $DWASDB with the correct server (being the name of the SQL Server) and database name. It usually runs for 5-15 minutes. When complete, you can verify by looking at the properties at one of the dimensions:

After all the dimensions have been processed, you can start the cube processing from the SCSM console and they should all complete with success. Note that the jobs will change from Failed to Running to Not Started.

Instead look at the Cubes tab in the Data Warehouse wunderbar to see the status

 

But remember, this will just get the cubes processed once which is because it gets your cubes up to the latest set of data, but if the cube processing jobs starts failing again right away, it could because it is doing a full
processing job instead of a less resource demanding job like incremental.

The only way to fix this is to:

1)      Have a look at the HW and see if you could relocate DB-files, log files, temp etc. on more spindles / more VHD-files, add more processors or even RAM to help the SSAS with completing.

And/Or

2)      Upgrade to SQL Enterprise (Enterprise has the feature that allows for incremental processing instead of a full)