CrowdSec doesn't install - Cannot create task get-name

i reinstall the whole ns8 system because of root disk full, this is fine now. But if i try to install crowdsec i got an error


the service did not start. Logs says:
2024-05-11T13:57:33+02:00 [1:crowdsec1:podman] 2024-05-11 13:57:33.709609986 +0200 CEST m=+0.180785514 volume remove 2a55562d9c51261cc6a72238b8a0433249e44c287930a57cc0c76f02c91bbfbc
2024-05-11T13:57:33+02:00 [1:crowdsec1:agent@crowdsec1] task/module/crowdsec1/9e62616a-845d-4cf0-865d-8a01f4f19b7d: action “run-backup” status is “completed” (0) at step 50start_service_unit
2024-05-11T14:00:43+02:00 [1:crowdsec1:agent@crowdsec1] task/module/crowdsec1/1c2e6d7e-c764-4fc8-81e3-eca65cbefb6c: destroy-module/50destroy is starting
2024-05-11T14:00:43+02:00 [1:crowdsec1:agent@crowdsec1] task/module/crowdsec1/1c2e6d7e-c764-4fc8-81e3-eca65cbefb6c: destroy-module/50remove-systemd-service is starting
2024-05-11T14:00:43+02:00 [1:crowdsec1:agent@crowdsec1] Failed to disable unit: Unit file crowdsec1.service does not exist.
2024-05-11T14:00:43+02:00 [1:crowdsec1:agent@crowdsec1] task/module/crowdsec1/1c2e6d7e-c764-4fc8-81e3-eca65cbefb6c: action “destroy-module” status is “aborted” (1) at step 50remove-systemd-service

it is also not possible to deinstall, because the system says it is not installed… weird

Any ideas?

Is it really still installed? Maybe the browser page needs to be reloaded…

Maybe it’s possible to uninstall from CLI:

remove-module --no-preserve crowdsec1

There’s also a force option but dangerous:

--force        unconditionally erase the module from Redis (dangerous)

To be able to understand what’s going on we also need logs from the cluster at time of (un)installation.

1 Like

remove-module --no-preserve crowdsec1
Assertion failed
File “/var/lib/nethserver/cluster/actions/remove-module/50update”, line 66, in
agent.assert_exp(destroy_module_result[‘exit_code’] == 0)

Log entry:
2024-05-11T13:57:33+02:00 [1:crowdsec1:podman] 2024-05-11 13:57:33.709609986 +0200 CEST m=+0.180785514 volume remove 2a55562d9c51261cc6a72238b8a0433249e44c287930a57cc0c76f02c91bbfbc
2024-05-11T13:57:33+02:00 [1:crowdsec1:agent@crowdsec1] task/module/crowdsec1/9e62616a-845d-4cf0-865d-8a01f4f19b7d: action “run-backup” status is “completed” (0) at step 50start_service_unit
2024-05-11T14:00:43+02:00 [1:crowdsec1:agent@crowdsec1] task/module/crowdsec1/1c2e6d7e-c764-4fc8-81e3-eca65cbefb6c: destroy-module/50destroy is starting
2024-05-11T14:00:43+02:00 [1:crowdsec1:agent@crowdsec1] task/module/crowdsec1/1c2e6d7e-c764-4fc8-81e3-eca65cbefb6c: destroy-module/50remove-systemd-service is starting
2024-05-11T14:00:43+02:00 [1:crowdsec1:agent@crowdsec1] Failed to disable unit: Unit file crowdsec1.service does not exist.
2024-05-11T14:00:43+02:00 [1:crowdsec1:agent@crowdsec1] task/module/crowdsec1/1c2e6d7e-c764-4fc8-81e3-eca65cbefb6c: action “destroy-module” status is “aborted” (1) at step 50remove-systemd-service
2024-05-11T16:17:21+02:00 [1:crowdsec1:agent@crowdsec1] task/module/crowdsec1/45aa4cfb-bf81-4a26-b581-8bbd78d6049b: destroy-module/50destroy is starting
2024-05-11T16:17:21+02:00 [1:crowdsec1:agent@crowdsec1] task/module/crowdsec1/45aa4cfb-bf81-4a26-b581-8bbd78d6049b: destroy-module/50remove-systemd-service is starting
2024-05-11T16:17:21+02:00 [1:crowdsec1:agent@crowdsec1] Failed to disable unit: Unit file crowdsec1.service does not exist.
2024-05-11T16:17:21+02:00 [1:crowdsec1:agent@crowdsec1] task/module/crowdsec1/45aa4cfb-bf81-4a26-b581-8bbd78d6049b: action “destroy-module” status is “aborted” (1) at step 50remove-systemd-service
2024-05-11T16:18:37+02:00 [1:crowdsec1:agent@crowdsec1] task/module/crowdsec1/c5f3d207-97f3-4af3-bd54-565cbe699b63: destroy-module/50destroy is starting
2024-05-11T16:18:37+02:00 [1:crowdsec1:agent@crowdsec1] task/module/crowdsec1/c5f3d207-97f3-4af3-bd54-565cbe699b63: destroy-module/50remove-systemd-service is starting
2024-05-11T16:18:37+02:00 [1:crowdsec1:agent@crowdsec1] Failed to disable unit: Unit file crowdsec1.service does not exist.
2024-05-11T16:18:37+02:00 [1:crowdsec1:agent@crowdsec1] task/module/crowdsec1/c5f3d207-97f3-4af3-bd54-565cbe699b63: action “destroy-module” status is “aborted” (1) at step 50remove-systemd-service
2024-05-11T16:18:54+02:00 [1:crowdsec1:agent@crowdsec1] task/module/crowdsec1/a033bdf0-8109-4890-ba2b-a8ec7259a685: destroy-module/50destroy is starting
2024-05-11T16:18:54+02:00 [1:crowdsec1:agent@crowdsec1] task/module/crowdsec1/a033bdf0-8109-4890-ba2b-a8ec7259a685: destroy-module/50remove-systemd-service is starting
2024-05-11T16:18:54+02:00 [1:crowdsec1:agent@crowdsec1] Failed to disable unit: Unit file crowdsec1.service does not exist.
2024-05-11T16:18:54+02:00 [1:crowdsec1:agent@crowdsec1] task/module/crowdsec1/a033bdf0-8109-4890-ba2b-a8ec7259a685: action “destroy-module” status is “aborted” (1) at step 50remove-systemd-service

