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

Problem: Cannot register new runner from both UI and cli #2673

Open
amihappy opened this issue Jan 3, 2025 · 7 comments
Open

Problem: Cannot register new runner from both UI and cli #2673

amihappy opened this issue Jan 3, 2025 · 7 comments
Assignees
Labels

Comments

@amihappy
Copy link

amihappy commented Jan 3, 2025

Issue

I'm testing new version of semaphore on my local before deployment and I'm struggling with running runnners. Following Docs i cannot register new runner,
When im doing this from UI im getting 404 on http://localhost:3000/api/project/1/runners
image

when doing this from CLI both
echo "fEEgdNEKuHWECxZEeyzwVR6gTMf32XKB6weRkrSLJARii8su" | semaphore runner register --stdin-registration-token --config semaphore_config_runner.json
and
semaphore runner register --config semaphore_config_runner.json
gives the same output

Impact

Configuration

Installation method

Binary

Database

BoltDB

Browser

Firefox, Chrome

Semaphore Version

2.10.43-7f408d8-1732293454

Ansible Version

-

Logs & errors

Loading config
Validating config
INFO[0000] Registering a new runner                     
ERRO[0000] registration token cannot be empty            action="read input" context=registration error="can not retrieve registration token" type=action
panic: runner registration failed

goroutine 1 [running]:
github.com/semaphoreui/semaphore/cli/cmd.registerRunner()
	/home/runner/work/cloud/cloud/cli/cmd/runner_register.go:41 +0xce
github.com/semaphoreui/semaphore/cli/cmd.init.func5(0xc0001a7300?, {0xcd57bf?, 0x4?, 0xcd57c3?})
	/home/runner/work/cloud/cloud/cli/cmd/runner_register.go:49 +0xf
github.com/spf13/cobra.(*Command).execute(0x1f150e0, {0xc00016ddc0, 0x2, 0x2})
	/home/runner/work/cloud/cloud/vendor/github.com/spf13/cobra/command.go:989 +0xa91
github.com/spf13/cobra.(*Command).ExecuteC(0x1f14b20)
	/home/runner/work/cloud/cloud/vendor/github.com/spf13/cobra/command.go:1117 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
	/home/runner/work/cloud/cloud/vendor/github.com/spf13/cobra/command.go:1041
github.com/semaphoreui/semaphore/cli/cmd.Execute()
	/home/runner/work/cloud/cloud/cli/cmd/root.go:57 +0xc5
main.main()
	/home/runner/work/cloud/cloud/cli/main.go:8 +0xf

Manual installation - system information

Ubuntu 24.04

Configuration

server config:

{
 	"bolt": {
 		"host": "/home/jacek/semaphore/database.boltdb"
 	},
 	"dialect": "bolt",
 	"tmp_path": "/tmp/semaphore",
 	"cookie_hash": "fPVieC8ckV+hO4bUaoSNJdJ9w4GiEW5ZwtGaOiEjLpQ=",
 	"cookie_encryption": "sIQF3rQGOuU1BgVZ6QyVBcPyUASZOOPFOlPyIAAzOJM=",
 	"access_key_encryption": "0S+Ur5uvXbVP11X8xAvDcR6nczJRcqcrzuKZdbCuDU0=",
	"use_remote_runner": true,
	"runner_registration_token": "fEEgdNEKuHWECxZEeyzwVR6gTMf32XKB6weRkrSLJARii8su"
 }

runner config:

{
 	"web_host": "localhost:3000",
 	"runner": {
 		"token_file": "/home/jacek/semaphore/token"
 	}
 }

Additional information

@fiftin fiftin self-assigned this Jan 5, 2025
@fiftin fiftin added the bug label Jan 5, 2025
@2cre8it
Copy link

2cre8it commented Jan 9, 2025

I get the exact the same error when using semaphore version 2.11.2-0e9490c-1735214524 on Ubuntu 24.04

@dkebler
Copy link

dkebler commented Jan 20, 2025

same

2.11.2-0e9490c-1735214524 on arch

this seems horrible in that you can not register any runners. I was evaluting semsphoreui but I will have to stop until this is fixed unless we can just edit the json file but I am not sure the exact key/syntax that would be added.

I wonder if you don't pay up then this is disabled because runners are disabled now in the web UI? If so why not say that in the error and say the same in the documentation. If one must now pay to enable the runner code even if self hosting then I'm sorry to say I will stop evaluating and go back to using cronicle.

