Bug 20588 - SDK synchronization broken in XamarinVS 3.1 "Unable to connect to server"
Summary: SDK synchronization broken in XamarinVS 3.1 "Unable to connect to server"
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS (show other bugs)
Version: 3.1
Hardware: PC Windows
: High major
Target Milestone: 3.3
Assignee: Adrian Alonso
URL:
Depends on:
Blocks:
 
Reported: 2014-06-13 15:31 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2014-08-20 13:06 UTC (History)
9 users (show)

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


Attachments
Logs (4.74 KB, application/zip)
2014-06-13 15:31 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:
VERIFIED FIXED

Description Brendan Zagaeski (Xamarin Team, assistant) 2014-06-13 15:31:44 UTC
Created attachment 7069 [details]
Logs

SDK synchronization broken in XamarinVS 3.1

## Steps to reproduce

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

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

3. When the "Xamarin.iOS SDK Update Available" notification pops up, click it, and select "Yes" to start the update.


## Results

### Xamarin VS log
> [2014-06-13 15:04:51.9] Build server control connection failed
> [2014-06-13 15:04:52.3] Server 10.1.13.251 hung up connection. Unable to read data from the transport connection: A blocking operation was interrupted by a call to WSACancelBlockingCall. (System.IO.IOException)


### mtbserver.log
> [13-Jun-2014 15:04:51] Error: An error occurred (no details available)


### SDKUpdate.log
> [6/13/2014 3:04:54 PM] Exception caught in SdkUpdater.Loading : System.InvalidOperationException: Failed to connect to server to update the SDK : Task was canceled
>    at Mono.IOS.SdkUpdater.MainWindow.SetUpConnection()
>    at Mono.IOS.SdkUpdater.MainWindow.Load()
> [6/13/2014 3:04:56 PM] Exception caught in SdkUpdater.Loading : System.InvalidOperationException: Invalid response received from server while updating the SDK
>    at Mono.IOS.SdkUpdater.MainWindow.<>c__DisplayClass4.<ProcessSync>b__3()
> [6/13/2014 3:04:56 PM] Exception caught in SdkUpdater.Loading : System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: The calling thread cannot access this object because a different thread owns it.


### Error dialogs

1. "Unable to connect to server."

2. "Unable to connect to server."

3. "The SDK synchronization returned with error Unknown. Please contact support@xamarin.com."


## Version information

### Mac
Xamarin.iOS 7.2.6.3
OS X 10.9.3

Also tested with: Xamarin.iOS 7.2.3.39

### Windows
Microsoft Visual Studio Professional 2013
Version 12.0.30501.00 Update 2
Microsoft .NET Framework
Version 4.5.51641

Xamarin   3.1.198.0 (fb9b274179eab7ecc4c6ff10f9f7b789efe5b7f6)

Windows 8.1 64-bit (in VMWare)
Comment 1 Mohit Kheterpal 2014-06-16 13:05:21 UTC
I have checked this issue and getting same behavior as mentioned in bug description. 

screencast : http://screencast.com/t/A7ZRrzvXtkk

IDE Logs :https://gist.github.com/Mohit-Kheterpal/f98fa7aade0679338602
mtbserver log: https://gist.github.com/Mohit-Kheterpal/afe5e6e0e73e03b75846

Environment info :
Microsoft Visual Studio Professional 2012
Version 11.0.61030.00 Update 4
Microsoft .NET Framework
Version 4.5.50938

Xamarin   3.1.197.0 (dd4a9192f63442dd0f16446cfe761f2b0d52c9f2)
X.iOS 7.2.6.3
Comment 2 Daniel Cazzulino 2014-06-19 18:36:12 UTC
Fixed by https://github.com/xamarin/XamarinVS/pull/401
Comment 3 Akhilesh kumar 2014-07-01 13:10:59 UTC
I have checked this issue with latest stable XVS build and I am still getting same issue. We are unable to sync with mac build host server.

Screencast: http://screencast.com/t/MGKrSUVotEt0
mtb server log: https://gist.github.com/saurabh360/24072325ed9dc190e986
IDE log: https://gist.github.com/saurabh360/c21832e861b5ee6d84cf

Hence reopening this issue.

VS 2012
XVS 3.1.115
X.IOS 7.2.5.4
Comment 6 Tajinder Singh 2014-07-15 04:28:57 UTC
We have checked this issue and now we are able to sync SDK with mac build server. We are also able to update SDK successfully without any error.

Screencast: http://screencast.com/t/WJaJkOsQXlfD

Environment info:
VS 2013/2012
Xamarin   3.3.39.0 (e0231991c29b7685fa7bc2057a11b6d508128782)
X.iOS 7.2.6.22
Comment 7 daniel.abelski 2014-08-20 02:27:52 UTC
Still have a problem syncing.

Environment info:
VS 2013 update 3
Xamarin   3.3.47.0
X.iOS 7.2.6.28


