Установка VSTS-агента в CentOS возвращает ошибку 'System.Security.Cryptography.Native.OpenSsl': (Исключение из HRESULT: 0x8007007E) - PullRequest
0 голосов
/ 12 мая 2018

Я пытаюсь установить агент VSTS в операционной системе CentOS, и при попытке запустить ./config.sh я вижу следующую ошибку в каталоге $ {myagent_dir} / _ diag

> [2018-05-12 15:44:09Z ERR  Terminal]
> System.TypeInitializationException: The type initializer for
> 'System.Net.Http.CurlHandler' threw an exception. --->
> System.TypeInitializationException: The type initializer for 'Http'
> threw an exception. ---> System.TypeInitializationException: The type
> initializer for 'HttpInitializer' 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.HttpInitializer..cctor()    --- End of inner exception stack
> trace ---    at Interop.HttpInitializer.Initialize()    at
> Interop.Http..cctor()    --- End of inner exception stack trace ---   
> at Interop.Http.GetSupportedFeatures()    at
> System.Net.Http.CurlHandler..cctor()    --- End of inner exception
> stack trace ---    at System.Net.Http.CurlHandler..ctor()    at
> Microsoft.VisualStudio.Services.Agent.Util.ApiUtil.CreateConnection(Uri
> serverUri, VssCredentials credentials, IEnumerable`1
> additionalDelegatingHandler)    at
> Microsoft.VisualStudio.Services.Agent.Listener.Configuration.BuildReleasesAgentConfigProvider.<TestConnectionAsync>d__14.MoveNext()

Моя установка выглядит следующим образом

[user@server ~]# cat /etc/*release*
CentOS Linux release 7.5.1804 (Core)
Derived from Red Hat Enterprise Linux 7.5 (Source)

Кроме того, мне пришлось установить другую версию libicu, перейдя по ссылке ниже, чтобы решить проблему «Не удалось инициализировать CoreCLR, HRESULT: 0x80131500».

http://fsoikin.blogspot.com/2015/12/getting-coreclr-running-on-centos.html

Я убедился, что у меня есть все необходимые компоненты по следующим ссылкам, без проблем при выполнении всех установок yum

https://github.com/Microsoft/vsts-agent/blob/master/docs/start/envredhat.md https://www.microsoft.com/net/learn/get-started/linux/centos

Я выполняю следующие шаги:

[user@server ~]$ export LD_LIBRARY_PATH=/opt/libicu52:/usr/lib64/:/usr/lib
[user@server ~]$ cd /opt/tfs_agent/
[user@server tfs_agent]$ ./config.sh

>> End User License Agreements:

Building sources from a TFVC repository requires accepting the Team Explorer Everywhere End User License Agreement. This step is not required for building sources from Git repositories.

A copy of the Team Explorer Everywhere license agreement can be found at:
  /opt/tfs_agent/externals/tee/license.html

Enter (Y/N) Accept the Team Explorer Everywhere license agreement now? (press enter for N) > Y

>> Connect:

Enter server URL > https://tfs_url/collectionName/_admin/_AgentPool
Enter authentication type (press enter for Negotiate) > PAT
Enter personal access token > ****************************************************
Connecting to server ...
The type initializer for 'System.Net.Http.CurlHandler' threw an exception.
Failed to connect.  Try again or ctrl-c to quit
Enter server URL > Exiting...

Результаты онлайн-поиска указывают мне на проблемы Openssl при попытке сделать то же самое с MacOS, и в моем случае ни одна из них не подходит.Любая помощь по этому вопросу приветствуется!

Ответы [ 2 ]

0 голосов
/ 15 мая 2018

Проблема была в том, что я скачал неверную версию (созданную для Ubuntu).Проблема решена путем загрузки правильной версии агента.

0 голосов
/ 15 мая 2018

Предварительные условия по следующим ссылкам: Необходимые условия для Red Hat / CentOS [2.124.0 или ниже]

Это применимо только к версии агента сборки с 2.124.0 или ниже.

Последняя версия агента сборки: v2.133.3 Пожалуйста, дважды проверьте версию своего агента сборки. Если вы используете 2.125.0 или выше, вам необходимо убедиться, что ваш компьютер подготовлен с соблюдением следующих условий:

Системные требования Linux [2.125.0 или выше]

Кроме того, предлагаем вам также пройти этот официальный учебник, как Развернуть агент в Linux

...