"unexpected error claiming task" when running self-hosted runner

Hi,
We have been successfully running a self-hosted runner on our infrastructure for about two years. However, it suddenly stopped working on Thursday 2024-10-17.
The runner is running as a docker container and we get the following error in the logs every 10 seconds:

time="2024-10-17T11:47:05Z" level=error msg="error running task" error="unexpected error claiming task: server supplied detail: https://runner.circleci.com/api/v3/runner/claim (301-Moved Permanently)"

I can reproduce the issue when running a container from my local machine with a new token.

The docker compose file used to run the container is the following (we use the latest image from CircleCI):

---
services:
  runner:
    image: circleci/runner:launch-agent
    restart: unless-stopped
    env_file: circleci.env

And the circle.env content is:

CIRCLECI_RESOURCE_CLASS=org_name/resource_name
CIRCLECI_API_TOKEN=the_api_token

I opened a support ticket but got no answer for the time being. Can someone please help us here?

1 Like

Same issue for me, autoscale AWS runner based on circleci website blog/autoscale-self-hosted-runners-aws/ which has been working great for the past ~6 months until this week.

Just got a response from CircleCI support to indicate that we are using a deprecated solution. Read the message below.

I will post later on how we replace this deprecated solution.

After reviewing the logs, it appears that your runner is attempting to access an endpoint that was deprecated on April 30, 2024 . We have extended the support for this endpoint until the end of August to assist you during this transition period.

To mitigate this issue and ensure continued seamless operation, we recommend migrating from the launch agent to Machine Runner 3.0 . Please follow the appropriate migration guide based on your operating system:
​

We have communicated the deprecation through various channels to keep our users informed:
​

Additionally, we will conduct a brownout from July 31st, 9 AM PST to August 1st, 9 AM PST (24 hours) to ensure all users are aware of the upcoming end-of-life.

CircleCI Status - Brownout: Deprecation Notice for Runner Launch Agent 1.1 variants

We have sent notifications regarding this deprecation on the following dates:

  • March 29, 2024
  • April 25, 2024
  • July 19, 2024
  • July 29, 2024
1 Like

Migration was simple, I followed the instructions from the article Install machine runner 3.0 on Docker.
The new docker-compose.yml file is:

---
services:
  runner:
    image: circleci/runner-agent:machine-3
    restart: unless-stopped
    env_file: circleci.env

And the circleci.env file:

CIRCLECI_RUNNER_NAME=any_runner_name
CIRCLECI_RUNNER_API_AUTH_TOKEN=the_api_token

After launching the container, it is visible in the " Self-Hosted Runners" page on the CircleCI UI

Thanks,

I’m not able to share links, so you’ll need to build based on prepending with circleci and github below.

In my case it was a bit more complicated, basically the instructions at /blog/autoscale-self-hosted-runners-aws/ assume the no longer supported version of the runner, especially the content at github /sebastian-lerner/nodejs-circleci-runner/blob/main/aws_config/install_runner_ubuntu.sh

I was able to get things going again by sequencing in the changes from circleci docs/install-machine-runner-3-on-linux/ and replacing relevant content from

Key changes from previous:

  1. Default workdir has changed from /opt to /var
  2. Runner now runs as a dedicated “circleci” account instead of root. This necessitates "ExecStopPost=+shutdown -h" in the service file with leading “+” to run shutdown as root.
  3. Config files have changed location.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.