SCCM 1902 - Package Distribution Error
_wfopen_s() failed with error 2
Issue
When trying to distribute any content on SCCM to your Distribution Points. You may come across certain errors in your Distmgr.log pointing to the content folders in your DataLib folder
Other errors you will also see will be lines such as;
- RemoveDirectoryW failed (0x80070091)
- _wfopen_s() failed
- GetPrivateProfileStringW failed
Can sometimes be quite specific on any INI, INF or DLL files which then can have the following lines included
- Invalid Content definition (cannot get file time)
- Invalid Content definition (cannot get attributes)
- Invalid Content definition (cannot get file hash)
Workaround
After looking at the errors it looked to be complaining about very specific files within a package.
Not the actual package name itself, but all files within the content perhaps one or two were flagged.
It looks to be the actual character length of the overall path which goes over the "255" character mark.
I made a copy of the package and changed some of the files around as a test and this was able to distribute successfully.
Not sure if this is a fix which can be done on an OS level, but may cause an issue where packages may have files in much longer paths.
Ensure that 8dot3Name is also enabled on your SCCMContent location aswell to be on the safe side.



