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

Fleetctl preview not working on Raspberry Pi 4 with arm64 OS #4430

Closed
mveplus opened this issue Mar 3, 2022 · 6 comments
Closed

Fleetctl preview not working on Raspberry Pi 4 with arm64 OS #4430

mveplus opened this issue Mar 3, 2022 · 6 comments
Labels
bug Something isn't working as documented :reproduce Involves documenting reproduction steps in the issue

Comments

@mveplus
Copy link

mveplus commented Mar 3, 2022

Fleet version: v4.10.0
Fleet tier: Free
User role: N/A running with sudo i.e.

Operating system :

Distributor ID:	Raspbian
Description:	Raspbian GNU/Linux 10 (buster)
Release:	10
Codename:	buster

Raspberry Pi 4 8G Ram CPU:

Architecture:        armv7l
Byte Order:          Little Endian
CPU(s):              4
On-line CPU(s) list: 0-3
Thread(s) per core:  1
Core(s) per socket:  4
Socket(s):           1
Vendor ID:           ARM
Model:               3
Model name:          Cortex-A72
Stepping:            r0p3
CPU max MHz:         1500.0000
CPU min MHz:         600.0000
BogoMIPS:            108.00
Flags:               half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32

Web browser (e.g. Chrome 88.0.4324): N/A

🧑‍💻  Expected behavior

sudo fleetctl preview
/usr/lib/node_modules/fleetctl/install/v4.10.0/fleetctl: 2: /usr/lib/node_modules/fleetctl/install/v4.10.0/fleetctl: Syntax error: end of file unexpected (expecting ")")

To successfully start fleetctl preview and be able to connect on the management port in a browser.

💥  Actual behavior

sudo fleetctl preview
/usr/lib/node_modules/fleetctl/install/v4.10.0/fleetctl: 2: /usr/lib/node_modules/fleetctl/install/v4.10.0/fleetctl: Syntax error: end of file unexpected (expecting ")")

sudo fleetctl --version
/usr/lib/node_modules/fleetctl/install/v4.10.0/fleetctl: 2: /usr/lib/node_modules/fleetctl/install/v4.10.0/fleetctl: Syntax error: end of file unexpected (expecting ")")

More info

May be affected by the locale, NodeJS version, or ARM architecture?

locale
LANG=en_GB.UTF-8
node --version  
v17.6.0
npm --version 
8.5.2
Linux raspberrypi 5.10.63-v7l+ #1496 SMP Wed Dec 1 15:58:56 GMT 2021 armv7l GNU/Linux

I'm just starting with fleetctl, the buster is up to date I have installed:

curl -fsSL https://deb.nodesource.com/setup_17.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm install -g fleetctl
@mveplus mveplus added :reproduce Involves documenting reproduction steps in the issue bug Something isn't working as documented labels Mar 3, 2022
@mveplus mveplus changed the title v4.10.0/fleetctl: Syntax error: end of file unexpected (expecting ")") Syntax error: end of file unexpected (expecting ")") Mar 3, 2022
@lucasmrod
Copy link
Member

Hi @mveplus!

Fleet currently does not support ARM 32-bits. And there are no plans to support it.
We do have plans to support Linux ARM 64-bits, see #2466.

That said, I once managed to run Fleet on a Raspberry Pi 4 (with some code changes, mostly config and docker files), but you need to install the 64-bit version of the OS.

@mveplus
Copy link
Author

mveplus commented Mar 6, 2022

Thank you @lucasmrod

After a bit of fiddling around with OS architecture as per your suggestion x64 now and NodeJS and Go versions I've got it compiled from source ;) and it almost works!

Linux raspberrypi 5.10.92-v8+ #1514 SMP PREEMPT Mon Jan 17 17:39:38 GMT 2022 aarch64 GNU/Linux
Description:	Debian GNU/Linux 11 (bullseye)
node --version v16.14.0 
npm --version  8.3.1
yarn --version 1.22.17
go version go1.17.8 linux/arm64
./build/fleet version 
fleet version fleet-v4.10.0-176-g8d34ffb0

sudo ./fleetctl preview
Error: Docker Compose is required for the fleetctl preview experience.

Installed Docker Compose version v2.3.0 and got to a point where preview pulls and starts the containers:

sudo ./fleetctl preview
Downloading dependencies from production into /root/.fleet/preview...
Pulling Docker dependencies...
Starting Docker containers...
Waiting for server to start up...

But it hangs in there, just waiting…. I presume these are all contenders needed?


REPOSITORY      TAG       IMAGE ID       CREATED       SIZE
mysql           5.7       8b94b71dcc1e   3 days ago    448MB
redis           6         24b63f9417ae   3 days ago    107MB
fleetdm/fleet   latest    09c636886a14   2 weeks ago   97.2MB

After of long wait, it comes back with the error:

Error: wait for server startup: checking server health: Get "https://localhost:8412/healthz": dial tcp [::1]:8412: connect: connection refused

I will see if I can figure it out?

Cheers,

@lucasmrod
Copy link
Member

Cool.

To troubleshoot, try getting logs from the Fleet server container (using docker logs):

$ docker ps | grep fleet-preview-server_fleet
b206043cc925   fleetdm/fleet:latest                "sh -c '/usr/bin/fle…"   4 minutes ago   Up 4 minutes   0.0.0.0:1337->1337/tcp                                     fleet-preview-server_fleet02_1
d6d54c2f7039   fleetdm/fleet:latest                "sh -c '/usr/bin/fle…"   4 minutes ago   Up 4 minutes   0.0.0.0:8412->8412/tcp                                     fleet-preview-server_fleet01_1

# Then grab the container id and run the following on both fleet instances to get their output:
# (fleetctl preview starts two instances of fleet, one to communicate with the hosts and another one to serve the UI on localhost.)

$ docker logs -f b206043cc925
$ docker logs -f d6d54c2f7039

@mveplus
Copy link
Author

mveplus commented Mar 12, 2022

Thanks @lucasmrod

I found the issue ;) the fleet-preview pulls "platform: linux/x86_64" images - it looks like it is not detecting the architecture correctly, and as you mention about the arm64 support it's not just there yet. Editing the YAML manually the platform for all images did not work as expected.
But as I got to that point I decided I will skip the preview and followed Server Installation and it works:
fleet-server-arm64-Pi4

But of course, when it comes to the client image generations I hit the same issue with docker images :)

fleetctl package --type=pkg --fleet-url=https://raspberrypi.local:8080 --enroll-secret=Ps0***

Generating your osquery installer...
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
standard_init_linux.go:228: exec user process caused: exec format error
Error: build pkg: mkbom: exit status 1

Cheers

@lucasmrod
Copy link
Member

Glad you managed to make the server work in the Raspberry Pi 4!

But of course, when it comes to the client image generations I hit the same issue with docker images :)
fleetctl package --type=pkg --fleet-url=https://raspberrypi.local:8080 --enroll-secret=Ps0***

Correct, we are tracking such effort in #1845.

@lucasmrod lucasmrod changed the title Syntax error: end of file unexpected (expecting ")") Fleetctl preview not working on Raspberry Pi 4 with arm64 OS Mar 15, 2022
@xpkoala
Copy link
Contributor

xpkoala commented Aug 8, 2022

Please use #1845 ticket for future input on this topic. Closing this for housekeeping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as documented :reproduce Involves documenting reproduction steps in the issue
Projects
None yet
Development

No branches or pull requests

3 participants