question

AndrewJBuehler-1624 avatar image
0 Votes"
AndrewJBuehler-1624 asked TeemoTang-MSFT commented

SetupDiag exits immediately, with no output file

In attempting to troubleshoot upgrades from Windows 10 1809 to 1909 which don't even get as far as a reboot being triggered, I am seeing SetupDiag behave oddly, in a way that leaves it useless. So far I have not found any mention of anyone else encountering the same problem.

When I run SetupDiag without the '/" switch, it prints the expected output up through "Searching for setup logs...", then exits; this takes less than a second. The 'SetupDiagResults.log' file is not created. The files 'SetupDiag.exe.config' and 'SetupDiag_DD-Mon-YYYY.log' do get created, but the former has no obviously useful information and the latter is empty (0 bytes).

If I run it with the '/verbose' switch, the latter file gets a few hundred bytes of content, consisting mostly of function-call names. The final line printed reads 'HH-MM-SS - SetupDiag: Enter CSetupDiag.FindParseLatestSetupLogs().' I have found no useful references to this online thus far.

These things happen both with the default options, and when I specify '/LogsPath' and/or '/Output' explicitly. In neither case does the '/Output' file get created. Thus far, they have happened on every 1809 computer I've tried in our environment, whether known to be exhibiting the upgrade failure or not. I am not sure whether I've yet tried this on 1909, or any other Win10 version besides 1809; it would be of limited usefulness there, because we need to assess the 1809 upgrade failure, but we could at least probably do that via '/LogsPath' if it does work there at all.

I can't file a report about this via Feedback Hub, because we lock down telemetry via Group Policy far enough that Feedback Hub refuses to operate.

I've re-downloaded the latest SetupDiag.exe (1.6.0.42), and verified that it is binary identical to the one with which I've been seeing these results.

I've searched through the logs of our antivirus product (McAfee Endpoint Security), and although it's definitely noticing that the program is being run, none of the references show any sign of anything being blocked.

I'm not sure whether this is a bug in SetupDiag, or a problem with the logs it's trying to search for / through, or whether somehow the configuration we have in place on the overall system is causing the program to misbehave (although that latter would probably itself represent a SetupDiag bug, since to the best of my knowledge all the potentially-relevant configuration in place is a combination of things documented and supported by Microsoft).

Any ideas of what might be causing this, how to resolve it, and/or where I can go from here?

(Advice on the original root problem, of the failing in-place upgrades, wouldn't hurt either - but it's not what I'm focusing on here.)

This looks like a clear case for tagging as 'SetupDiag', and none of the tags I'm finding in the available list seem suitable, but it won't let me post this without a tag so I've picked one that's at least related to the underlying problem I was trying to solve even if it's not related to the problem I'm asking about.

windows-10-setup
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

TeemoTang-MSFT avatar image
0 Votes"
TeemoTang-MSFT answered TeemoTang-MSFT commented

Make sure your system meets the requirements of SetupDiag. If needed, install the .NET framework 4.6.
Disable your McAfee temporarily and Clean boot computer
Change the directory of SetupDiag.exe, I saved it on C:\Users\teemo\Downloads
Run SetupDiag.exe as administrator.
Because all of my clients had been upgrade to 2004 and 20H2, I don’t know the performance of SetupDiag on 1809, but this tool works fine on 2004 and 20H2.


If the Answer is helpful, please click "Accept Answer" and upvote it.
Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 10
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I had somehow managed to miss noticing that requirements list, but I believe it passes. On one of the computers where I've observed the behavior, the .NET Framework version appears to be 4.7.2.

As I have already indicated, there is no indication that ENS is blocking anything. That means that, even if it is somehow the cause after all, there is no action we could take to cause it to stop blocking this in general; we are certainly not going to disable ENS entirely over this single issue. I will test disabling it anyway, but I do not expect that to change anything.

I don't know what you mean by "Clean boot computer". At least one of the computers involved has exhibited the same behavior across multiple reboots.

The program was run from different directories on the different computers.

It has been run as the local Administrator account in all cases.

Any other suggestions for how to track down what's going wrong here?

0 Votes 0 ·

How to perform a clean boot in Windows (microsoft.com)
https://support.microsoft.com/en-us/topic/how-to-perform-a-clean-boot-in-windows-da2f9573-6eec-00ad-2f8a-a97a1807f3dd
Run as administrator means right-click SetupDiag and select Run as administrator.

In my opinion, you could use 1909 ISO in-place upgrade current system directly.

0 Votes 0 ·

I'm trying to reply, but clicking Submit just changes the color of the button for a second and then goes back to the way it was. If nothing else works, I'll try replying as a separate comment, and if that fails try doing it as an "answer" to the original question (even though that's not what I'm providing).

0 Votes 0 ·
Show more comments

I'll try the clean-boot thing next time I have a chance (I'm alternating between remote and on-site these days), but I don't expect it to make a difference.

0 Votes 0 ·

Yes, I know what "run as administrator" means. In my experience, running CMD as Administrator with 'runas /user:administrator cmd' and then running a program from the resulting window gives exactly the same result as running that program by right-clicking and using "Run as administrator" - except that using the Administrator CMD window lets me see what the program printed to the console, whereas using right-click etc. does not do that.

Since part of what SetupDiag does is print output to the console, it's important to be able to see that output as the program runs, so using the right-click method is not viable.

If you really insist, I could put together a batch file which would run SetupDiag and then pause, and run that via the right-click menu - but I really think that'd be a waste of time and effort.

0 Votes 0 ·

I don't see how upgrading from the 1909 ISO / install media would help. The upgrade method I'm trying is to copy the 1909 ISO's contents to a network location, then use our software-deployment solution product (not MECM; we have that, but there are reasons we're not using it for this yet) to install from that location with appropriate local-machine and network-access credentials.

AFAICT that should be exactly the same behaviors as upgrading from the ISO, or from install media created from the ISO. Unless you mean to boot to the install media before upgrading; that would probably work, but would not be viable for upgrading thousands of computers, as we need to do.

I've seen successful upgrades using this method (and this exact network-location copy of the install files) in the past, but currently it's failing, and I'm trying to diagnose why.

0 Votes 0 ·

I have just done a clean install of Windows 10 20H2 (which, per the docs, includes netfx48 built-in; I have verified that it is there), copied in the log files directory from a failed 1809-to-1909 upgrade and a copy of SetupDiag.exe, and tried to run the latter. (As Administrator, with no other user account enabled.)

Even when I run specifically just 'SetupDiag.exe /verbose', without specifying e.g. the /LogsPath switch, I get the same failure: it exits immediately following "Searching for log files", and the resulting log file ends after the FindParseLatestSetupLogs() line.

0 Votes 0 ·

(This should have gone in the above reply, but again the Submit button wouldn't work when I tried that.)

The only possible place that I can see for us to be applying any customizations which might break this is in our autounattend XML file, and speaking as the person who created that file I do not believe it contains anything which should be remotely relevant to SetupDiag being able to run.

Any suggestions on how I can figure out why this program is failing to run usefully at all in even this clean environment?

0 Votes 0 ·
Show more comments