Azure-pipelines-agent: Support (beta) High Sierra 10.13 - Segmentation Fault

Created on 11 Jun 2017  Â·  25Comments  Â·  Source: microsoft/azure-pipelines-agent

Agent version and platform

Agent: 2.117.1
MacOS High Sierra 10.13

VSTS type and version

VisualStudio.com

What's not working?

Steps taken:

  1. brew install openssl
  2. install dotnet core sdk
  3. install xcode + xcode-select install
  4. Run ./config.sh and observe the CurlHandler error mentioned in #110
  5. ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
  6. ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
  7. ./config.sh

Expected output:
build agent is now properly configured

Actual output:
[Enter personal access token > ********************
Connecting to server ...
./config.sh: line 19: 34980 Segmentation fault: 11 ./bin/Agent.Listener configure "$@"

Agent and Worker's diag log

Agent_ log: https://pastebin.com/jA7piEsZ
No Worker_ log available

Crash log from ~/Library/Log/ : https://pastebin.com/9TeL120S

Most helpful comment

@mgj can you try the following instructions see whether you can unblock?
• Locate System.Net.Http.dll (presumably /agentroot/bin/System.Net.Http.dll)
• Save a backup copy of entire /bin folder
• Download https://ci.dot.net/job/dotnet_corefx/job/release_1.1.0/job/osx_release/lastSuccessfulBuild/artifact/bin/build.tar.gz
• tar -xzvf build.tar.gz bin/Unix.AnyCPU.Release/System.Net.Http/System.Net.Http.dll
• Copy the extracted file over top of the agentroot/bin copy

All 25 comments

@mgj can you try the following instructions see whether you can unblock?
• Locate System.Net.Http.dll (presumably /agentroot/bin/System.Net.Http.dll)
• Save a backup copy of entire /bin folder
• Download https://ci.dot.net/job/dotnet_corefx/job/release_1.1.0/job/osx_release/lastSuccessfulBuild/artifact/bin/build.tar.gz
• tar -xzvf build.tar.gz bin/Unix.AnyCPU.Release/System.Net.Http/System.Net.Http.dll
• Copy the extracted file over top of the agentroot/bin copy

@TingluoHuang success!

I replaced agentroot/bin/System.Net.Http.dll with the new one you linked
I left /usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.1.2/System.Net.Http.dll alone

I can now configure the agent and run it. I have not yet tried to run an actual job

@mgj cool, could you please let us know if you are able to run an actual job? thanks.

I have now successfully built a Xamarin.Android and Xamarin.iOS project (that i used to build on Sierra) on a build agent running High Sierra

This also solved my issue, thanks. Any timeframe for a fix in an official release?

Thanks, solved my issue ;)

We are in the process of moving to .NET Core 2.0 which is officially supported on 10.13. We hope to have a build out in the next couple of weeks.

Same problem also on MacOS Sierra, replacing System.Net.Http.dll as @TingluoHuang suggested worked! Thanks!

Performed the same task as @TingluoHuang suggested on MacOS X High Sierra 10.13 with agent "vsts-agent-osx.10.11-x64-2.123.0" and in my case, I was removing a Agent.

Thanks for the help.

@chrisrpatterson any update on getting an update out?

Well, we're getting to High Sierra 10.13.1. When this update will arrive? This workaround freaks me out.

Unfortunately, workaround with replacing System.Net.Http didn't help me to set up the new build agent on OS X 10.13 , and the config.sh crashed after authentication:

[2017-10-30 22:29:48Z INFO ConfigurationManager] cred retrieved
[2017-10-30 22:29:48Z INFO Terminal] WRITE LINE: Connecting to server ...
[2017-10-30 22:29:50Z INFO ConfigurationManager] Test Connection complete.
[2017-10-30 22:29:50Z INFO RSAFileKeyManager] Creating new RSA key using 2048-bit key length
[2017-10-30 22:29:50Z ERR  Agent] System.TypeInitializationException: The type initializer for 'Crypto' threw an exception. ---> System.TypeInitializationException: The type initializer for 'CryptoInitializer' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'System.Security.Cryptography.Native.OpenSsl': The specified module could not be found.
 (Exception from HRESULT: 0x8007007E)
   at Interop.CryptoInitializer.EnsureOpenSslInitialized()
   at Interop.CryptoInitializer..cctor()
   --- End of inner exception stack trace ---
   at Interop.CryptoInitializer.Initialize()
   at Interop.Crypto..cctor()
   --- End of inner exception stack trace ---
   at Interop.Crypto.RsaCreate()
   at System.Security.Cryptography.RSAImplementation.RSAOpenSsl.GenerateKey()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at System.Security.Cryptography.RSAImplementation.RSAOpenSsl.ExportParameters(Boolean includePrivateParameters)
   at Microsoft.VisualStudio.Services.Agent.Listener.Configuration.RSAFileKeyManager.CreateKey()
   at Microsoft.VisualStudio.Services.Agent.Listener.Configuration.ConfigurationManager.<ConfigureAsync>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.Agent.Listener.Agent.<ExecuteCommand>d__9.MoveNext()
[2017-10-30 22:29:50Z ERR  Terminal] WRITE ERROR: The type initializer for 'Crypto' threw an exception. 

Tried the build agent version 2.117.2 and the latest 2.124.0

Any additional workarounds?

@aplex did you install openssl pre-requisites? 

https://github.com/Microsoft/vsts-agent/blob/master/docs/start/envosx.md

Ok, the workaround worked after installing openssl

This workaround works for me too

please try out the latest release which is NetCore 2.0
https://github.com/Microsoft/vsts-agent/releases/tag/v2.125.0

Just tried out 2.125.0 and once it attempts to connect to the server I get:

The handler does not support custom handling of certificates with this combination of libcurl (7.54.0) and its SSL backend ("LibreSSL/2.0.20").

My version of curl is the system one in High Sierra which is:

curl 7.54.0 (x86_64-apple-darwin17.0) libcurl/7.54.0 LibreSSL/2.0.20 zlib/1.2.11 nghttp2/1.24.0
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz HTTP2 UnixSockets HTTPS-proxy

@dalemyers please try the later patched version. https://github.com/Microsoft/vsts-agent/releases/tag/v2.125.1

@TingluoHuang Thank you, worked for me on High Sierra 10.13.1. Had the same problem as @dalemyers.

thanks for everyone.

This also resolved my issue. Thanks

Great to hear! Thanks for following up

I had this crash issue with the following: https://vstsagentpackage.azureedge.net/agent/2.126.0/vsts-agent-osx-x64-2.126.0.tar.gz

Using the workaround TingluoHuang commented on 20 Jun 2017 fixed the issue for me. Have not tried to update the OpenSSL.

The issue occurred after upgrading from Sierra to High Sierra.

I got the same problem. I was about to trying the link provided by TingluoHuang, but the link is invalid. Could someone help please?

I also have the same problem, but the link @TingluoHuang provided doesn't work

https://ci.dot.net/job/dotnet_corefx/job/release_1.1.0/job/osx_release/lastSuccessfulBuild/artifact/bin/build.tar.gz

Where can I get the files I need to fix this segmentation fault?

Was this page helpful?
0 / 5 - 0 ratings