Can't install GitHub actions runner on linux
Asked Answered
G

7

11

I'm trying to install a GitHub runner on my Linux machine (Ubuntu 20.04.1 LTS) following the steps described at repo>settings>Actions>add runner. The first steps worked fine but when I run the config:

./config.sh --url <repo URL> --token <token>

I get the following failure message:

ldd: ./bin/libSystem.Security.Cryptography.Native.OpenSsl.so: No such file or directory
ldd: ./bin/libSystem.IO.Compression.Native.so: No such file or directory
touch: cannot touch '.env': Permission denied
./env.sh: line 37: .path: Permission denied
./env.sh: line 32: .env: Permission denied
Unhandled exception. System.UnauthorizedAccessException: Access to the path '/actions-runner/_diag' is denied.
 ---> System.IO.IOException: Permission denied
   --- End of inner exception stack trace ---
   at System.IO.FileSystem.CreateDirectory(String fullPath)
   at System.IO.Directory.CreateDirectory(String path)
   at GitHub.Runner.Common.HostTraceListener..ctor(String logFileDirectory, String logFilePrefix, Int32 pageSizeLimit, Int32 retentionDays)
   at GitHub.Runner.Common.HostContext..ctor(String hostType, String logFile)
   at GitHub.Runner.Listener.Program.Main(String[] args)
./config.sh: line 76: 10405 Aborted                 (core dumped) ./bin/Runner.Listener configure "$@"

config.sh does not allow the user to execute it as sudo, so I've modified the script to be allowed to do so but the problems with the permissions remain. Any ideas?

UPDATE: I also installed dependencies by running the command below in /actions-runner directory and nothing has changed, the error message is still the same.

sudo ./bin/installdependencies.sh

Gantline answered 23/1, 2021 at 22:9 Comment(0)
A
2

Expanding on @someone's answer, I created a quick loop to make symlinks for every one of of these renamed libraries that live in the bin directory of the github action runners. After running the installdependencies.sh script, it creates a symlink for every file that starts with "System." and appends "lib" to the original filename.

sudo ./bin/installdependencies.sh \
   && cd ./bin \
   && for lib in $(find . -name 'System.*'); do \
     toFile=$(echo "$lib" | sed -e 's/\.\/System\./.\/libSystem./g'); \
     if ! [ -f $toFile ]; then sudo ln -s $lib $toFile; fi; \
  done && cd ..
Aquilar answered 26/1, 2021 at 22:20 Comment(2)
I would make it simpler and apply only on .so files : cd bin && for i in System.*.so; do [ -e lib$i ] || sudo ln -s $i lib$i; doneToh
There are files that were renamed that do not use the extension .so, but I do like the other optimizations you made. Thanks!Aquilar
S
20

When you are selecting your runner ensure that you are using the correct image for where it is being executed.

enter image description here

Spratt answered 20/7, 2022 at 11:27 Comment(2)
I can't believe I made this mistake.Spake
Same here, Was trying to install macOS runner on Linux. Thanks for help.Duteous
H
6

Following command helped in my case:

sudo chown -R $(id -u):$(id -g) $PWD
Hammered answered 3/4, 2023 at 10:16 Comment(1)
Works like a charm for me ( ubuntu 23 )Testaceous
N
3

The above solutions did not work for me, I installed an older version instead 2.276.1. For a linux 64-bit OS the curl command is:

curl -O -L https://github.com/actions/runner/releases/download/v2.276.1/actions-runner-linux-x64-2.276.1.tar.gz
Nostology answered 3/3, 2021 at 16:50 Comment(0)
G
2

The problem is related to the .NET dependency. The GitHub runner uses the 3.x version while the latest (and what I had installed) is 5. In the newer version, those libraries are renamed without the preceding "lib". More details on that here

.NET 3.x:

libSystem.Security.Cryptography.Native.OpenSsl.so
libSystem.IO.Compression.Native.so

.NET 5.x

System.Security.Cryptography.Native.OpenSsl.so
System.IO.Compression.Native.so

Solutions:

1 - Install .NET 3.x Installation guide

2 - Crete a symlink to access the newer through the old one:

ln -s /usr/share/dotnet/shared/Microsoft.NETCore.App/5.0.1/libSystem.Security.Cryptography.Native.OpenSsl.so /usr/share/dotnet/shared/Microsoft.NETCore.App/3.1.10/libSystem.Security.Cryptography.Native.OpenSsl.so

ln -s /usr/share/dotnet/shared/Microsoft.NETCore.App/5.0.1/libSystem.Security.Cryptography.Native.OpenSsl.a /usr/share/dotnet/shared/Microsoft.NETCore.App/3.1.10/libSystem.Security.Cryptography.Native.OpenSsl.a
Gantline answered 24/1, 2021 at 16:44 Comment(0)
A
2

Expanding on @someone's answer, I created a quick loop to make symlinks for every one of of these renamed libraries that live in the bin directory of the github action runners. After running the installdependencies.sh script, it creates a symlink for every file that starts with "System." and appends "lib" to the original filename.

sudo ./bin/installdependencies.sh \
   && cd ./bin \
   && for lib in $(find . -name 'System.*'); do \
     toFile=$(echo "$lib" | sed -e 's/\.\/System\./.\/libSystem./g'); \
     if ! [ -f $toFile ]; then sudo ln -s $lib $toFile; fi; \
  done && cd ..
Aquilar answered 26/1, 2021 at 22:20 Comment(2)
I would make it simpler and apply only on .so files : cd bin && for i in System.*.so; do [ -e lib$i ] || sudo ln -s $i lib$i; doneToh
There are files that were renamed that do not use the extension .so, but I do like the other optimizations you made. Thanks!Aquilar
T
0

It was not at install time, but I got the same error when tried to start the action-runner as a service.

In my case the action-runner had to be run by root, so it was installed in a root owned folder. As I have found out after some debugging the svc.sh script will install the service to be run with the user in the SUDO_USER even if the install was run as root.

So if you want the service to be run as root you need to explicitly tell this to the installer:

./svc.sh install root

Using the optional user argument described at docs.github.com

Theatre answered 11/9, 2023 at 13:7 Comment(0)
M
-1

As seen in the this:

screenshot

If you created the action-runner with the sudo command, permissions will be different. I get the same error as above in the action-runner1 but no error in action-runner2. Don't use sudo while creating the folder action-runner.

Manganese answered 3/1, 2023 at 7:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.