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

The runner auto upgrade faild after download three times. #442

Closed
ailncode opened this issue Apr 22, 2020 · 8 comments
Closed

The runner auto upgrade faild after download three times. #442

ailncode opened this issue Apr 22, 2020 · 8 comments
Labels
Runner Auto-update 😞 Runner Bug Bug fix scope to the runner

Comments

@ailncode
Copy link

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:
1.The runner auto update when my CI/CD job start
2.It's download package faild three times.(My runner in china server,the net speed is very slow when download package.)
3.The runner exit and my CI/CD job wait forever^_^.
Expected behavior
I think my CI/CD job is the more important than update.
I want close auto update for the runner.

Runner Version and Platform

v2.168.0
OS of the machine running the runner? OSX/Windows/Linux/...
Linux

What's not working?

Job Log Output

If applicable, include the relevant part of the job / step log output here. All sensitive information should already be masked out, but please double-check before pasting here.

Runner and Worker's Diagnostic Logs

[2020-04-22 06:40:32Z INFO RSAFileKeyManager] Loading RSA key parameters from file /home/github-runner/tssns.backend.runner/.credentials_rsaparams
[2020-04-22 06:40:33Z INFO GitHubActionsService] AAD Correlation ID for this token request: Unknown
[2020-04-22 06:43:55Z INFO MessageListener] No message retrieved from session 'f25a2900-b46b-4736-b564-f735c0569aef' within last 30 minutes.
[2020-04-22 06:45:22Z WARN SelfUpdater] Runner download has timed out after 900 seconds
[2020-04-22 06:45:22Z WARN SelfUpdater] Failed to get package '/home/github-runner/tssns.backend.runner/_work/_update/runner1.tar.gz' from 'https://github.com/actions/runner/releases/download/v2.169.0/actions-runner-linux-x64-2.169.0.tar.gz'. Exception System.Threading.Tasks.TaskCanceledException: The operation was canceled.
---> System.IO.IOException: Unable to read data from the transport connection: Operation canceled.
---> System.Net.Sockets.SocketException (125): Operation canceled
--- End of inner exception stack trace ---
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.GetResult(Int16 token)
at System.Net.Security.SslStream.g__InternalFillBufferAsync|215_0[TReadAdapter](TReadAdapter adap, ValueTask1 task, Int32 min, Int32 initial) at System.Net.Security.SslStream.ReadAsyncInternal[TReadAdapter](TReadAdapter adapter, Memory1 buffer)
at System.Net.Http.HttpConnection.FillAsync()
at System.Net.Http.HttpConnection.CopyToContentLengthAsync(Stream destination, UInt64 length, Int32 bufferSize, CancellationToken cancellationToken)
at System.Net.Http.HttpConnection.ContentLengthReadStream.CompleteCopyToAsync(Task copyTask, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Net.Http.HttpConnection.ContentLengthReadStream.CompleteCopyToAsync(Task copyTask, CancellationToken cancellationToken)
at GitHub.Runner.Listener.SelfUpdater.DownloadLatestRunner(CancellationToken token)
[2020-04-22 06:45:22Z INFO JobDispatcher] Shutting down JobDispatcher. Make sure all WorkerDispatcher has finished.
[2020-04-22 06:45:23Z ERR Terminal] WRITE ERROR: An error occurred: Runner package '/home/github-runner/tssns.backend.runner/_work/_update/runner1.tar.gz' failed after 3 download attempts
[2020-04-22 06:45:23Z ERR Listener] System.Threading.Tasks.TaskCanceledException: Runner package '/home/github-runner/tssns.backend.runner/_work/_update/runner1.tar.gz' failed after 3 download attempts
at GitHub.Runner.Listener.SelfUpdater.DownloadLatestRunner(CancellationToken token)
at GitHub.Runner.Listener.SelfUpdater.SelfUpdate(AgentRefreshMessage updateMessage, IJobDispatcher jobDispatcher, Boolean restartInteractiveRunner, CancellationToken token)
at GitHub.Runner.Listener.Runner.RunAsync(RunnerSettings settings, Boolean runOnce)
at GitHub.Runner.Listener.Runner.RunAsync(RunnerSettings settings, Boolean runOnce)
at GitHub.Runner.Listener.Runner.RunAsync(RunnerSettings settings, Boolean runOnce)
at GitHub.Runner.Listener.Runner.ExecuteCommand(CommandSettings command)
at GitHub.Runner.Listener.Program.MainAsync(IHostContext context, String[] args)

@ailncode ailncode added the bug Something isn't working label Apr 22, 2020
@jcleira
Copy link

jcleira commented Apr 22, 2020

Happened to me too
Fixed by manually updating, in my case:

cd actions-runner
curl -O -L https://github.com/actions/runner/releases/download/v2.169.1/actions-runner-linux-x64-2.169.1.tar.gz
tar xzf ./actions-runner-linux-x64-2.169.1.tar.gz

@ailncode
Copy link
Author

ailncode commented Apr 26, 2020

CI/CD must be an automation process.
But, I need fixed it by manually every times when the runner need upgrade.
I think the CI/CD jobs is more important than upgrade.

@ailncode ailncode changed the title auto update faild The runner auto upgrade faild after download three times. Apr 27, 2020
@TingluoHuang
Copy link
Member

@ailncode, @jcleira how long does it take for you to download the runner package using CURL or browser? the timeout on download is 15 minutes in the runner.

@ailncode
Copy link
Author

ailncode commented Apr 30, 2020

@TingluoHuang I'm not sure. some times it's very fast(50kB/s) and some times it's very slow(0kB/s).
and GFW may be disconnect the download...

curl -O -L https://github.com/actions/runner/releases/download/v2.169.1/actions-runner-linux-arm64-2.169.1.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 654 100 654 0 0 213 0 0:00:03 0:00:03 --:--:-- 213
0 53.5M 0 509k 0 0 6845 0 2:16:38 0:01:16 2:15:22 6691

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 654 100 654 0 0 213 0 0:00:03 0:00:03 --:--:-- 213
1 53.5M 1 1087k 0 0 3973 0 3:55:25 0:04:40 3:50:45 0

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 654 100 654 0 0 213 0 0:00:03 0:00:03 --:--:-- 213
2 53.5M 2 1240k 0 0 1376 0 11:19:44 0:15:23 11:04:21 0

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 654 100 654 0 0 213 0 0:00:03 0:00:03 --:--:-- 213
2 53.5M 2 1240k 0 0 1050 0 14:50:46 0:20:08 14:30:38 0
curl: (56) GnuTLS recv error (-54): Error in the pull function.

What can i do?

@shoukoo
Copy link

shoukoo commented May 15, 2020

@TingluoHuang I am also having an issue when the runner auto-upgrades from version 2.169.1 to 2.262.1.

ay 15 19:30:13 ip-172-27-42-xx runner.sh[2839]: Runner update in progress, do not shutdown runner.
May 15 19:30:13 ip-172-27-42-xx runner.sh[2839]: Downloading 2.262.1 runner
May 15 19:30:21 ip-172-27-42-xx runner.sh[2839]: Waiting for current job finish running.
May 15 19:30:21 ip-172-27-42-xx runner.sh[2839]: Generate and execute update script.
May 15 19:30:21 ip-172-27-42-xx runner.sh[2839]: Runner will exit shortly for update, should back online within 10 seconds.
May 15 19:30:21 ip-172-27-42-xx runner.sh[2839]: /home/runner/_work/_update.sh: line 31: nul: Permission denied
May 15 19:30:21 ip-172-27-42-xx runner.sh[2839]: /home/runner/_work/_update.sh: line 31: nul: Permission denied
May 15 19:30:21 ip-172-27-42-xx runner.sh[2839]: /home/runner/_work/_update.sh: line 31: nul: Permission denied
May 15 19:30:21 ip-172-27-42-xx runner.sh[2839]: /home/runner/_work/_update.sh: line 31: nul: Permission denied

This is in the _update.sh

# wait for runner process to exit.
date "+[%F %T-%4N] Waiting for $runnerprocessname ($runnerpid) to complete" >> "$logfile" 2>&1
while [ -e /proc/$runnerpid ]
do
    date "+[%F %T-%4N] Process $runnerpid still running" >> "$logfile" 2>&1
    ping -c 2 127.0.0.1 >nul
done
date "+[%F %T-%4N] Process $runnerpid finished running" >> "$logfile" 2>&1

# start re-organize folders
date "+[%F %T-%4N] Sleep 1 more second to make sure process exited" >> "$logfile" 2>&1
ping -c 2 127.0.0.1 >nul

Is there a flag to prevent the runner from auto-upgrading itself?

@TingluoHuang
Copy link
Member

@shoukoo for your error nul: Permission denied, please check https://unix.stackexchange.com/a/146639

@TingluoHuang TingluoHuang added runner Runner Auto-update 😞 Runner Bug Bug fix scope to the runner and removed bug Something isn't working runner labels Jun 8, 2020
@pjmartorell
Copy link

@shoukoo for your error nul: Permission denied, please check https://unix.stackexchange.com/a/146639

This nul bug was fixed #647

fgalind1 added a commit to fgalind1/runner that referenced this issue Oct 28, 2021
When using infrastructure as code, containers and recipes, pinning
versions for reproducibility is a good practice. Usually docker
container images contain static tools and binaries and the docker image
is tagged with a specific version.

Constructing a docker image of a runner with a specific runner version
and then self-updating itself doesn't seem that natural, instead the
docker image should use whatever that binary was built/tagged to.

Additionally to this - this concept doesn't play well when using
ephemeral runners and kuberentes. First of all, we need to pay the price
of downloading/self-updating every single ephemeral pod for every single
job which causes delays in execution. Secondly this doesn't work well
and containers may get stuck

Related issues that will be solved with this:
- actions#1396
- actions#246
- actions#485
- actions#422
- actions#442
fgalind1 added a commit to fgalind1/runner that referenced this issue Oct 28, 2021
When using infrastructure as code, containers and recipes, pinning
versions for reproducibility is a good practice. Usually docker
container images contain static tools and binaries and the docker image
is tagged with a specific version.

Constructing a docker image of a runner with a specific runner version
and then self-updating itself doesn't seem that natural, instead the
docker image should use whatever that binary was built/tagged to.

Additionally to this - this concept doesn't play well when using
ephemeral runners and kuberentes. First of all, we need to pay the price
of downloading/self-updating every single ephemeral pod for every single
job which causes delays in execution. Secondly this doesn't work well
and containers may get stuck

Related issues that will be solved with this:
- actions#1396
- actions#246
- actions#485
- actions#422
- actions#442
@thboop
Copy link
Collaborator

thboop commented Jan 28, 2022

Closing as this issue was fixed, if you see it again please comment in this issue and we can reopen.

Work to disable auto-update is being tracked here and in progress: #485

@thboop thboop closed this as completed Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Runner Auto-update 😞 Runner Bug Bug fix scope to the runner
Projects
None yet
Development

No branches or pull requests

6 participants