Skip to main content

sccm: content hash fails to match

back in 2008, I wrote up a little thing about how distribution manager fails to send a package to a distribution point. even though a lot of what I wrote that for was the failure of packages to get delivered to child sites, the result was pretty much the same. when the client tries to run the advertisement with an old package, the result was a failure because of content mismatch.

I went through an ordeal recently capturing these exact kinds of failures and corrected quite a number of problems with these packages. the resulting blog post is my effort to capture how these problems were resolved. if nothing else, it's a basic checklist of things you can use.



status messages

take a look at your status messages. this has to be the easiest way to determine where these problems exist. unfortunately, it requires that a client is already experiencing problems. there are client logs you can examine as well such as cas, but I wasn't even sure I was going to have enough material to blog so I didn't bother to capture the exact errors. :/ anyway, here are the specific elements:

type: error
component: software distribution
message id: 10057
detail: The program for advertisement "<advertisement id>" has failed because download of the content "<package id> - "<program name>" has failed. The download failed because the content downloaded to the client does not match the content specified in the content source. Possible causes: The content on the distribution point has been manually modified, or a local administrator on the computer has modified the content in the computer's hash. Solution: Refresh the content on the distribution point and retry the download.

and one more...
type: error
component: software distribution content access
message id: 10030
detail: Download of the content "<package id>" - "4" has failed. The download failed because the content downloaded to the client does not match the content specified in the source. Possible causes: The content on the distribution point has been manually modified, or a local administrator on the computer has modified the content in the computer's hash. Solution: Refresh the content on the distribution point and retry the download.

ah, the elusive tool known as hashdir.exe. this tool analyzes a directory and returns the hash value. I used this to analyze the source directory and checked against a child site to determine if the hash result was properly returned. this is the usage info:

Usage: HashDir DirectoryName HashVersion [/FileList]
Example: HashDir d:\smspkgd$\FS100003 2
HashVersion: RTM = 1 and SP1 = 2

I assume anyone reading this post is on configmgr 2007 sp1 or greater, in which case, you want to use the value of 2 as shown in the example. by checking the source directory against a smspkg directory, you can get a very good sense of whether or not your files are out of sync. if you need hashdir, click HERE.

sql query

if you refer to the post I mentioned at the beginning of this one, you'll find a sql query that will (hopefully) enumerate where problems may exist. I referenced the dx21 method, but in truth, as it turns out after much later discovery, I should have credited the genius steve rachui.

SELECT * FROM PkgStatus WHERE Type=1 AND Status=1 AND ID='XYZ00234'



hidden files

I wasn't aware that this could occur but there are enough posts that seem to indicate that hidden files will cause the hash to potentially mismatch. make sure you examine your source files to ensure they are not set with a hidden flag.

binary delta replication

sometimes this setting doesn't seem to play well with certain files. one quick remediation would be to turn this off and then update the package.

remove the pck file

at the child site, if you manually delete the pck file, the child site will have no choice but to bring down the pck file at the parent site. it's okay if you have ONE child site but loses its fun factor when you multiply it by a number of systems. for this reason, I do not recommend this... but alas it works.

modify pkgstatus and sourceversion in pkgstatus table

I mentioned that earlier post a couple of times. there's a sql query in there that will update the required fields for a package server. don't bother trying to set the value against a lot of different servers at once because it will fail. :) I don't know how I know this. I just do. trust me. so what do you do? well, I wrote this sql query that I kind of borrowed the guts out of from a post about opalis. it's a while loop that will go through a list of servers. it's kind of cool.

declare @str_objname sysname,
@str_execsql nvarchar(256),
@str_packageid nvarchar(10)

set     @str_packageid = '<package id here>'

declare cur_SCCMDPs cursor for
SELECT PkgServer FROM PkgStatus WHERE ID=''+@str_packageid+'' AND TYPE=1

open cur_sccmdps

fetch cur_sccmdps into @str_objname

while @@FETCH_STATUS = 0
set @str_execsql = 'WAITFOR DELAY ''00:00:02'' update PkgStatus set Status=2, SourceVersion=0 where ID= '''+@str_packageid+''' and Type=1 and PkgServer = '''+@str_objname+''''
print @str_execsql
exec sp_executesql @statement = @str_execsql
fetch cur_sccmdps into @str_objname

deallocate cur_sccmdps

there's a wait delay on it so that while it's updating the records for each row, it'll have a chance to process it. I don't know if it's required but seemed like a good idea.



it's critical to understand when to update versus refresh a package. if you make source file changes, you should be updating the package as refreshing will only refresh the contents to distribution points from the existing compressed files (.pck). refreshing is really only useful when you need to "repair" a distribution point. you'll notice that only updating will increment the package source version. more details are in this technet article.

another import thing to understand is what happens when you change a package from using compressed copy to source folder or vice versa. while the distribution points at the parent site will update, the child sites will not. this will most certainly cause a hash mismatch problem. any change like this requires that you update the distribution points. it's detailed in this technet article.

finally, if you are interested in what sccm is telling the world is the hash of the source, you can run this sql query to return the results of a package:

select PkgID, Name, Hash, NewHash from SMSPackages where PkgID = '<packageid>'


don't forget to TEST, TEST, TEST. what works for me may not work for you.


  1. This is something new to me in my area of expertise and I'm able to say this blog helped me out today. Thanks MO!


Post a Comment

Popular posts from this blog

how to retrieve your ip address with powershell...

update: this is how it’s performed in powershell v3 as demonstrated here.(get-netadapter | get-netipaddress | ? addressfamily -eq'IPv4').ipaddress update: this is by far the easiest.PS C:\temp> (gwmi Win32_NetworkAdapterConfiguration | ? { $_.IPAddress -ne $null }).ipaddress
are you laughing yet?  i know you probably find this topic amusing.  it's really interesting though.  whenever you get over it, i'll do this in the standard cmd.exe interpreter and then in powershell to show you what kind of coolness powershell does.done?  okay, good.  this is an interpretation of a demo that bob wells did at our smug meeting.  hope you like it.i should tell you, it's not as simple as the title would lead you to believe.  i like doing that little slight-of-hand thing since it gives the impression that i'm painting a very easy target on my back for your criticism (though it's probably true in other ways)!  the idea is that we want to retrieve just the ip ad…

understanding the “ad op master is inconsistent” alert

i use the term “understanding” loosely.  this is by far no definitive guide on this particular alert, just a few things i have picked up in my attempt to understand it.let’s look at the context of the alert:The Domain Controller's Op Master is inconsitent. See additional alerts for details.
first of all, it gives very little information.  the only particularly useful detail is that it indicates which server is having the issue.  other than that, just a spelling error as there are no additional critical alerts to look at for details.this rule, as you know, comes from a sealed mp.  therefore, we can’t modify anything in it except the overrides.  the couple i’ve tinkered with are:interval (sec) log success event to begin with, interval (sec) is just set way too high.  the default is 60 seconds.  why on earth would anyone want to know that your op master consistency may be off, every minute?  actually, i could think of a few reasons, but really, it’s overkill.  the way the script works…