Unhandled Errno::ETIMEDOUT error when no access to GitLab.com
Gitlab::Ci::RunnerReleases#releases tries to fetch the GitLab Runner releases JSON file from GitLab.com in order to be able to determine which versions need updating, but in some cases, self-hosted instances are firewalled in such a way the access is not possible. Although !92431 (merged) fixed a scenario which was raising the Net::OpenTimeout error, this customer report mentions an instance where a different error is raised (Errno::ETIMEDOUT), which is not currently handled.
https://gitlab.zendesk.com/agent/tickets/311389
Steps to reproduce
- Install GitLab 15.2.
- Add an Ultimate license
- Drop outbound connections to
gitlab.com:443. - Register a runner.
- Access the
/admin/runnerspage.
What is the current bug behavior?
Runners are not listed and the error Something went wrong while fetching runner data is shown.
What is the expected correct behavior?
Runners should be listed even if GitLab can't fetch the GitLab Runner versions.
Relevant logs and/or screenshots
Logs:
Timeout when trying to get the runner releases:
{
"severity": "ERROR",
"time": "2022-08-02T10:30:51.256Z",
"correlation_id": "01G9F1Q769EKBJ96BMR4JYME5C",
"exception.class": "Errno::ETIMEDOUT",
"exception.message": "Failed to open TCP connection to 172.65.251.78:443 (Connection timed out - connect(2) for \"172.65.251.78\" port 443)",
"exception.backtrace": [
"lib/gitlab/net_http_adapter.rb:21:in `connect'",
"lib/gitlab/http.rb:54:in `perform_request'",
"lib/gitlab/http.rb:74:in `try_get'",
"lib/gitlab/ci/runner_releases.rb:29:in `block in releases'",
"lib/gitlab/ci/runner_releases.rb:23:in `releases'",
"lib/gitlab/ci/runner_upgrade_check.rb:12:in `check_runner_upgrade_status'",
"ee/app/graphql/ee/types/ci/runner_type.rb:26:in `upgrade_status'",
...
