Can't run RunUnityPackageManagerDiagnostics. [ERROR] EISDIR

whenever I try and launch RunUnityPackageManagerDiagnostics.bat on Windows I get this output:

Unity Package Manager Diagnostics
Version 0.1.8

Failed to create report at ''.
An error occurred while running the diagnostic tool. See log for details (C:\Users\Chris\AppData\Local\Unity\Editor\upm-diag.log).

Press any key to continue . . .

[2021-01-25T21:28:45.800Z][ERROR] EISDIR: illegal operation on a directory, open ‘C:\Program Files\Unity\Hub\Editor\2020.1.14f1\Editor\Data\Resources\PackageManager\Diagnostics’
[2021-01-25T21:28:45.802Z][ERROR] EISDIR: illegal operation on a directory, open ‘C:\Program Files\Unity\Hub\Editor\2020.1.14f1\Editor\Data\Resources\PackageManager\Diagnostics’

Hi @CDF ,

That is strange indeed. Are you launching RunUnityPackageManagerDiagnostics.bat manually (e.g. from Windows Explorer or from a command prompt) or is it being launched by Unity (from the “Diagnose” button in an error dialog)?

For now, if you simply want to run the diagnostics, you can take a look at what the .bat script is doing; it’s a very simple script that launches the diagnostic app like so:

"<path-to-diagnostics-folder-in-unity-installation>\bin\UnityPackageManagerDiagnostics.exe" -o "<path-to-create-report>" -p "<path-to-upm-executable>"

You can run this command from a command prompt like cmd or PowerShell and replace the parts in angle brackets. Judging from the logs you provided, the paths would be something like this:

"C:\Program Files\Unity\Hub\Editor\2020.1.14f1\Editor\Data\Resources\PackageManager\Diagnostics\bin\UnityPackageManagerDiagnostics.exe" -o "<path-to-create-report>" -p "C:\Program Files\Unity\Hub\Editor\2020.1.14f1\Editor\Data\Resources\PackageManager\Server\UnityPackageManager.exe"

Let me know how you get on. If this works as expected then there may be something wrong with the .bat script on Windows and we’ll need to log a bug.

I get the same error. Can’t even run it to find out why my package manager always says I’m offline. So disappointing.

Hey, did you try manually launch the Diagnostic application as suggested in the post above? Do you get the same error?

I get the same error on ubuntu 20.04lts.
And I try:

./Unity/Hub/Editor/2019.4.24f1/Editor/Data/Resources/PackageManager/Diagnostics/bin/UnityPackageManagerDiagnostics -o ~/log.txt -p Unity/Hub/Editor/2019.4.24f1/Editor/Data/Resources/PackageManager/Server/UnityPackageManager

It’s work.
It appears that these two environment variables do not exist.
$UPM_DIAG_REPORT_PATH
$UPM_DIAG_UPM_PATH

Hi, sorry I missed this.
I’m running the .bat script directly in command line.
@NiQiuNiQiu is right, the “UPM_DIAG_REPORT_PATH” and “UPM_DIAG_UPM_PATH” variables don’t exist.
I made this batch script that does work for my purpose:

@echo off

set unityVersion=2021.1.12f1
set unityDiagPath="C:\Program Files\Unity\Hub\Editor\%unityVersion%\Editor\Data\Resources\PackageManager\Diagnostics\bin\UnityPackageManagerDiagnostics.exe"
set unityPackagePath="C:\Program Files\Unity\Hub\Editor\%unityVersion%\Editor\Data\Resources\PackageManager\Server\UnityPackageManager.exe"

echo Running Diagnostic
echo Unity Version: %unityVersion%

%unityDiagPath% -o "%~dp0\report.txt" -p %unityPackagePath%

set exit_code=%ERRORLEVEL%

echo.
pause

exit /b %exit_code%
3 Likes