Bug 22080 - Exceptions thrown by mtbserver are incomplete in "Mac Server Log"
Summary: Exceptions thrown by mtbserver are incomplete in "Mac Server Log"
Status: RESOLVED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 3.3
Hardware: PC Mac OS
: Normal normal
Target Milestone: 4.0.0 (C6)
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-08-13 16:53 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2015-09-30 10:08 UTC (History)
7 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
mtbserver.log (18.69 KB, application/octet-stream)
2014-08-13 16:53 UTC, Brendan Zagaeski (Xamarin Team, assistant)
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Brendan Zagaeski (Xamarin Team, assistant) 2014-08-13 16:53:15 UTC
Created attachment 7682 [details]
mtbserver.log

Exceptions thrown by mtbserver are incomplete in the "Mac Server Log".

This is "sort of" a regression because Xamarin.iOS 3.0.54 + Xamarin.iOS 7.2.3.39 produces a more helpful stack trace than Xamarin.iOS 3.3.47 + Xamarin.iOS 7.2.6.28. On the other hand, Xamarin.iOS 3.0.54 + Xamarin.iOS 7.2.3.39 is reporting a _different_ stack trace (one that does not appear in the `mtbserver.log` file).



## Steps to reproduce

1. Delete the `~/Library/Developer/MonoTouch` folder on the Mac build host.


2. Create a _file_ to replace the deleted directory so that mtbserver will throw an exception when it tries to perform an SDK sync.

touch ~/Library/Developer/MonoTouch 


3. Open a Xamarin.iOS project in Visual Studio to pair to the build host.


4. Select "Tools -> Options -> Xamarin -> iOS Settings -> SDK Synchronization -> Check Now".



## Incomplete stack trace from `devenv*.log` 

With Xamarin 3.3.47 + Xamarin.iOS 7.2.6.28
Or with Xamarin 3.1.228 + Xamarin.iOS 7.2.5.5


> Xamarin.VisualStudio.IOS.MonoTouchPackage Information: 0 : [2014-08-13 16:22:00.9] [13-Aug-2014 16:22:00] Command [ListDevices: CommmandUrl=ListDevices] finished (11)
> Xamarin.VisualStudio.IOS.Utilities.Helpers Error: 0 : [2014-08-13 16:22:13.1] Exception caught.
> Xamarin.VisualStudio.IOS.Utilities.Helpers Error: 0 : [2014-08-13 16:22:13.2] Server returned an error. The remote server returned an error: (500) Internal Server Error.
> Server error code: 500
> Internal Server Error
> 
> 
> Xamarin.VisualStudio.IOS.MonoTouchPackage Information: 0 : [2014-08-13 16:22:13.5] ouch.Tools.Utilities.FilesHub..ctor (Boolean load) [0x00000] in <filename unknown>:0 
> Xamarin.VisualStudio.IOS.MonoTouchPackage Information: 0 : [2014-08-13 16:22:13.6]   at Mtb.Server.Commands.StatusSdk.HandleRequest (ILoggingHelper logger, System.Object commandRequestState) [0x00000] in <filename unknown>:0 
> Xamarin.VisualStudio.IOS.MonoTouchPackage Information: 0 : [2014-08-13 16:22:13.8]   at Mtb.Server.BaseCommand.OnRequest (System.Net.HttpListenerContext context, System.Object commandRequestState) [0x00000] in <filename unknown>:0 
> Xamarin.VisualStudio.IOS.MonoTouchPackage Information: 0 : [2014-08-13 16:22:13.9]   at Mtb.Server.Listener.OnRequest (System.Object state) [0x00000] in <filename unknown>:0 
> Xamarin.VisualStudio.IOS.Utilities.ErrorReportManager Error: 0 : [2014-08-13 16:22:14.1] Xamarin.iOS encountered the following error(s):



## "Complete" stack trace from `devenv*.log`

With Xamarin 3.0.54 + Xamarin.iOS 7.2.3.39.

Note that this IOException differs from the IOException that appears in `~/Library/Logs/Xamarin/MonoTouchVS/mtbserver.log` at the corresponding time (`mtbserver.log` attached).


> Xamarin.VisualStudio.IOS.MonoTouchPackage Information: 0 : [2014-08-13 15:48:43.7] [2014-08-13 19:48:43.5] Unhandled Exception:
> 
> Xamarin.VisualStudio.IOS.MonoTouchPackage Information: 0 : [2014-08-13 15:48:43.9] [2014-08-13 19:48:43.5] System.IO.IOException: Cannot create /Users/macuser/Library/Developer/MonoTouch because a file with the same name already exists.
> 
> Xamarin.VisualStudio.IOS.MonoTouchPackage Information: 0 : [2014-08-13 15:48:44.2] [2014-08-13 19:48:43.5]   at System.IO.Directory.CreateDirectory (System.String path) [0x00000] in <filename unknown>:0 
> 
> Xamarin.VisualStudio.IOS.MonoTouchPackage Information: 0 : [2014-08-13 15:48:44.3] [2014-08-13 19:48:43.5]   at MDocArchiveToMsxDocConverter.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 
> 
> Xamarin.VisualStudio.IOS.MonoTouchPackage Information: 0 : [2014-08-13 15:48:44.5] [2014-08-13 19:48:43.6] [ERROR] FATAL UNHANDLED EXCEPTION: System.IO.IOException: Cannot create /Users/macuser/Library/Developer/MonoTouch because a file with the same name already exists.
> 
> Xamarin.VisualStudio.IOS.MonoTouchPackage Information: 0 : [2014-08-13 15:48:44.6] [2014-08-13 19:48:43.6]   at System.IO.Directory.CreateDirectory (System.String path) [0x00000] in <filename unknown>:0 
> 
> Xamarin.VisualStudio.IOS.MonoTouchPackage Information: 0 : [2014-08-13 15:48:44.8] [2014-08-13 19:48:43.6]   at MDocArchiveToMsxDocConverter.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 
> 
> Xamarin.VisualStudio.IOS.Utilities.Helpers Error: 0 : [2014-08-13 15:48:44.9] Exception caught.
> Xamarin.VisualStudio.IOS.Utilities.Helpers Error: 0 : [2014-08-13 15:48:45.1] Server returned an error. The remote server returned an error: (500) Internal Server Error.
> Server error code: 500
> Internal Server Error
> 
> 
> Xamarin.VisualStudio.IOS.Utilities.ErrorReportManager Error: 0 : [2014-08-13 15:48:45.3] Xamarin.iOS encountered the following error(s):




