tcardonne / docker-github-runner

Run GitHub Actions on self-hosted runner using Docker.
MIT License
297 stars 124 forks source link

curl: (22) The requested URL returned error: 404 #51

Open chanyshev opened 2 years ago

chanyshev commented 2 years ago

I run using docker-compose and get an error.


runner_1  | curl: (22) The requested URL returned error: 404 
runner_1  | Unrecognized command-line input arguments: 'token'. For usage refer to: .\config.cmd --help or ./config.sh --help
runner_1  | 
runner_1  | --------------------------------------------------------------------------------
runner_1  | |        ____ _ _   _   _       _          _        _   _                      |
runner_1  | |       / ___(_) |_| | | |_   _| |__      / \   ___| |_(_) ___  _ __  ___      |
runner_1  | |      | |  _| | __| |_| | | | | '_ \    / _ \ / __| __| |/ _ \| '_ \/ __|     |
runner_1  | |      | |_| | | |_|  _  | |_| | |_) |  / ___ \ (__| |_| | (_) | | | \__ \     |
runner_1  | |       \____|_|\__|_| |_|\__,_|_.__/  /_/   \_\___|\__|_|\___/|_| |_|___/     |
runner_1  | |                                                                              |
runner_1  | |                       Self-hosted runner registration                        |
runner_1  | |                                                                              |
runner_1  | --------------------------------------------------------------------------------
runner_1  | 
runner_1  | # Authentication
runner_1  | 
runner_1  | Invalid configuration provided for token. Terminating unattended configuration.
runner_1  | .path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
runner_1  | Starting Runner listener with startup type: service
runner_1  | Started listener process
runner_1  | Started running service
runner_1  | An error occurred: Not configured
runner_1  | Runner listener exited with error code 2
runner_1  | Runner listener exit with retryable error, re-launch runner in 5 secon```

cat .env
```RUNNER_REPOSITORY_URL=https://github.com/company-name/repo-name
# or RUNNER_ORGANIZATION_URL=https://github.com/your-organization
GITHUB_ACCESS_TOKEN=ghp_******```
marcofranssen commented 2 years ago

This is how I run it with plain Docker. Just make sure to set the correct environment variables.

docker run -it --name my-runner \
    -e RUNNER_LABELS=selfhosted,ubuntu-docker \
    -e RUNNER_NAME=selfhosted-ubuntu-docker \
    -e GITHUB_ACCESS_TOKEN=«my-pat-with-sufficient-permissions-for-repo» \
    -e RUNNER_REPOSITORY_URL=https://github.com/«my-org»/«my-repo» \
    -v /var/run/docker.sock:/var/run/docker.sock \
    tcardonne/github-runner:ubuntu-20.04

You might get the 404 because the token does not give access to the given private repo.

How does your docker-compose look like?