https://docs.semaphoreui.com/administration-guide/runners/
echo REGISTRATION_TOKEN | semaphore runner register --stdin-registration-token --config /path/to/your/config/file.json

echo sometoken | semaphore12 runner register --stdin-registration-token --config $PWD/config.json
Loading config
Validating config
panic: runner token file required

goroutine 1 [running]:
github.com/semaphoreui/semaphore/cli/cmd.registerRunner()
	/home/runner/work/semaphore/semaphore/cli/cmd/runner_register.go:41 +0xce
github.com/semaphoreui/semaphore/cli/cmd.init.func5(0xc0001b1300?, {0xcde222?, 0x4?, 0xcde226?})
	/home/runner/work/semaphore/semaphore/cli/cmd/runner_register.go:49 +0xf
github.com/spf13/cobra.(*Command).execute(0x1fea840, {0xc0001c9680, 0x3, 0x3})
	/home/runner/work/semaphore/semaphore/vendor/github.com/spf13/cobra/command.go:989 +0xa91
github.com/spf13/cobra.(*Command).ExecuteC(0x1fea280)
	/home/runner/work/semaphore/semaphore/vendor/github.com/spf13/cobra/command.go:1117 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
	/home/runner/work/semaphore/semaphore/vendor/github.com/spf13/cobra/command.go:1041
github.com/semaphoreui/semaphore/cli/cmd.Execute()
	/home/runner/work/semaphore/semaphore/cli/cmd/root.go:56 +0xc5
main.main()
	/home/runner/work/semaphore/semaphore/cli/main.go:8 +0xf
{
 	"bolt": {
 		"host": "/data/Hacking/eval/semaphore/database.boltdb"
 	},
 	"dialect": "bolt",
 	"tmp_path": "/tmp/semaphore",
 	"cookie_hash": "xxx",
 	"cookie_encryption": "yyy",
 	"access_key_encryption": "zzz"
 }

@2cre8it
Copy link

2cre8it commented Jan 21, 2025

Hi,

After days of trial & errors I managed to get my 2x runner to succesfully register and running with the semaphore host (semaphore version 2.11.2-0e9490c-1735214524). I thought I share my findings here - hopefully it's useful for others.

When I tired to follow the instructions on https://docs.semaphoreui.com/administration-guide/runners/ in registering the runners via the web UI, I got this page on my interface that's different to the documentation's screenshot:

Image

The red banner "Project Runners available only in PRO version" actually put me off - I misunderstood this message and thought I'm unable to register runners through the GUI (!)

But in fact clicking onto the "New Runner" button works:

Image

So I filled in my runner's information (I didn't have any webhooks so I left that blank). After that I clicked "Create". I ended up getting a window that looks similar to the documentation:

Image

I copied the token value from the output and stored it on the runner under /etc/semaphore/semaphore-runner.token. The path of the token file doesn't really matter, as long as it's referenced correctly in the runner's configuration file, and it set with sufficient permission so that user account that executes the semaphore process (hopefully not root!) can read it.

I then created configuration file /etc/semaphore/config.json with the following content:

{
    "tmp_path": "<path of which palybooks and inventory files are stored on the runner>",
    "web_host": "<URL of the semaphore host - /api is not required to be specified anymore>",
    "runner": {
        "token_file": "/etc/semaphore/semaphore-runner.token"
    }
}

Finally I start the semaphore process on the runner:

semaphore runner start --config /etc/semaphore/config.json

Voila! It worked.

I did not have any luck in getting the runners to register using the "original" (CLI) way (this method - the only method - worked when I was using Semaphore 2.10.22), but at least I can confirm the Web UI way does work.

@dkebler
Copy link

dkebler commented Jan 22, 2025

@2cre8it I have the exact same version/release 2.11.2-0e9490c-1735214524
and there is NO "new runner" button. :(.

Image

@bernd-mueller-el
Copy link

@dkebler
at the bottom left, there is your actual login user and clicking on that will show up a menu. In this menu there you choose runner and there you will find the "New Runner" button.

@dkebler
Copy link

dkebler commented Jan 23, 2025

@dkebler at the bottom left, there is your actual login user and clicking on that will show up a menu. In this menu there you choose runner and there you will find the "New Runner" button.

no there is no such button there either. In this discussion that was already suggested and per the image I supplied it is not there.

#2702 (reply in thread)

@bernd-mueller-el
Copy link

OK, sorry, for me this works and I'am using the same version. But then someone with more knowledge have to look at this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants