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.

 

DETECTION

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.
 
hashdir

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'

 

CORRECTION

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
begin
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
end


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.

 

NOTES

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.

Comments

  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!

    ReplyDelete

Post a Comment

Popular posts from this blog

using preloadpkgonsite.exe to stage compressed copies to child site distribution points

UPDATE: john marcum sent me a kind email to let me know about a problem he ran into with preloadpkgonsite.exe in the new SCCM Toolkit V2 where under certain conditions, packages will not uncompress.  if you are using the v2 toolkit, PLEASE read this blog post before proceeding.   here’s a scenario that came up on the mssms@lists.myitforum.com mailing list. when confronted with a situation of large packages and wan links, it’s generally best to get the data to the other location without going over the wire. in this case, 75gb. :/ the “how” you get the files there is really not the most important thing to worry about. once they’re there and moved to the appropriate location, preloadpkgonsite.exe is required to install the compressed source files. once done, a status message goes back to the parent server which should stop the upstream server from copying the package source files over the wan to the child site. anyway, if it’s a relatively small amount of packages, you can

How to Identify Applications Using Your Domain Controller

Problem Everyone has been through it. We've all had to retire or replace a domain controller at some point in our checkered collective experiences. While AD provides very intelligent high availability, some applications are just plain dumb. They do not observe site awareness or participate in locating a domain controller. All they want is the name or IP of one domain controller which gets hardcoded in a configuration file somewhere, deeply embedded in some file folder or setting that you are never going to find. How do you look at a DC and decide which applications might be doing it? Packet trace? Logs? Shut it down and wait for screaming? It seems very tedious and nearly impossible. Potential Solution Obviously I wouldn't even bother posting this if I hadn't run across something interesting. :) I ran across something in draftcalled Domain Controller Isolation. Since it's in draft, I don't know that it's published yet. HOWEVER, the concept is based off