codaamok / PoSH

A collection of PowerShell scripts I've written.
MIT License
24 stars 6 forks source link

SQL Auto download isn't working #5

Closed Eaglehawk48 closed 4 years ago

Eaglehawk48 commented 4 years ago

Without the SQLServer2017-x64-ENU.iso file in the ISO directory, the script attempts to download the ISO using SQLServer2017-SSEI-Eval.exe with some switches to target the ISO download attempt.

I get this result:

SQL Fail 3

Instead, I just download the ISO using https://download.microsoft.com/download/E/F/2/EF23C21D-7860-4F05-88CE-39AA114B014B/SQLServer2017-x64-ENU.iso which seems to work.

Eaglehawk48 commented 4 years ago

Since I'm on an SQL rampage, here's the error I get when I use "-SQLServer2017ISO C:\LabSources\ISOs\en_sql_server_2017_standard_x64_dvd_11294407.iso" when I run it with CM-1902.ps1.

SQL Fail 2

This is where my abilities to read scripts starts to fail :D

codaamok commented 4 years ago

Hey. So, it works for me. Perhaps try double clicking SQLServer2017-SSEI-Eval.exe (it will be in LabSources\SoftwarePackages folder) and initiate the download via the GUI, maybe you'll get a useful error message. Maybe it's firewall or proxy related?

You could try downloading it manually using the same arguments I do in CMD:

SQLServer2017-SSEI-Eval.exe /ACTION=Download /MEDIATYPE=ISO /MEDIAPATH="C:\path\to\some\folder" /QUIET
Eaglehawk48 commented 4 years ago

Run is via the GUI, it works fine.

Run the above command, and I get this:

C:\Users\Tester\Downloads>SQLServer2017-SSEI-Eval.exe /ACTION=Download /MEDIATYPE=ISO /MEDIAPATH="C:\Users\Tester\Downloads" /QUIET

C:\Users\Tester\Downloads> Unhandled Exception: System.ArgumentNullException: String reference not set to an instance of a String. at System.Reflection.RuntimeAssembly.GetResource(RuntimeAssembly assembly, String resourceName, UInt64& length, StackCrawlMarkHandle stackMark, Boolean skipSecurityCheck) at System.Reflection.RuntimeAssembly.GetManifestResourceStream(String name, StackCrawlMark& stackMark, Boolean skipSecurityCheck) at System.Reflection.RuntimeAssembly.GetManifestResourceStream(String name) at Microsoft.Sql.Installer.Engine.ManifestCache.GetManifestFromResource(String resourceName) at Microsoft.Sql.Installer.Engine.ManifestCache.InitializeDownloadManifest(String edition) at Microsoft.Sql.Installer.Engine.ManifestCache.Initialize(String edition, Boolean skipBootstrapInitialization) at Microsoft.Sql.Installer.UI.SSEIBusinessLogic.Initialize(String edition) at Microsoft.Sql.Installer.UI.App.AppInitialize(String[] args, String edition) at Microsoft.Sql.Installer.UI.App.App_OnStartup(Object sender, StartupEventArgs e) at System.Windows.Application.OnStartup(StartupEventArgs e) at System.Windows.Application.<.ctor>b__1_0(Object unused) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Application.RunDispatcher(Object ignore) at System.Windows.Application.RunInternal(Window window) at Microsoft.Sql.Installer.UI.App.Main()

codaamok commented 4 years ago

What's your Windows version and what .NET frameworks do you have installed?

Some Googling lead me to this: https://feedback.azure.com/forums/908035-sql-server/suggestions/36869380-unhandled-exception-in-unattended-sql-server-2017

Eaglehawk48 commented 4 years ago

It's a fresh Windows 10 1909 build. Nothing added besides what you've stated in your blogs and steps. think the .NET Framework from memory when I last checked the registry was 4.8.03752. If this is causing issues, maybe switch to that direct ISO url above?

codaamok commented 4 years ago

OK I just committed an update which uses the link to the ISO you gave. I didn't see what you experienced in your last screenshot though, weird.

codaamok commented 4 years ago

Closing :-)