VS Output:
[20-Авг.-2014 12:15:26] Apple SDK developer root: /Applications/Xcode.app/Contents/Developer
[20-Авг.-2014 12:15:26] Server IP Address : 192.168.0.2
[20-Авг.-2014 12:15:27] Handling with command: [Info: CommmandUrl=Info] (10)
[20-Авг.-2014 12:15:27] Attempting to acquire command execution lock, timeout set to 00:10:00
[20-Авг.-2014 12:15:27] Starting /Developer/MonoTouch/usr/bin/mtouch --version
[20-Авг.-2014 12:15:27] stdout: mtouch 7.2.6.28 (606f31a)
[20-Авг.-2014 12:15:27] mtouch 7.2.6.28 (606f31a)
nished (11)
[20-Авг.-2014 12:15:48] Handling with command: [StatusSdk: CommmandUrl=StatusSdk] (11)
[20-Авг.-2014 12:15:48] Attempting to acquire command execution lock, timeout set to 00:10:00
[20-Авг.-2014 12:15:48] Launched process converter
[2014-08-20 06:15:14.9] Processing /Library/Frameworks/Mono.framework/External/monodoc/MonoTouch-lib.zip
[2014-08-20 06:15:23.7] monotouch.xml
[2014-08-20 06:15:23.7] OpenTK.xml
[2014-08-20 06:15:23.7] MonoTouch.Dialog-1.xml
[2014-08-20 06:15:23.7] MonoTouch.NUnitLite.xml
[2014-08-20 06:15:23.7] NamespaceSummaries.xml
[20-Авг.-2014 12:15:57] ExitCode: 0
[2014-08-20 06:15:24.5] This tool needs to be run as root
[20-Авг.-2014 12:15:57] Command [StatusSdk: CommmandUrl=StatusSdk] finished (11)

Xamarin mtbserver.log:
 Маркер — 20 авг. 2014 г., 12:14:27
[20-Авг.-2014 12:15:26] Apple SDK developer root: /Applications/Xcode.app/Contents/Developer
[20-Авг.-2014 12:15:26] Server IP Address : 192.168.0.2
[20-Авг.-2014 12:15:27] Handling with command: [Info: CommmandUrl=Info] (10)
[20-Авг.-2014 12:15:27] Attempting to acquire command execution lock, timeout set to 00:10:00
[20-Авг.-2014 12:15:27] Starting /Developer/MonoTouch/usr/bin/mtouch --version
[20-Авг.-2014 12:15:27] stdout: mtouch 7.2.6.28 (606f31a)

[20-Авг.-2014 12:15:27] mtouch 7.2.6.28 (606f31a)

[20-Авг.-2014 12:15:27] Command [Info: CommmandUrl=Info] finished (10)
[20-Авг.-2014 12:15:27] Handling with command: [Login: CommmandUrl=Login] (10)
[20-Авг.-2014 12:15:27] Attempting to acquire command execution lock, timeout set to 00:10:00
[20-Авг.-2014 12:15:27] Login process initiated, returning UUID for pairing.
[20-Авг.-2014 12:15:27] Command [Login: CommmandUrl=Login] finished (10)
[20-Авг.-2014 12:15:27] Handling with command: [Login: CommmandUrl=Login] (10)
[20-Авг.-2014 12:15:27] Attempting to acquire command execution lock, timeout set to 00:10:00
[20-Авг.-2014 12:15:27] Command [Login: CommmandUrl=Login] finished (10)
[20-Авг.-2014 12:15:27] Got connection from Visual Studio (log)
[20-Авг.-2014 12:15:28] Handling with command: [Info: CommmandUrl=Info] (11)
[20-Авг.-2014 12:15:28] Attempting to acquire command execution lock, timeout set to 00:10:00
[20-Авг.-2014 12:15:28] mtouch 7.2.6.28 (606f31a)

[20-Авг.-2014 12:15:28] Command [Info: CommmandUrl=Info] finished (11)
[20-Авг.-2014 12:15:48] Handling with command: [StatusSdk: CommmandUrl=StatusSdk] (11)
[20-Авг.-2014 12:15:48] Attempting to acquire command execution lock, timeout set to 00:10:00
[20-Авг.-2014 12:15:48] Launched process converter
[20-Авг.-2014 12:15:57] ExitCode: 0
[20-Авг.-2014 12:15:57] Command [StatusSdk: CommmandUrl=StatusSdk] finished (11)
[20-Авг.-2014 12:19:09] Apple SDK developer root: /Applications/Xcode.app/Contents/Developer
[20-Авг.-2014 12:19:09] Server IP Address : 192.168.0.2
[20-Авг.-2014 12:19:09] Handling with command: [Info: CommmandUrl=Info] (10)
[20-Авг.-2014 12:19:09] Attempting to acquire command execution lock, timeout set to 00:10:00
[20-Авг.-2014 12:19:09] Starting /Developer/MonoTouch/usr/bin/mtouch --version
[20-Авг.-2014 12:19:10] stdout: mtouch 7.2.6.28 (606f31a)

[20-Авг.-2014 12:19:10] mtouch 7.2.6.28 (606f31a)