## Additional result: *incomplete* stack trace from `devenv*.log`

With Xamarin 3.0.54 + Xamarin.iOS 7.2.5.5


> Xamarin.VisualStudio.IOS.Utilities.Helpers Error: 0 : [2014-08-13 16:09:45.7] Exception caught.
> Xamarin.VisualStudio.IOS.Utilities.Helpers Error: 0 : [2014-08-13 16:09:45.9] Server returned an error. The remote server returned an error: (500) Internal Server Error.
> Server error code: 500
> Internal Server Error
> 
> 
> Xamarin.VisualStudio.IOS.MonoTouchPackage Information: 0 : [2014-08-13 16:09:46.0] [13-Aug-2014 16:09:45] Error: /Developer/MonoTouch/usr/share/doc/MonoTouch/MDocArchiveToMsxDocConverter.exe not found
> 
> Xamarin.VisualStudio.IOS.Utilities.ErrorReportManager Error: 0 : [2014-08-13 16:09:46.2] Xamarin.iOS encountered the following error(s):
> Xamarin.VisualStudio.IOS.MonoTouchPackage Information: 0 : [2014-08-13 16:09:46.4] t context, System.Object commandRequestState) [0x00000] in <filename unknown>:0 
> 
> Xamarin.VisualStudio.IOS.MonoTouchPackage Information: 0 : [2014-08-13 16:09:46.6]   at Mtb.Server.Listener.OnRequest (System.Object state) [0x00000] in <filename unknown>:0
Comment 1 Mohit Kheterpal 2014-08-26 09:59:21 UTC
I have tried to reproduce this issue and follow steps mention in bug description and I am getting following exception in mtb server log : https://gist.github.com/Mohit-Kheterpal/c205b286e3f64b7dac3d

Mac server log : https://gist.github.com/Mohit-Kheterpal/93165f531777951316a6

Environment info :
XVS 3.5.51
X.iOS 7.4.0.107
Comment 2 Brendan Zagaeski (Xamarin Team, assistant) 2014-10-04 00:13:36 UTC
Just a little update for the steps to reproduce (since the fix for bug 22024 has made `~/Library/Developer/MonoTouch` irrelevant).


## Updated steps to reproduce

1. Delete the `~/Library/Caches/Xamarin/mtbs` folder on the Mac build host.


2. Create a _file_ to replace the deleted directory so that mtbserver will
throw an exception when it tries to build a project.

touch ~/Library/Caches/Xamarin/mtbs


3. Open a Xamarin.iOS project in Visual Studio to pair to the build host.


4. Attempt to build the project.



## Incomplete stack trace from the "Mac Server Log"

> [04-Oct-2014 00:09:48] Request handled in 125.396ms
>  (ILoggingHelper logger, System.Object commandRequestState) [0x00000] in <filename unknown>:0 
>   at Mtb.Server.BaseCommand.OnRequest (System.Net.HttpListenerContext context, System.Object commandRequestState) [0x00000] in <filename unknown>:0 
>   at Mtb.Server.Listener.OnRequest (System.Object state) [0x00000] in <filename unknown>:0 
> [04-Oct-2014 00:09:53] Request handled in 10.459ms



## Version information

### Windows

Xamarin   3.7.201.0 (58a59ecb5fa40a0a2e97617c36c069074404c6ae)
Xamarin.iOS   8.2.0.0 (ff9d4a06f588a29e1db224ecd4216f68a9106299)

### Mac build host

Xamarin.iOS 8.2.0.193 (Business Edition)
Hash: 959c1e4
Build date: 2014-10-03 00:25:37-0400

Build host: 3.7.0.201
Comment 3 Mohit Kheterpal 2014-11-03 11:41:58 UTC
Thanks Brendan

I have checked this issue using XVS 3.7.248 + X.iOS 8.4.0.16 and after following steps mention in comment 2, I am getting same exception in mtbserver log : https://gist.github.com/Mohit-Kheterpal/b83d6a1e905ebb770931

Hence marking it as confirm.
Comment 4 Jose Gallardo 2015-09-29 23:05:36 UTC
Should be addressed by XMA.
Please verify.
Thanks!