Mac Agent Not Working - Can't Connect

2

Posts

  • BrendanZagaeskiBrendanZagaeski USForum Administrator, Xamarin Team Xamurai
    edited December 2015

    @AndrewNik, @Jsinh, the "Failed to execute 'ls /usr/bin/mono'" warning is an unfortunate false clue. That warning message is non-fatal. XamarinVS also checks /Library/Frameworks/Mono.framework/Versions/Current/bin/mono for mono. The fact that it outputs a warning about the "failed" ls command is probably uneccessarily confusing. I have now filed a bug to request improvements for that confusing logging behavior.

    The more important error message (at least in @AndrewNik's case) is:

    /Users/andreynikolin/.bashrc: line 1: dnvm.sh: No such file or directory

    This error is the root problem in his case. At the moment, XamarinVS loads the .bashrc file from the user's home directory before it executes certain commands. This can cause unexpected problems because other SSH sessions do not load the .bashrc file by default.

    The workaround for that problem isn't too tricky: move the .bashrc file to a backup location (or you can delete it entirely if you know you don't need it). As long as the .bashrc file is no longer present under "$HOME/.bashrc", that should stop the particular cause of the problem that @AndrewNik was seeing.

    Although the workaround is fairly easy, I don't think there's really any reason XamarinVS needs to load the .bashrc file, so I have now filed another bug to request that that behavior be changed.


    See also the latest Stable release announcement for information about other known issues in the latest release, including a link to the full "Xamarin 4 Bug List." (That list now includes the 2 new bugs I mentioned above.)

  • AndrewNikAndrewNik UAMember ✭✭

    @BrendanZagaeski Hello! In later messages I pointed that I've disabled Mac OS security system, so I no more have messages about .bashrc or /usr/bin/mono in log(I've created symlink to mono). The most current log looks like this(tried to connect for a number of times) http://pastebin.com/M38EWXX3 (decided to post on pastebin, because quotation here doesn't have a scroll-bar).

  • AndreiAlistarAndreiAlistar USMember
    edited December 2015

    I just had similar connection issues just now. I had the disconnect after 10 seconds in the logs.

    [2015-12-07 13:57:32.6929] MacServer State transition from DisconnectedState to SshConnectingState on MACDEV02.local (10.0.0.12)
    [2015-12-07 13:57:42.7040] Couldn't connect to MACDEV02.local. Please try again.
    [2015-12-07 13:57:42.8493] MacServer State transition from SshConnectingState to DisconnectedState on MACDEV02.local (10.0.0.12)

    What worked for me was adding a new mac and using the IP address.
    It was recognized as another machine and I was able to connect to it immediately.

    The biggest difference was in the time it took to get the fingerprint. It was instantaneous on the working connection.
    [2015-12-07 14:33:43.1659] MacServer State transition from SshConnectingState to SshConnectedState on 10.0.0.12 (10.0.0.12)
    [2015-12-07 14:33:43.3265] MacServer State transition from SshConnectedState to AgentsStartingState on 10.0.0.12 (10.0.0.12)
    ...
    [2015-12-07 14:33:46.2957] MacServer State transition from AgentsStartingState to LimitedState on 10.0.0.12 (10.0.0.12)
    ...
    [2015-12-07 14:34:01.7110] Connected to the Mac 10.0.0.12 (10.0.0.12) with Full support.

  • BrendanZagaeskiBrendanZagaeski USForum Administrator, Xamarin Team Xamurai
    edited December 2015

    @AndrewNik, unfortunately due to the (slightly incorrect) way the logging in XamarinVS currently works during that particular connection step, if you stop the warning about mono, then you also lose the real error about .bashrc. If you haven't moved or deleted your .bashrc file, then that is still the problem you are seeing.

    See the bug report for additional related details.

  • AndrewNikAndrewNik UAMember ✭✭

    @BrendanZagaeski Yay, awesome! Just renamed .bashrc and the problem is gone. Thanks a lot! Finally can start using Xamarin for VS =)

  • BenDinkelbergBenDinkelberg DEMember ✭✭

    Thanks renaming worked! :)

  • GustavoBarbozaGustavoBarboza COMember ✭✭

    Very very strange issue. The answer is ElCapitan.
    After many attempts, research, network analysis, packet analysis, firewalls behavior, I noticed that the requests from Windows to OSX not arrived. I upgraded to ElCapitan, and I was able to connect to the Mac with amazing speed.

  • EricHensonEricHenson USMember

    @BrendanZagaeski said:
    @AndrewNik, @Jsinh, the "Failed to execute 'ls /usr/bin/mono'" warning is an unfortunate false clue. That warning message is non-fatal. XamarinVS also checks /Library/Frameworks/Mono.framework/Versions/Current/bin/mono for mono. The fact that it outputs a warning about the "failed" ls command is probably uneccessarily confusing. I have now filed a bug to request improvements for that confusing logging behavior.

    The more important error message (at least in @AndrewNik's case) is:

    /Users/andreynikolin/.bashrc: line 1: dnvm.sh: No such file or directory

    This error is the root problem in his case. At the moment, XamarinVS loads the .bashrc file from the user's home directory before it executes certain commands. This can cause unexpected problems because other SSH sessions do not load the .bashrc file by default.

    The workaround for that problem isn't too tricky: move the .bashrc file to a backup location (or you can delete it entirely if you know you don't need it). As long as the .bashrc file is no longer present under "$HOME/.bashrc", that should stop the particular cause of the problem that @AndrewNik was seeing.

    Although the workaround is fairly easy, I don't think there's really any reason XamarinVS needs to load the .bashrc file, so I have now filed another bug to request that that behavior be changed.


    See also the latest Stable release announcement for information about other known issues in the latest release, including a link to the full "Xamarin 4 Bug List." (That list now includes the 2 new bugs I mentioned above.)

    This worked for me. I renamed my .bash and it connected.

  • NurhakKayaNurhakKaya USMember ✭✭

    Have a look at this please, this is how I solved my problem, hope it helps you as well:

    https://forums.xamarin.com/discussion/60149/os-x-el-capitan-10-11-3-breaks-xamarin-and-build-host-in-ios

  • JamesLeichterJamesLeichter USMember

    If anyone is still having this issue, i ran visual studio as Administrator and it now connects fine. It just gets hung up i believe

  • KenEgbunaKenEgbuna USMember
    edited March 2016

    Edit: I had asked @NurhakKaya how they resolved their issue through that link but it appears I thought the link led to bugzilla. Thanks for the answer @NurhakKaya!

    Edit 2: Well. Not quite working for me actually. This is a real bummer but it happens with whatever stack. Hours spent on debugging the environment itself...

  • toddmillernyctoddmillernyc USMember

    I fixed this by creating a new admin user xamarin same full name and user name. I made sure full name and user name were the same with no spaces.

  • Having same problem,i fixed by
    1- click Add Mac
    2- i added the real IP for Mac-Book
    Then click add and connect and it works

  • ShrikantMaliShrikantMali USMember ✭✭

    Try restarting VS, worked for me

  • RobCavanaughRobCavanaugh USMember

    Hey all,

    I run OSX on a local VM on my Windows 10 machine. This set up has worked well the past few months until this morning. Yesterday I updated Xamarin in Visual Studio 2015 and on my OSX instance. Then I continued working all day.

    This morning I could not connect to my Mac Agent. So I started troubleshooting the problem.

    1. Connected to the MacMini I have on the network fine. So, The issue is on my VM version of OSX.
    2. Can SSH to the VM
    3. Check the logs and see the problem is a hung broker on my OSX instance.
    4. Deleted the XMA Folder on OSX and forced it to regenerate.

    Issue fixed.

  • JuanGabrielDelCidJuanGabrielDelCid USMember
    edited June 2016

    Hello... for what it's worth, I solved the issue adding my Mac's IP Address to my Windows HOSTS file (C:\Windows\System32\drivers\etc\hosts):

    192.168.91.128 MacDev01 MacDev01.local

    After that, the agent connected correctly.

  • majidaminmajidamin USMember

    @Ciani Afonso thanks for your help
    i do turn on firewall in my mac and connected to it.

  • IanCowleyIanCowley GBMember

    I had the same issue. Xamarin logs had invalid character . After a lot of messing it turned out I had a custom bash login message, which was more than the single line of time and last login. Once I changed it to the default the connection worked fine. Upshot is that the routine to connect is not very tolerant of anything.

  • MarkVincentMarkVincent PHMember ✭✭✭

    I hate @Xamarin whenever they don't care about this issues. Well, they have docs out there but some of them doesn't really help. You only consume a lot of hours.

  • PatrickHesserPatrickHesser USMember ✭✭

    I had this same issue. Checked the link that @WednesdayWolf provided (https://bugzilla.xamarin.com/show_bug.cgi?id=35971) and that helped me. I had the same symptoms described in that bug. For me, I did not have to physically connect via wired network connection, but was able to simply enter the IP directly instead of looking for the name of the machine.

  • BrendanZagaeskiBrendanZagaeski USForum Administrator, Xamarin Team Xamurai
    edited August 2016

    Unfortunately networking does introduce several potential environmental complexities compared to a single-computer development setup, so detailed user bug reports of particular environments where the current logic does not succeed (or where the logging messages do not provide sufficient diagnostic information) are quite valuable. (Bug reports are the essential unit of information the engineering team will consume to understand how to improve the connection process in the future. Other approaches such as exploratory testing and code cleanup are on-going, but they do not provide the level of concrete feedback that bug reports can provide.) The subtlety of network configuration specifics also means that a precise methodical approach is important when attempting to diagnose issues with the connection process.

    The troubleshooting guide provides instructions about the recommended steps to take to file a new detailed user report in Bugzilla. From step 9 of the troubleshooting guide:

    If the ls command works correctly but the Visual Studio connection still fails, you can check the "Known Issues and Limitations" section about complications specific to Xamarin. If none of those match your problem, please file a new bug report and attach the logs described under "Check the Verbose Log Files".

    Do be sure to check each of the "Known Issues and Limitations" and then be sure to attach the verbose log files on the bug report as described. Thanks in advance!

  • FrancoFusaroFrancoFusaro USMember

    @JamesLeichter said:
    If anyone is still having this issue, i ran visual studio as Administrator and it now connects fine. It just gets hung up i believe

    This answer solved my problem, thanks! Please add it to the "Known Issues and Limitations" section.

  • XamabamaXamabama USMember ✭✭

    Thanks @BrendanZagaeski , I did do a WireShark trace (detailed Xamarin logs don't show much) but having some issue logging in to bugzilla so can't file the bug now. Not actually sure what info you can get from wireshark either since the packets are all encrypted. Anyway, what seems to work for me is as reported above - some combination of restarting VS2015, connecting using IP address, deleting & re-creating the IP address mac agent, then restarting VS. Problem is it seems I have to do that each day.

  • JTSoftwareJTSoftware USMember ✭✭

    I've run into this both times I've tried to use the iOS version with Vistual Studio. After going through the troubleshooter, each time it started working when I started the step of running Vistual Studio from a Developer Command Line with the log option: devenv /log

    How could this possibly make a difference? Seems like this bug is still present in 4.1.2. Can it not be reproduced?

  • HatefGhaniHatefGhani USMember

    @ClintonLandry Thank you! your solution helped me. I found issue from Help > Xamarin > Log.

  • JevgenijKononovJevgenijKononov USMember
    edited September 2016

    I have just solved this problem!!!
    It was nonsense.
    To connect visual studio Xamarin project and simulate that on mac when you getting could't connect to computername.local please try again later. You need to do next!
    1. Follow the solution from xamarin community about mac connection
    after this point if everything OK, you will connect, but if no..
    2. Install XAMARIN STUDIO and Xcode on MAC. After installation start XAMARIN studio or Xcode, create your own app and run app with simulator. Just to test simulator. Then do not close simulator
    3. Close app and try to connect again from Windows computer.
    At this point you will make synchronization and that all.
    Problem solved! I hope this gone be useful for somebody.

    I have successfully connected 2 computers with mac after doing this.

  • DaveHuntDaveHunt USMember ✭✭✭✭✭

    @JevgenijKononov said:

    1. Install XAMARIN STUDIO and Xcode on MAC.

    If you're following the instructions correctly, that should have already been done. It's the first actual install step in the Xamarin.iOS for Windows installation guide.

  • Mihail.9157Mihail.9157 USMember

    Have the same issue. The error is different from others:

    Xamarin.Messaging.VisualStudio.MessagingService Information: 0 : [2016-10-04 11:19:14.7645] Starting Broker 4.2.0.695 in port 57880...
    Xamarin.Messaging.Client.Ssh.SshCommandRunner Warning: 0 : [2016-10-04 11:19:14.9746] Failed to execute 'mkdir -p "/tmp/com.xamarin.2016-10-04__10-39-31.24096.broker"': ExitStatus=1
    Xamarin.Messaging.Client.Ssh.SshCommandRunner Warning: 0 : [2016-10-04 11:19:14.9936] mkdir: /tmp/com.xamarin.2016-10-04__10-39-31.24096.broker: Operation not permitted

    Xamarin.VisualStudio.IOS.Messaging.State.DisconnectedState Error: 0 : [2016-10-04 11:19:15.0036] mkdir: /tmp/com.xamarin.2016-10-04__10-39-31.24096.broker: Operation not permitted

    Xamarin.Messaging.Client.Ssh.SshCommandException: mkdir: /tmp/com.xamarin.2016-10-04__10-39-31.24096.broker: Operation not permitted

    at Renci.SshNet.SshCommandExtensions.ThrowIfError(SshCommand command)
    at Xamarin.Messaging.Client.Ssh.SshCommands.d__43.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Xamarin.Messaging.Client.Ssh.SshCommands.d__21.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Xamarin.Messaging.Client.Ssh.SshCommands.d__63.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Xamarin.Messaging.Client.Ssh.SshCommands.d__33.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Xamarin.Messaging.Client.Ssh.BrokerCommands.d__9.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Xamarin.Messaging.VisualStudio.MessagingService.d__91.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
    at Xamarin.Messaging.VisualStudio.MessagingService.d__71.MoveNext()
    Xamarin.VisualStudio.IOS.Messaging.State.DisconnectedState Error: 0 : [2016-10-04 11:19:15.0313] Couldn't connect to Mykhailos-Mac.local. Please try again.

    So I've tried to create folder /tmp/com.xamarin.2016-10-04__10-39-31.24096.broker with no luck. Changing permission to tmp folder also did not helped.

  • HayHay USMember ✭✭

    Just simply restart your VS after taking the BETA updsate from Tool--Xamarin---Others

  • mubimubi USMember ✭✭✭

    Delete every thing from the folder
    %localappdata%\Xamarin\MonoTouch.

  • Thanks @mubi!

  • I had the same connectivity problem.
    It was the first time that I was connecting VS to a mac server and when I was prompted to choose a mac server, there was already one the list, that VS detected automatically. When I tried to use that one, he just kept trying to connect with no success.
    I followed what @SheppePharis did (added a new mac server manually by IP) and it all started working! The connectivity issues were gone and I was able to use the masc server to build and debug.

  • MattButlerMattButler USUniversity ✭✭

    I FINALLY figured out my issue with Mac Agent not connecting. It was a DNS issue. I could use Putty from my PC to connect to the MAC, but when I tried to use the Mac Agent, it would time out. So, I finally tried pinging the name Visual Studio was using for my Mac and it didn't route to the proper IP. http://superuser.com/questions/958991/windows-10-cant-edit-hosts-file shows how to edit your Windows Hosts file to hard code a DNS entry. I did that, and whala, it connects!

  • Oracle22Oracle22 USMember ✭✭
    edited November 2016

    My Error in mac /var/logs/system.log:

    Nov 28 10:40:54 CompanyMBP sshd[1382]: Accepted keyboard-interactive/pam for Company MacBookPro from 111.116.14.3 port 11142 ssh2
    Nov 28 10:42:00 CompanyMBP sshd[1389]: Accepted keyboard-interactive/pam for Company MacBookPro from 111.116.14.3 port 11215 ssh2
    Nov 28 10:42:00 CompanyMBP sshd[1392]: Accepted keyboard-interactive/pam for Company MacBookPro from 111.116.14.3 port 11216 ssh2
    Nov 28 10:42:01 CompanyMBP sshd[1393]: Received disconnect from 111.116.14.3: 11: Connection terminated by the client.
    Nov 28 10:42:01 CompanyMBP sshd[1393]: Disconnected from 111.116.14.3
    Nov 28 10:42:01 CompanyMBP com.apple.xpc.launchd[1] (com.openssh.sshd.9025155C-7BF0-4F73-937C-4FEB3B805206[1389]): Service exited with abnormal code: 255
    Nov 28 10:42:01 CompanyMBP sshd[1397]: Received disconnect from 111.116.14.3: 11: Connection terminated by the client.
    Nov 28 10:42:01 CompanyMBP sshd[1397]: Disconnected from 111.116.14.3

    Message when connect to mac with vs 2012 "Couldn't connect to [Mac Name].local. Please try again"
    My solution
    Update de Xamarin Studio and Xcode in the mac at resolved my problem

  • Deleting the XMA Folder on the mac machine don't work.

  • Running VS as admin + using my username (and not my name/surname) solved my problem.

  • JeffLimJeffLim USMember ✭✭

    I have different error in the log:

    Xamarin.Messaging.Client.Ssh.XmaCommands Error: 0 : [2017-02-09 21:25:59.8379] An error occurred while verifying installed C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Xamarin\Xamarin\4.2.2.11\Broker.zip
    System.UnauthorizedAccessException: Access to the path 'C:\Users\jeff\AppData\Local\Temp\Xamarin\XMA\Broker\4.2.2.11' is denied.

    But I have resolved it by chaning the permission and owner of the Xamarin folder.
    How to change? Right click the folder. Choose properties, then choose 'Security Tab'.
    Start with changing the permission by clicking on the user name. Then, click Edit button.
    In order to change the owner, you need to click on the 'advanced' button. Then choose 'owner' tab.

    Hope this help.

    Besides, I have done something on my mac machine too.
    1. I have turn off my firewall in Mac.
    2. I have removed the # of UseDNS no from the sshd_config file (sitting inside mac's HD \ etc \ ssh \sshd_config
    3. Created a dummy (blank) .bashrc file in Users\yourself\

  • MikeHuangMikeHuang USMember

    Finally I solved the timeout problem, that's because I install OzCode & ReSharper on my VS2015, after remove them I can connect Mac Agent, then install them back. All is fine.

  • i am also got same problem from VS2017 Forms Preview , just update latest xamarin version from mac ,now its start working

  • zappypigzappypig USMember

    I had the same error message running OSX 10.12.5 Beta and Windows 10 in Parallels running VS2017 Community 15.1

    Looking at Xamarin Log %APPDATA%\Local\Xamarin\Logs\15.0 I had following error>>>>

    Xamarin.Messaging.Ssh.MessagingService|Information|0|Starting Broker 4.4.0.34 in port 50377...
    Xamarin.Messaging.Ssh.SshCommands|Error|0|Could not find a Mono installation on the Mac
    Xamarin.Messaging.Ssh.SshCommands|Error|0|Probed locations for Mono on the Mac: /usr/bin/mono64, /Library/Frameworks/Mono.framework/Versions/Current/bin/mono64

    I Downloaded Mono from http://www.mono-project.com/download/

    And now all works fine.

Sign In or Register to comment.