crowdsec icon indicating copy to clipboard operation
crowdsec copied to clipboard

Can't install / run cscli on armv6l architecture (raspberry pi B) with compiled binaries

Open arthurlutz opened this issue 1 month ago • 7 comments

What happened?

Installing cscli using debian packages or releases.tgz fails on segfault

What did you expect to happen?

I would expect the wizard.sh to detect the architecture and either install the correct binary or explain to the user that this architecture is not supported.

How can we reproduce it (as minimally and precisely as possible)?

apt install cscli
[snip]
Selecting previously unselected package crowdsec.
(Reading database ... 62186 files and directories currently installed.)
Preparing to unpack .../crowdsec_1.5.2_armhf.deb ...
locale: Cannot set LC_ALL to default locale: No such file or directory
You can always run the configuration again interactively by using '/usr/share/crowdsec/wizard.sh -c
Unpacking crowdsec (1.5.2) ...
Setting up crowdsec (1.5.2) ...
locale: Cannot set LC_ALL to default locale: No such file or directory
Updating hub
/var/lib/dpkg/info/crowdsec.postinst: line 105: 30216 Segmentation fault      /usr/bin/cscli hub update
dpkg: error processing package crowdsec (--configure):
 installed crowdsec package post-installation script subprocess returned error exit status 139
Errors were encountered while processing:
 crowdsec
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@pi:~# /usr/bin/cscli 
Segmentation fault
root@pi:~# strace /usr/bin/cscli 
execve("/usr/bin/cscli", ["/usr/bin/cscli"], 0xbede1bd0 /* 31 vars */) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=NULL} ---
+++ killed by SIGSEGV +++
Segmentation fault
root@pi:~# file /usr/bin/cscli 
/usr/bin/cscli: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, BuildID[sha1]=995724f850dfe5272d1e8c4d64908082b201afe5, for GNU/Linux 3.2.0, stripped

Switched to trying with the tgz release :

wget https://github.com/crowdsecurity/crowdsec/releases/latest/download/crowdsec-release.tgz
tar xzvf crowdsec-release.tgz
cd crowdsec-v* && sudo ./wizard.sh -i
[snip]
./wizard.sh: line 687: /usr/local/bin/cscli: cannot execute binary file: Exec format error
pi@pi:~/crowdsec-v1.6.1 $ file /usr/local/bin/cscli
/usr/local/bin/cscli: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, BuildID[sha1]=61910f0fe1f76c051ddabc7dbd92b7c86e57a49b, for GNU/Linux 3.2.0, stripped
pi@pi:~/crowdsec-v1.6.1 $ uname -a
Linux pi 6.1.21+ #1642 Mon Apr  3 17:19:14 BST 2023 armv6l GNU/Linux
pi@pi:~/crowdsec-v1.6.1 $ cat /proc/cpuinfo 
processor	: 0
model name	: ARMv6-compatible processor rev 7 (v6l)
BogoMIPS	: 697.95
Features	: half thumb fastmult vfp edsp java tls 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xb76
CPU revision	: 7

Hardware	: BCM2835
Revision	: 0002
Serial		: 0000000026e833f9
Model		: Raspberry Pi Model B Rev 1

Anything else we need to know?

No response

Crowdsec version

$ cscli version
-bash: /usr/local/bin/cscli: cannot execute binary file: Exec format error
$ /usr/bin/cscli version
Segmentation fault

OS version

# On Linux:
$ cat /etc/os-release
root@pi:~# cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 12 (bookworm)"
NAME="Raspbian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

$ uname -a
Linux pi 6.1.21+ #1642 Mon Apr  3 17:19:14 BST 2023 armv6l GNU/Linux

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Enabled collections and parsers

$ cscli hub list -o raw
# paste output here

Acquisition config

```console # On Linux: $ cat /etc/crowdsec/acquis.yaml /etc/crowdsec/acquis.d/* # paste output here

On Windows:

C:> Get-Content C:\ProgramData\CrowdSec\config\acquis.yaml

paste output here

Config show

$ cscli config show
# paste output here

Prometheus metrics

$ cscli metrics
# paste output here

Related custom configs versions (if applicable) : notification plugins, custom scenarios, parsers etc.

arthurlutz avatar May 07 '24 07:05 arthurlutz