it is like the installation break at one point, but i have the entry’s at the app starter, if i try to open crowdsec1 i got the error like at the beginning

i am able to install a crowdsec2 without any problem, but i am not able to uninstall the crowdsec1

Log:
Assertion failed
File “/var/lib/nethserver/cluster/actions/remove-module/50update”, line 66, in
agent.assert_exp(destroy_module_result[‘exit_code’] == 0)

Failed to disable unit: Unit file crowdsec1.service does not exist.

It seems the uninstall fails because of a missing service.

Are there still crowdsec services?

systemctl status crowdsec*

I don’t know if it’s the right way but when crowdsec2 is working and you have a backup/snapshot you could try to force the removal of crowdsec1.

remove-module --force --no-preserve crowdsec1

1 Like

also no luck
remove-module --force --no-preserve crowdsec1
Assertion failed
File “/var/lib/nethserver/cluster/actions/remove-module/50update”, line 66, in
agent.assert_exp(destroy_module_result[‘exit_code’] == 0)

Are the service files still there?

ls -l /etc/systemd/system/crowdsec*

1 Like

ls -l /etc/systemd/system/crowdsec*
-rw-r–r–. 1 root root 137 11. Mai 09:41 /etc/systemd/system/crowdsec1-upgrade-hub.timer

The service files are missing, the timer is still there.

root@contabo:~# ls -l /etc/systemd/system/crowdsec*
-rw-r--r-- 1 root root 1308 Apr 29 22:37 /etc/systemd/system/crowdsec1-firewall-bouncer.service
-rw-r--r-- 1 root root 1589 Apr 29 22:37 /etc/systemd/system/crowdsec1.service
-rw-r--r-- 1 root root  238 Apr 29 22:37 /etc/systemd/system/crowdsec1-upgrade-hub.service
-rw-r--r-- 1 root root  137 Apr 29 22:37 /etc/systemd/system/crowdsec1-upgrade-hub.timer
-rw-r--r-- 1 root root  523 Oct  2  2023 /etc/systemd/system/crowdsec-firewall-bouncer.service

Maybe it helps to recreate the missing file(s) and try to uninstall again?
The file content can be found on GitHub.

1 Like

This also did not work, i try a new installation and see how it works

1 Like

Didn’t read fully but deleting crowdsec1 user and its home folder could be another option.
EDIT: ok, possibly won’t work with a rootful app

2 Likes

tried it all but did not work, so i decide to delete the installation and renew the server, now its fine