【问题标题】:Can't install GitHub actions runner on linux无法在 Linux 上安装 GitHub 操作运行程序
【发布时间】:2021-04-28 02:07:38
【问题描述】:

我正在尝试按照 repo>settings>Actions>add runner 中描述的步骤在我的 Linux 机器(Ubuntu 20.04.1 LTS)上安装 GitHub 运行程序。第一步工作正常,但是当我运行配置时:

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

我收到以下失败消息:

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 不允许用户以 sudo 执行它,所以我修改了脚本以允许这样做,但权限问题仍然存在。有什么想法吗?

更新:我还通过在 /actions-runner 目录中运行以下命令安装了依赖项,没有任何改变,错误消息仍然相同。

sudo ./bin/installdependencies.sh

【问题讨论】:

    标签: linux github github-actions github-actions-self-hosted-runners


    【解决方案1】:

    上述解决方案对我不起作用,我安装了旧版本而不是2.276.1。对于 linux 64 位操作系统,curl 命令是:

    curl -O -L https://github.com/actions/runner/releases/download/v2.276.1/actions-runner-linux-x64-2.276.1.tar.gz
    

    【讨论】:

      【解决方案2】:

      扩展@someone 的答案,我创建了一个快速循环,为这些重命名的库中的每一个创建符号链接,这些库位于 github 操作运行器的 bin 目录中。运行 installdependencies.sh 脚本后,它会为每个以“System”开头的文件创建一个符号链接。并将“lib”附加到原始文件名。

      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 ..
      

      【讨论】:

      • 我会让它更简单,只适用于 .so 文件:cd bin && for i in System.*.so; do [ -e lib$i ] || sudo ln -s $i lib$i; done
      • 有些重命名的文件不使用扩展名 .so,但我确实喜欢您所做的其他优化。谢谢!
      【解决方案3】:

      问题与 .NET 依赖项有关。 GitHub 运行器使用 3.x 版本,而最新版本 (和我安装的)是 5。在较新的版本中,这些库在没有前面的“lib”的情况下被重命名。更多详情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
      

      解决方案:

      1 - 安装 .NET 3.x Installation guide

      2 - 创建一个符号链接以通过旧链接访问新链接:

      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
      

      【讨论】:

        猜你喜欢
        • 2020-10-09
        • 1970-01-01
        • 1970-01-01
        • 2022-11-10
        • 2021-04-28
        • 2022-11-28
        • 2017-12-09
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多