[20-Авг.-2014 12:19:10] Command [Info: CommmandUrl=Info] finished (10)
[20-Авг.-2014 12:19:10] Handling with command: [Login: CommmandUrl=Login] (10)
[20-Авг.-2014 12:19:10] Attempting to acquire command execution lock, timeout set to 00:10:00
[20-Авг.-2014 12:19:10] Login process initiated, returning UUID for pairing.
[20-Авг.-2014 12:19:10] Command [Login: CommmandUrl=Login] finished (10)
[20-Авг.-2014 12:19:10] Handling with command: [Login: CommmandUrl=Login] (10)
[20-Авг.-2014 12:19:10] Attempting to acquire command execution lock, timeout set to 00:10:00
[20-Авг.-2014 12:19:10] Command [Login: CommmandUrl=Login] finished (10)
[20-Авг.-2014 12:19:10] Got connection from Visual Studio (log)
[20-Авг.-2014 12:19:10] Handling with command: [Info: CommmandUrl=Info] (11)
[20-Авг.-2014 12:19:10] Attempting to acquire command execution lock, timeout set to 00:10:00
[20-Авг.-2014 12:19:10] mtouch 7.2.6.28 (606f31a)

[20-Авг.-2014 12:19:10] Command [Info: CommmandUrl=Info] finished (11)
[20-Авг.-2014 12:19:16] Handling with command: [StatusSdk: CommmandUrl=StatusSdk] (11)
[20-Авг.-2014 12:19:16] Attempting to acquire command execution lock, timeout set to 00:10:00
[20-Авг.-2014 12:19:16] Launched process converter
[20-Авг.-2014 12:19:25] ExitCode: 0
[20-Авг.-2014 12:19:26] Command [StatusSdk: CommmandUrl=StatusSdk] finished (11)
[20-Авг.-2014 12:19:38] Finishing Output (log:writer) Thread...
[20-Авг.-2014 12:19:38] Error: An error occurred (no details available)
[20-Авг.-2014 12:19:40] Apple SDK developer root: /Applications/Xcode.app/Contents/Developer
[20-Авг.-2014 12:19:40] Server IP Address : 192.168.0.2
[20-Авг.-2014 12:19:40] Handling with command: [Info: CommmandUrl=Info] (10)
[20-Авг.-2014 12:19:40] Attempting to acquire command execution lock, timeout set to 00:10:00
[20-Авг.-2014 12:19:40] Starting /Developer/MonoTouch/usr/bin/mtouch --version
[20-Авг.-2014 12:19:41] stdout: mtouch 7.2.6.28 (606f31a)

[20-Авг.-2014 12:19:41] mtouch 7.2.6.28 (606f31a)

[20-Авг.-2014 12:19:41] Command [Info: CommmandUrl=Info] finished (10)
[20-Авг.-2014 12:19:41] Handling with command: [Login: CommmandUrl=Login] (10)
[20-Авг.-2014 12:19:41] Attempting to acquire command execution lock, timeout set to 00:10:00
[20-Авг.-2014 12:19:41] Login process initiated, returning UUID for pairing.
[20-Авг.-2014 12:19:41] Command [Login: CommmandUrl=Login] finished (10)
[20-Авг.-2014 12:19:41] Handling with command: [Login: CommmandUrl=Login] (10)
[20-Авг.-2014 12:19:41] Attempting to acquire command execution lock, timeout set to 00:10:00
[20-Авг.-2014 12:19:41] Command [Login: CommmandUrl=Login] finished (10)
[20-Авг.-2014 12:19:41] Got connection from Visual Studio (log)
[20-Авг.-2014 12:19:44] Finishing Output (log:writer) Thread...
[20-Авг.-2014 12:19:44] Error: An error occurred (no details available)
Comment 8 Brendan Zagaeski (Xamarin Team, assistant) 2014-08-20 13:06:34 UTC
@daniel.abelski,

Thanks for the report. The key information to diagnose this exact bug (bug 20588) is the contents of the `SDKUpdate.log` file [1].

[1] %LOCALAPPDATA%\Xamarin\Log\MonoTouchVS\SDKUpdate.log



If you're hitting exactly this bug, then the `SDKUpdate.log` file will contain the following error message:

> System.InvalidOperationException: The calling thread cannot access this object because a different thread owns it.



Unfortunately, there is another bug (bug 22121) that has almost identical symptoms. That bug currently occurs on XamarinVS 3.3.47 or newer. I filed that bug separately because it seems to depend on additional factors compared to this bug.


## Workarounds

So far I haven't hit this synchronization problem at all on 3.1.228, so if you like, you can downgrade back (XamarinVS 3.1.228 + Xamarin.iOS 7.2.5.5) until bug 22121 is fixed.

Alternatively, you can follow the steps to update the SDK by hand using "Option 3" from [2], or leave the SDK un-synced as mentioned in "Option 1" on [2].

[2] http://forums.xamarin.com/discussion/19540/downgrade-or-ignore-ios-sdk-sync-error-the-sdk-synchronization-returned-with-error-unknown