microsoft / azure-pipelines-agent

Azure Pipelines Agent 🚀
MIT License
1.72k stars 864 forks source link

Self Hosted Agent - RedHat 7.6 & 7.7 fail. #2858

Closed utibeng closed 3 years ago

utibeng commented 4 years ago

Agent Version and Platform

Various - latest agent 2.144.1 for Linux x64. Followed the steps in https://docs.microsoft.com/en-gb/learn/modules/host-build-agent/4-create-build-agent This works for Ubuntu but not RedHat. Error is below;



Finish Install Dependencies

ldd: warning: you do not have execution permission for ./bin/libcoreclr.so' ldd: warning: you do not have execution permission for./bin/System.Security.Cryptography.Native.OpenSsl.so' ldd: warning: you do not have execution permission for ./bin/System.IO.Compression.Native.so' ldd: warning: you do not have execution permission for./bin/System.Net.Http.Native.so' realpath(): Permission denied Failed to resolve full path of the current executable [/proc/self/exe]


OS of the machine running the agent? Redhat Linux. Tried and it works fine with Ubuntu --------OS Information-------- NAME="Red Hat Enterprise Linux Server" VERSION="7.7 (Maipo)" ID="rhel" ID_LIKE="fedora" VARIANT="Server" VARIANT_ID="server" VERSION_ID="7.7" PRETTY_NAME="Red Hat Enterprise Linux Server 7.7 (Maipo)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:redhat:enterprise_linux:7.7:GA:server" HOME_URL="https://www.redhat.com/" BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7" REDHAT_BUGZILLA_PRODUCT_VERSION=7.7 REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux" REDHAT_SUPPORT_PRODUCT_VERSION="7.7"

The current OS is Fedora based --------Redhat Version-------- Red Hat Enterprise Linux Server release 7.7 (Maipo)

Fmstrat commented 4 years ago

I am experiencing this as well.

Fmstrat commented 4 years ago

I found the problem was the ownership of the files in the folder. They were owned by 1001 instead of the msagent user I had created. Running this as root for the install worked:

# Install MS Build agent
mkdir -p /opt/ms-build-agent &&\
cd /opt/ms-build-agent &&\
wget https://vstsagentpackage.azureedge.net/agent/2.166.2/vsts-agent-linux-x64-2.166.2.tar.gz &&\
tar xvfz vsts-agent-linux-x64-2.166.2.tar.gz &&\
useradd -r -s /bin/false msagent &&\
chown msagent . -R &&\
/opt/ms-build-agent/bin/installdependencies.sh &&\
su -s /bin/bash -c '/opt/ms-build-agent/config.sh' msagent
github-actions[bot] commented 3 years ago

This issue has had no activity in 180 days. Please comment if it is not actually stale

dhevany commented 2 years ago

works I am running centos 8

Install MS Build agent

mkdir -p /opt/ms-build-agent &&\ cd /opt/ms-build-agent &&\ wget https://vstsagentpackage.azureedge.net/agent/2.166.2/vsts-agent-linux-x64-2.166.2.tar.gz &&\ tar xvfz vsts-agent-linux-x64-2.166.2.tar.gz &&\ useradd -r -s /bin/false msagent &&\ chown msagent . -R &&\ /opt/ms-build-agent/bin/installdependencies.sh &&\ su -s /bin/bash -c '/opt/ms-build-agent/config.sh' msagent