ConfigMgr 2012: Upgrade to SP1 fails with "Arithmetic overflow error converting expression to data type int"


 

Hi Folks,

This post discusses about one of the upgrade issues that I worked on while Upgrading the ConfigMgr 2012 RTM to ConfigMgr 2012 SP1.

Upgrading to SP1 fails with the error below in the ConfigMgrSetup.log:


Arithmetic overflow error converting expression to data type int. : MDM_ExtractAppCIData Configuration Manager Setup 3/8/2013 8:00:25 PM 3532 (0x0DCC)


We know we are failing some where in the procedure MDM_ExtractAPPCIData in the section, after the function call to MDM_GetApplicability:

 
-- Upsert MDMDeploymentTypeProperties 
 
; with XMLNAMESPACES 
(N'http://schemas.microsoft.com/SystemCenterConfigurationManag
er/2009/AppMgmtDigest' 
as app, 
 
 
N'http://schemas.microsoft.com/SystemsCenterConfigurationManager/2009/06/14/Rules' 
as rul), 
 DTs as 
 
 (select [Application], DeploymentType, 
TechnologyType, ContentID, ContentSize, 
[Language], [Priority], 
InstallAction, DetectAction, MAX(MinimumOS) AS MinimumOS, OSApplicability from ( 
 
 select app.CIGUID as 
[Application], 
 
 
dt.CIGUID as DeploymentType, 
 
 
dtinfo.Technology as TechnologyType, ct.Conte
nt_UniqueID as ContentID, 
ct.SourceSize as ContentSize, 
 
 
dbo.MDM_GetLanguageRequirement( cir.ToCI_ID) as [Language], 
 
 
cir.ExtFlag as [Priority], 
 
 
convert(nvarchar(max), 
dt.SDMPackageDigest.query('/app:AppMgmtDige
st/app:DeploymentType/app:Installer/app:InstallAction')) 
as InstallAction , 
 
 
convert(nvarchar(max), 
dt.SDMPackageDigest.query('/app:AppMgmtDigest/app:DeploymentType/app:Installer/app:DetectAction')) 
as DetectAction , 
 
 
Val.query
('..').value('(/rul:Operands/rul:ConstantValue)[1]/@Value', 
'nvarchar(128)') as MinimumOS, 
 
 
dbo.MDM_GetApplicability(dt.CI_ID) as OSApplicability 
 
 from 
vSMS_ConfigurationItems app inner join 
 
 
CI_ConfigurationIte
mRelations cir on app.CI_ID=cir.FromCI_ID and 
cir.RelationType=9 inner join 
 
 
vSMS_ConfigurationItems dt on dt.CI_ID=cir.ToCI_ID inner join 
 
 
CI_ApplicationModelInfo dtinfo on dtinfo.CI_ID=cir.ToCI_ID left join 
 
 
 
 
CI_ConfigurationItemContents cic on cic.CI_ID=dtinfo.CI_ID left join 
 
 
CI_Contents ct on ct.Content_ID=cic.Content_ID 
 
 
outer apply 
dt.SDMPackageDigest.nodes('(/app:AppMgmtDigest/app:DeploymentType/app
:Requirements/rul:Rule/rul:Expression/rul:Operands/rul:GlobalSettingReference[@LogicalName="Device_MinOSVersion"])') 
as Ver(Val) 
 where app.IsLatest = 
1 and app.CI_ID=@AppCI_ID) as mdmdt 
 
group by [Application], DeploymentType, TechnologyTy
pe, ContentID, 
ContentSize, [Language], [Priority], InstallAction, DetectAction, 
OSApplicability 
 ), TargetDTs as 
 
 ( 
 
 select dt.* from 
MDMDeploymentTypeProperties dt inner join 
 
 
vSMS_ConfigurationItems app 
on dt.[Application] = app.CIGUID 
 
 where app.CI_ID = @AppCI_ID 
 
 ) 
 MERGE 
TargetDTs AS TARGET 
 USING (select * from DTs 
) AS SOURCE 
 ON 
TARGET.[Application]=SOURCE.[Application] and TARGET.[TechnologyType] = 
SOURCE.[Technolo
gyType] AND TARGET.DeploymentType=SOURCE.DeploymentType 
 
 WHEN NOT MATCHED BY TARGET THEN 
 
 INSERT ([Application], 
DeploymentType, TechnologyType, ContentID, ContentSize, [Language], 
InstallAction, DetectAction, OSApplicability, [Priority], M
inimumOS) 
 
 VALUES ([Application], 
DeploymentType, TechnologyType, ContentID, ContentSize, [Language], 
InstallAction, DetectAction, OSApplicability, [Priority], MinimumOS) 
 
 WHEN NOT MATCHED BY SOURCE THEN 
 
 DELETE 
 
 WHEN MATCHED
THEN 
 
 UPDATE SET 
TARGET.ContentID=Source.ContentID, 
 
 
TARGET.ContentSize=SOURCE.ContentSize, 
 
 
TARGET.[Language]=SOURCE.[Language], 
 
 
TARGET.InstallAction=SOURCE.InstallAction, 
 
 
 
 
TARGET.DetectAction=SOURCE.DetectAction, 
 
 
TARGET.OSApplicability=SOURCE.OSApplicability, 
 
 
TARGET.[Priority]=SOURCE.[Priority], 
 
 
TARGET.MinimumOS=SOURCE.MinimumOS

So, from looking at this I am suspecting it is the insert and after looking at the table MDMDeploymentTypeProperties I think it is due to the insert.
Took the query:

 
select dt.* from MDMDeploymentTypeProperties dt inner 
joinvSMS_ConfigurationItems app 
on dt.[Application] = 
app.CIGUID 
 where app.CI_ID 
= @AppCI_ID 

Loaded all the CI_ID into a table and ran them through the call to the procedure but it did not fail. Used that list for the CIs from the CI_ConfigurationItems table to call the procedure and found the CI_ID that failed. We then found in the CI_Contents table, the source size for one row was larger than an int (2147483647)

Used the query:

select * from CI_Contents where 
sourcesize > 2147483647

Got more details of the CI and found the application corresponding to it:

For the CI, we were able to find the content and deleted it:

 
select * From CI_ConfigurationItemContents where Content_ID in 
(select * from CI_Contents where sourcesize > 2147483647)
select * from 
CI_contentpackages where Content_ID in (select * from CI_Contents where 
sourcesize > 2147483647)

We then removed the application from the Distribution Point (DP) and then verified that we did not have any records which exceeded the value.

We then ran the upgrade again and it succeeded.

 

Hope it helps !!

Umair Khan

Support Escalation Engineer | Microsoft System Center ConfigMgr 

Note: Please do not make any changes in the ConfigMgr database until recommended by a Microsoft Support Professional.

 

Disclaimer:
This posting is provided "AS IS" with no warranties and confers no rights.

 

Comments (0)

Skip to main content