Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action Runner service setup on RHEL9.2 fails #3222

Open
atos-ghassen-bchir opened this issue Mar 29, 2024 · 6 comments · May be fixed by #3320
Open

Action Runner service setup on RHEL9.2 fails #3222

atos-ghassen-bchir opened this issue Mar 29, 2024 · 6 comments · May be fixed by #3320
Labels
bug Something isn't working

Comments

@atos-ghassen-bchir
Copy link

Describe the bug
I tried to deploy an action runner on an RHEL9.2 machine.
Running the service manually (using both run.sh and run_svc.sh scripts) seems to be working correctly (runner showing as Idle on Github).
However, using the svc.sh util script leads to a failed runner service.

To Reproduce
Steps to reproduce the behavior:

  1. On the organisation settings page, I add a new self-hosted runner (under "Runners/Create self-hosted runner")
  2. I run the steps showing under the "Download" section (for x64 architectures), everything is OK
  3. I run the steps showing under the "Configure" section
  4. Running ./run.sh is OK (runner Idle)
  5. Running sudo ./runsvc.sh is OK (runner Idle)
  6. I ran sudo ./svc.sh install and sudo ./svc.sh start
  7. sudo ./svc.sh status shows that the service is in a failed status, with the following error stack
my-runner systemd[1]: Started GitHub Actions Runner (GLB-BDS-AI-ProactiveMaintenance.my-runner).
my-runner runsvc.sh[2212]: .path=/home/ci_agent/.local/bin:/home/ci_agent/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/usr/bin/mvn/bin
my-runner runsvc.sh[2215]: #
my-runner runsvc.sh[2215]: # Fatal error in , line 0
my-runner runsvc.sh[2215]: # Check failed: reservation_.SetPermissions(protect_start, protect_size, permission).
my-runner runsvc.sh[2215]: #
my-runner runsvc.sh[2215]: #
my-runner runsvc.sh[2215]: #
my-runner runsvc.sh[2215]: #FailureMessage Object: 0x7ffdf6e78670
my-runner runsvc.sh[2215]:  1: 0xb72001  [./externals/node16/bin/node]
my-runner runsvc.sh[2215]:  2: 0x1bfa314 V8_Fatal(char const*, ...) [./externals/node16/bin/node]
my-runner runsvc.sh[2215]:  3: 0xef47d7  [./externals/node16/bin/node]
my-runner runsvc.sh[2215]:  4: 0xf076e8 v8::internal::PagedSpace::SetReadAndExecutable() [./externals/node16/bin/node]
my-runner runsvc.sh[2215]:  5: 0xe31048 v8::internal::Isolate::Init(v8::internal::SnapshotData*, v8::internal::SnapshotData*, bool) [./externals/node16/bin/node]
my-runner runsvc.sh[2215]:  6: 0x123e2e6  [./externals/node16/bin/node]
my-runner runsvc.sh[2215]:  7: 0xd06f4e v8::Isolate::Initialize(v8::Isolate*, v8::Isolate::CreateParams const&) [./externals/node16/bin/node]
my-runner runsvc.sh[2215]:  8: 0xb4a69f node::NodeMainInstance::NodeMainInstance(node::SnapshotData const*, uv_loop_s*, node::MultiIsolatePlatform*, std::vector<std::string, std::alloc>
my-runner runsvc.sh[2215]:  9: 0xaccbc3 node::Start(int, char**) [./externals/node16/bin/node]
my-runner runsvc.sh[2215]: 10: 0x7fa36ac3feb0  [/lib64/libc.so.6]
my-runner runsvc.sh[2215]: 11: 0x7fa36ac3ff60 __libc_start_main [/lib64/libc.so.6]
my-runner runsvc.sh[2215]: 12: 0xa408ec  [./externals/node16/bin/node]
my-runner systemd-coredump[2222]: [🡕] Process 2215 (node) of user 1000 dumped core.

Expected behavior
Runner should be Idle and service should be active.

Runner Version and Platform

actions-runner-linux-x64-2.314.1.tar.gz

OS of the machine running the runner? RHEL9.2

Notes

  • The directory where the actions-runner is located belongs to the current user
  • run.sh and runsvc.sh do not run the runner svc in the backgroud, so having the svc.sh script to work is crucial...
@atos-ghassen-bchir atos-ghassen-bchir added the bug Something isn't working label Mar 29, 2024
@kashyapshani
Copy link

Facing the same issue

@lastro189
Copy link

you can try this
chcon system_u:object_r:usr_t:s0 runsvc.sh

@YugoHino
Copy link

I'm facing the same issue with my RHEL9.4 on AWS as well. chcon system_u:object_r:usr_t:s0 runsvc.sh is not working for me due to permission error even if it's with sudo. Instead, this is high risk but after sudo setenforce 0 command, sudo ./svc.sh start is completed without any errors. However, the status of the runner is offline on runners list in the repository setting section. I still cannot use svc.sh on RHEL9.

@kashyapshani
Copy link

kashyapshani commented Jun 18, 2024

You can try edit service file of the runner service by adding "/bin/bash" in ExecStart as mentioned in the example below which worked for me in RHEL 9 on AWS:

[Service]
ExecStart=/bin/bash /home/ec2-user/actions-runner/runsvc.sh
User=ec2-user
WorkingDirectory=/home/ec2-user/actions-runner
KillMode=process
KillSignal=SIGTERM
TimeoutStopSec=5min

@YugoHino
Copy link

Unfortunately, still not working for me.
I edited the file which is /etc/systemd/syste/actions.runner.<my runner>.service as you shared, and did following command for applying it. But not working yet.

sudo systemctl daemon-reload
sudo systemctl restart <the file>

The command /bin/bash /home/ec2-user/actions-runner/runsvc.sh is working, and then the status of the runner is Idle. But sudo ./svc.sh start is not working.

@YugoHino
Copy link

I figured out the reason and resolved it. My server is behind a proxy and there is http_proxy and https_proxy settings in /etc/environment. So, when I add EnvironmentFile=/etc/environment in the service directive, the runner is working without errors.

[Service]
ExecStart=/home/ec2-user/actions-runner/runsvc.sh
User=ec2-user
WorkingDirectory=/home/ec2-user/actions-runner
KillMode=process
KillSignal=SIGTERM
TimeoutStopSec=5min
EnvironmentFile=/etc/environment

Also, to add the settings both http_proxy and https_proxy to .env file in the actions-runner directory is working as well with running sudo ./svc.sh start.
Even when those proxy settings are in /etc/environment, those are not working without those.

Even in both options, sudo setenforce 0 is necessary, otherwise there are permission errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants