Microsoft MVP성태의 닷넷 이야기
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 

공백 문자를 포함한 계정명의 권한으로 Visual Studio 확장을 설치할 때 오류 발생

문제는 PostSharp 확장 설치시에 발생했습니다. 설치를 시도했는데 다음과 같은 오류창이 뜹니다.

Could not start VsixInstaller.exe: The VSIX installer process failed with exit code -532462766.

이때 실행된 VsixInstaller.exe의 위치는 다음과 같습니다.

"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\VSIXInstaller.exe"

그런데, 이 실행 파일을 아무런 옵션없이 주고 실행해도 같은 오류가 이벤트 로그에 남는 것을 볼 수 있습니다. (정상적으로 실행되면, 인자가 없는 경우 옵션 목록을 보여주는 대화창이 뜹니다.)

Log Name:      Application
Source:        .NET Runtime
Date:          2015-09-20 오후 1:56:42
Event ID:      1026
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      themyth8
Description:
Application: VSIXInstaller.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.UnauthorizedAccessException
Stack:
   at System.IO.__Error.WinIOError(Int32, System.String)
   at System.IO.FileStream.Init(System.String, System.IO.FileMode, System.IO.FileAccess, Int32, Boolean, System.IO.FileShare, Int32, System.IO.FileOptions, SECURITY_ATTRIBUTES, System.String, Boolean, Boolean, Boolean)
   at System.IO.FileStream..ctor(System.String, System.IO.FileMode, System.IO.FileAccess)
   at VSIXInstaller.Logger..ctor(System.String)
   at VSIXInstaller.Logger.InitializeLogger(System.String)
   at VSIXInstaller.Logger.get_Instance()
   at VSIXInstaller.Logger.WriteLine(System.String)
   at VSIXInstaller.App.InitializationExceptionHandler(System.Exception)
   at VSIXInstaller.App.OnStartup(System.Windows.StartupEventArgs)
   at System.Windows.Application.<_ctor>b__0(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
   at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
   at System.Windows.Application.RunDispatcher(System.Object)
   at System.Windows.Application.RunInternal(System.Windows.Window)
   at System.Windows.Application.Run(System.Windows.Window)
   at VSIXInstaller.App.Main()

Log Name:      Application
Source:        Application Error
Date:          2015-09-20 오후 1:56:42
Event ID:      1000
Task Category: (100)
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      themyth8
Description:
Faulting application name: VSIXInstaller.exe, version: 14.0.23107.0, time stamp: 0x559b7195
Faulting module name: KERNELBASE.dll, version: 10.0.10240.16384, time stamp: 0x559f3b2a
Exception code: 0xe0434352
Fault offset: 0x000b3e28
Faulting process id: 0xb80
Faulting application start time: 0x01d0f429e8522947
Faulting application path: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\VSIXInstaller.exe
Faulting module path: C:\WINDOWS\SYSTEM32\KERNELBASE.dll
Report Id: 09c38720-4386-4336-8574-cd8f916faeaf
Faulting package full name: 
Faulting package-relative application ID: 

Log Name:      Application
Source:        Windows Error Reporting
Date:          2015-09-20 오후 1:56:43
Event ID:      1001
Task Category: None
Level:         Information
Keywords:      Classic
User:          N/A
Computer:      themyth8
Description:
Fault bucket 128890715620, type 5
Event Name: CLR20r3
Response: Not available
Cab Id: 0

Problem signature:
P1: VSIXInstaller.exe
P2: 14.0.23107.0
P3: 559b7195
P4: mscorlib
P5: 4.6.96.0
P6: 55b96801
P7: 157e
P8: 12e
P9: System.UnauthorizedAccess
P10: 

Attached files:
C:\Users\SeongTae Jeong\AppData\Local\Temp\WER3561.tmp.WERInternalMetadata.xml

These files may be available here:
C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_VSIXInstaller.ex_16b6a26652c63f7909bdeedb6fb447245df67a1_015e2318_3dd937f1

Analysis symbol: 
Rechecking for solution: 0
Report Id: 09c38720-4386-4336-8574-cd8f916faeaf
Report Status: 0
Hashed bucket: 004a03714de54520fe7923f537c088c3

오류를 보니, 그나마 다행인 것은 FileStream에서의 System.UnauthorizedAccessException로 확인됩니다. 따라서 Process Monitor를 통해 "ACCESS DENIED"가 난 지점을 쉽게 찾을 수 있는데요.

Operation: CreateFile
Path: C:\Users\Test%20User\AppData\Local\Temp\VSIXInstaller_1b5172ff-00f4-47fd-a74e-eaddf8dd8404.log

실제로 위의 log 파일을 포함한 폴더의 권한을 icacls로 확인해 봤더니 "Test User" 사용자 계정으로 실행한 exe에게는 쓰기 권한이 없었습니다.

C:\>icacls C:\Users\Test%20User\AppData\Local\Temp\
C:\Users\Test%20User\AppData\Local\Temp\ NT AUTHORITY\SYSTEM:(I)(OI)(CI)(F)
                                              BUILTIN\Administrators:(I)(OI)(CI)(F)
                                              BUILTIN\Users:(I)(RX)
                                              BUILTIN\Users:(I)(OI)(CI)(IO)(GR,GE)
                                              Everyone:(I)(RX)
                                              Everyone:(I)(OI)(CI)(IO)(GR,GE)

해결방법은 당연히, 해당 Temp 폴더에 "Users" 그룹이나 로그인 계정인 "Test User" 계정으로 쓰기 권한을 주면 됩니다. (사용자 임시 폴더이기 때문에 이 경우에는 "Test User" 계정에만 주는 것이 좋습니다.)




그런데, 이상한 점이 있습니다. 원래 해당 사용자 계정의 Temp 폴더인 "%LOCALAPPDATA%\Temp"로 탐색기를 이동해 보면 "C:\Users\Test User\AppData\Local\Temp"로 존재합니다. 게다가 권한도 주어져 있고.

C:\>icacls "%LOCALAPPDATA%\Temp"
C:\Users\Test User\AppData\Local\Temp NT AUTHORITY\SYSTEM:(OI)(CI)(F)
                                           BUILTIN\Administrators:(OI)(CI)(F)
                                           TESTPC\Test User:(OI)(CI)(F)

상황을 추측해 보면, VsixInstaller 실행 파일은 공백이 들어간 사용자 계정이 있는 경우 그것을 제대로 인식하지 않고 "%20"으로 대체한 것입니다. 결국 버그라는 이야기지요. ^^




참고로, 위와 같은 오류 상황에서 Xamarin을 설치하는 경우 다음과 같은 오류 메시지가 뜹니다.

An error has occurred

Errors have occurred.
Please attach the installation log if you contact Xamarin in about this error, thank you!

Installation of 'Xamarin' failed with more than one exception (attempt 3)
    Errors while installing items.
    Exception type: System.AggregateException
        Installation of archive '%LOCALAPPDATA%\Temp\Xamarin\downloads\NuGet.Tools.vsix' failed with exception.
        Exception type: Xamarin.Web.Installer.InstallException
        Full stack trace:
            at Xamarin.Web.Installer.Installer.InstallationArchiveHandler.Install(String path, Boolean needsPrivileges)
            at Xamarin.Web.Installer.Installer.BaseSoftwareItem.InstallDownloadedItem(String url, InstallationArchiveHandler handler, DownloadServiceWorkItem download)
            at Xamarin.Web.Installer.Installer.BaseSoftwareItem.Install(UInt32 tryNumber)
            at Xamarin.Web.Installer.Installer.XamarinVSSoftwareItem.Install(UInt32 tryNumber)
            at WindowsInstaller.ProgressPage.InstallationWorker()
        Installation of archive '%LOCALAPPDATA%\Temp\Xamarin\downloads\NuGet.Tools.vsix' failed with exception.
        Exception type: Xamarin.Web.Installer.InstallException
        Full stack trace:
            at Xamarin.Web.Installer.Installer.InstallationArchiveHandler.Install(String path, Boolean needsPrivileges)
            at Xamarin.Web.Installer.Installer.BaseSoftwareItem.InstallDownloadedItem(String url, InstallationArchiveHandler handler, DownloadServiceWorkItem download)
            at Xamarin.Web.Installer.Installer.BaseSoftwareItem.Install(UInt32 tryNumber)
            at Xamarin.Web.Installer.Installer.XamarinVSSoftwareItem.Install(UInt32 tryNumber)
            at WindowsInstaller.ProgressPage.InstallationWorker()
        Installation of archive '%LOCALAPPDATA%\Temp\Xamarin\downloads\NuGet.Tools.vsix' failed with exception.
        Exception type: Xamarin.Web.Installer.InstallException
        Full stack trace:
            at Xamarin.Web.Installer.Installer.InstallationArchiveHandler.Install(String path, Boolean needsPrivileges)
            at Xamarin.Web.Installer.Installer.BaseSoftwareItem.InstallDownloadedItem(String url, InstallationArchiveHandler handler, DownloadServiceWorkItem download)
            at Xamarin.Web.Installer.Installer.BaseSoftwareItem.Install(UInt32 tryNumber)
            at Xamarin.Web.Installer.Installer.XamarinVSSoftwareItem.Install(UInt32 tryNumber)
            at WindowsInstaller.ProgressPage.InstallationWorker()

위의 메시지를 출력한 창의 "View Installation log" 링크를 누르면 아래와 같은 정보가 나옵니다.

[2015-09-20 01:33:51.731] [Debug] Setting registry key 'SOFTWARE\Xamarin\AnalyticsAsked' to '1'
...[생략]...
[2015-09-20 01:34:10.435] [Debug] Using VSIX installer from C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\VSIXInstaller.exe
[2015-09-20 01:34:10.941] [Error] Failed to install the <USER_HOME>\Temp\Xamarin\downloads\NuGet.Tools.vsix archive. VSIX installer exited with error code 2003
[2015-09-20 01:34:10.945] [Info] Status: failed.
[2015-09-20 01:34:10.949] [Exception] Installation of software item 'Xamarin' failed with exception.
[2015-09-20 01:34:10.949] [Exception] Xamarin.Web.Installer.InstallException: Installation of archive '<USER_HOME>\Temp\Xamarin\downloads\NuGet.Tools.vsix' failed with exception. ---> System.InvalidOperationException: VSIX installation failed
[2015-09-20 01:34:10.949] [Exception] at Xamarin.Web.Installer.WindowsInstallationArchiveHandler.InstallVSIX(String file, Boolean needsPrivileges)
[2015-09-20 01:34:10.949] [Exception] at Xamarin.Web.Installer.Installer.InstallationArchiveHandler.Install(String path, Boolean needsPrivileges)
[2015-09-20 01:34:10.949] [Exception] --- End of inner exception stack trace ---
[2015-09-20 01:34:10.949] [Exception] at Xamarin.Web.Installer.Installer.InstallationArchiveHandler.Install(String path, Boolean needsPrivileges)
[2015-09-20 01:34:10.949] [Exception] at Xamarin.Web.Installer.Installer.BaseSoftwareItem.InstallDownloadedItem(String url, InstallationArchiveHandler handler, DownloadServiceWorkItem download)
[2015-09-20 01:34:10.949] [Exception] at Xamarin.Web.Installer.Installer.BaseSoftwareItem.Install(UInt32 tryNumber)
[2015-09-20 01:34:10.949] [Exception] at Xamarin.Web.Installer.Installer.XamarinVSSoftwareItem.Install(UInt32 tryNumber)
[2015-09-20 01:34:10.949] [Exception] at WindowsInstaller.ProgressPage.InstallationWorker()
[2015-09-20 01:34:10.953] [Info] Retrying installation (attempt #2, 1 to go)
[2015-09-20 01:34:10.961] [Debug] Will install Xamarin.iOS SDK
...[생략]...
[2015-09-20 01:34:13.903] [Debug] Considering VSIX installer from C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\VSIXInstaller.exe
[2015-09-20 01:34:13.907] [Debug] Using VSIX installer from C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\VSIXInstaller.exe
[2015-09-20 01:34:14.412] [Error] Failed to install the <USER_HOME>\Temp\Xamarin\downloads\NuGet.Tools.vsix archive. VSIX installer exited with error code 2003
[2015-09-20 01:34:14.416] [Info] Status: failed.
[2015-09-20 01:34:14.420] [Exception] Installation of software item 'Xamarin' failed with exception.
[2015-09-20 01:34:14.420] [Exception] Xamarin.Web.Installer.InstallException: Installation of archive '<USER_HOME>\Temp\Xamarin\downloads\NuGet.Tools.vsix' failed with exception. ---> System.InvalidOperationException: VSIX installation failed
[2015-09-20 01:34:14.420] [Exception] at Xamarin.Web.Installer.WindowsInstallationArchiveHandler.InstallVSIX(String file, Boolean needsPrivileges)
[2015-09-20 01:34:14.420] [Exception] at Xamarin.Web.Installer.Installer.InstallationArchiveHandler.Install(String path, Boolean needsPrivileges)
[2015-09-20 01:34:14.420] [Exception] --- End of inner exception stack trace ---
[2015-09-20 01:34:14.420] [Exception] at Xamarin.Web.Installer.Installer.InstallationArchiveHandler.Install(String path, Boolean needsPrivileges)
[2015-09-20 01:34:14.420] [Exception] at Xamarin.Web.Installer.Installer.BaseSoftwareItem.InstallDownloadedItem(String url, InstallationArchiveHandler handler, DownloadServiceWorkItem download)
[2015-09-20 01:34:14.420] [Exception] at Xamarin.Web.Installer.Installer.BaseSoftwareItem.Install(UInt32 tryNumber)
[2015-09-20 01:34:14.420] [Exception] at Xamarin.Web.Installer.Installer.XamarinVSSoftwareItem.Install(UInt32 tryNumber)
[2015-09-20 01:34:14.420] [Exception] at WindowsInstaller.ProgressPage.InstallationWorker()
...[생략]...
[2015-09-20 01:34:17.472] [Debug] Using VSIX installer from C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\VSIXInstaller.exe
[2015-09-20 01:34:17.878] [Error] Failed to install the <USER_HOME>\Temp\Xamarin\downloads\NuGet.Tools.vsix archive. VSIX installer exited with error code 2003
[2015-09-20 01:34:17.882] [Info] Status: failed.
[2015-09-20 01:34:17.886] [Exception] Installation of software item 'Xamarin' failed with exception.
[2015-09-20 01:34:17.886] [Exception] Xamarin.Web.Installer.InstallException: Installation of archive '<USER_HOME>\Temp\Xamarin\downloads\NuGet.Tools.vsix' failed with exception. ---> System.InvalidOperationException: VSIX installation failed
[2015-09-20 01:34:17.886] [Exception] at Xamarin.Web.Installer.WindowsInstallationArchiveHandler.InstallVSIX(String file, Boolean needsPrivileges)
[2015-09-20 01:34:17.886] [Exception] at Xamarin.Web.Installer.Installer.InstallationArchiveHandler.Install(String path, Boolean needsPrivileges)
[2015-09-20 01:34:17.886] [Exception] --- End of inner exception stack trace ---
[2015-09-20 01:34:17.886] [Exception] at Xamarin.Web.Installer.Installer.InstallationArchiveHandler.Install(String path, Boolean needsPrivileges)
[2015-09-20 01:34:17.886] [Exception] at Xamarin.Web.Installer.Installer.BaseSoftwareItem.InstallDownloadedItem(String url, InstallationArchiveHandler handler, DownloadServiceWorkItem download)
[2015-09-20 01:34:17.886] [Exception] at Xamarin.Web.Installer.Installer.BaseSoftwareItem.Install(UInt32 tryNumber)
[2015-09-20 01:34:17.886] [Exception] at Xamarin.Web.Installer.Installer.XamarinVSSoftwareItem.Install(UInt32 tryNumber)
[2015-09-20 01:34:17.886] [Exception] at WindowsInstaller.ProgressPage.InstallationWorker()
[2015-09-20 01:34:17.891] [Info] Status: failed.
[2015-09-20 01:34:17.895] [Debug] Showing manual installation window because of error
[2015-09-20 01:34:17.999] [Debug] Starting installation complete task.
[2015-09-20 01:34:18.003] [Info] Background installation worker completed.
[2015-09-20 01:34:18.007] [Info] Installation completed with failure
[2015-09-20 01:34:18.012] [Info] Status: failed.

로그 내용을 보면 VSIXInstaller.exe로 NuGet.Tools.vsix를 설치할 때 오류가 발생했다는 것인데, 원인은 이전과 마찬가지로 Temp 경로의 권한 문제입니다.




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]







[최초 등록일: ]
[최종 수정일: 9/21/2015]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




... [61]  62  63  64  65  66  67  68  69  70  71  72  73  74  75  ...
NoWriterDateCnt.TitleFile(s)
12098정성태1/2/202010918.NET Framework: 874. C# - 커널 구조체의 Offset 값을 하드 코딩하지 않고 사용하는 방법 [3]
12097정성태1/2/20209475디버깅 기술: 150. windbg - Wow64, x86, x64에서의 커널 구조체(예: TEB) 구조체 확인
12096정성태12/30/201911495디버깅 기술: 149. C# - DbgEng.dll을 이용한 간단한 디버거 제작 [1]
12095정성태12/27/201912793VC++: 135. C++ - string_view의 동작 방식
12094정성태12/26/201910979.NET Framework: 873. C# - 코드를 통해 PDB 심벌 파일 다운로드 방법
12093정성태12/26/201911043.NET Framework: 872. C# - 로딩된 Native DLL의 export 함수 목록 출력파일 다운로드1
12092정성태12/25/201910456디버깅 기술: 148. cdb.exe를 이용해 (ntdll.dll 등에 정의된) 커널 구조체 출력하는 방법
12091정성태12/25/201911961디버깅 기술: 147. pdb 파일을 다운로드하기 위한 symchk.exe 실행에 필요한 최소 파일 [1]
12090정성태12/24/201910572.NET Framework: 871. .NET AnyCPU로 빌드된 PE 헤더의 로딩 전/후 차이점 [1]파일 다운로드1
12089정성태12/23/201911333디버깅 기술: 146. gflags와 _CrtIsMemoryBlock을 이용한 Heap 메모리 손상 여부 체크
12088정성태12/23/201910294Linux: 28. Linux - 윈도우의 "Run as different user" 기능을 shell에서 실행하는 방법
12087정성태12/21/201910767디버깅 기술: 145. windbg/sos - Dictionary의 entries 배열 내용을 모두 덤프하는 방법 (do_hashtable.py) [1]
12086정성태12/20/201912792디버깅 기술: 144. windbg - Marshal.FreeHGlobal에서 발생한 덤프 분석 사례
12085정성태12/20/201910496오류 유형: 586. iisreset - The data is invalid. (2147942413, 8007000d) 오류 발생 - 두 번째 이야기 [1]
12084정성태12/19/201911157디버깅 기술: 143. windbg/sos - Hashtable의 buckets 배열 내용을 모두 덤프하는 방법 (do_hashtable.py) [1]
12083정성태12/17/201912432Linux: 27. linux - lldb를 이용한 .NET Core 응용 프로그램의 메모리 덤프 분석 방법 [2]
12082정성태12/17/201912233오류 유형: 585. lsof: WARNING: can't stat() fuse.gvfsd-fuse file system
12081정성태12/16/201913956개발 환경 구성: 465. 로컬 PC에서 개발 중인 ASP.NET Core 웹 응용 프로그램을 다른 PC에서도 접근하는 방법 [5]
12080정성태12/16/201911898.NET Framework: 870. C# - 프로세스의 모든 핸들을 열람
12079정성태12/13/201913077오류 유형: 584. 원격 데스크톱(rdp) 환경에서 다중 또는 고용량 파일 복사 시 "Unspecified error" 오류 발생
12078정성태12/13/201913083Linux: 26. .NET Core 응용 프로그램을 위한 메모리 덤프 방법 [3]
12077정성태12/13/201912570Linux: 25. 자주 실행할 명령어 또는 초기 환경을 "~/.bashrc" 파일에 등록
12076정성태12/12/201910793디버깅 기술: 142. Linux - lldb 환경에서 sos 확장 명령어를 이용한 닷넷 프로세스 디버깅 - 배포 방법에 따른 차이
12075정성태12/11/201911621디버깅 기술: 141. Linux - lldb 환경에서 sos 확장 명령어를 이용한 닷넷 프로세스 디버깅
12074정성태12/10/201911272디버깅 기술: 140. windbg/Visual Studio - 값이 변경된 경우를 위한 정지점(BP) 설정(Data Breakpoint)
12073정성태12/10/201913084Linux: 24. Linux/C# - 실행 파일이 아닌 스크립트 형식의 명령어를 Process.Start로 실행하는 방법
... [61]  62  63  64  65  66  67  68  69  70  71  72  73  74  75  ...