bugfest/tor-controller

[BUG] exec format errorstarting tor...

lexfrei opened this issue · 10 comments

Describe the bug
Since chart v0.1.11 the onion-service-tor-daemon can't work.

To Reproduce

  1. Deploy chart v0.1.11
  2. Deploy https://github.com/lexfrei/k8s/blob/master/manifests/me-site/me-site.yaml

Expected behavior
Not errors in log

Additional information
Example logs:

time="2023-03-19T12:47:28Z" level=info msg="Listening for events"
time="2023-03-19T12:47:28Z" level=info msg="Running event controller"
time="2023-03-19T12:47:28Z" level=info msg="Starting controller"
W0319 12:47:28.044921       1 shared_informer.go:372] The sharedIndexInformer has started, run more than once is not allowed
time="2023-03-19T12:47:28Z" level=info msg="Added OnionService: default/me-site-onion-service"
starting tor...
time="2023-03-19T12:47:30Z" level=info msg="Getting key default/me-site-onion-service"
time="2023-03-19T12:47:30Z" level=info msg="Updating tor config for default/me-site-onion-service"
time="2023-03-19T12:47:30Z" level=info msg="Creating copy of /run/tor/service/key/hostname at /run/tor/service/hostname"
time="2023-03-19T12:47:30Z" level=info msg="Creating copy of /run/tor/service/key/hs_ed25519_public_key at /run/tor/service/hs_ed25519_public_key"
time="2023-03-19T12:47:30Z" level=info msg="Creating copy of /run/tor/service/key/hs_ed25519_secret_key at /run/tor/service/hs_ed25519_secret_key"
fork/exec /usr/local/bin/tor: exec format errorstarting tor...
fork/exec /usr/local/bin/tor: exec format errorstarting tor...
fork/exec /usr/local/bin/tor: exec format errorstarting tor...
fork/exec /usr/local/bin/tor: exec format errorstarting tor...
fork/exec /usr/local/bin/tor: exec format errorstarting tor...
fork/exec /usr/local/bin/tor: exec format errorstarting tor...
fork/exec /usr/local/bin/tor: exec format errorstarting tor...
<...>

System (please complete the following information):

  • Kubernetes: v1.26.2+k3s1
  • uname -a: Linux node01 6.1.8-v8.1.el9.altarch.1 #1 SMP PREEMPT Wed Feb 8 21:28:03 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux

Additional context
Probably related to arm64 arch and #38

Thanks @lexfrei. Gonna investigate it.

Feel free to contact me by telegram to communicate fastly if you need any tests on arm64.

Thanks @lexfrei. I managed to reproduce it in qemu aarm64. The issue is due to an error during the Tor binary build, shippend within quay.io/bugfest/tor (Tor binary is copied from that one to build tor-daemon-manager). I've opened bugfest/tor-docker#1 to fix this

Hi @lexfrei, mind testing if this image build works in our arm64?

$ docker run --rm -ti --entrypoint /usr/local/bin/tor quay.io/bugfest/tor:0.4.7.13-test@sha256:e977bc8487ca3441949ff66e47108ea62cd4508cf67a9d3581554acd67489b1f --version

$ docker run --rm -ti --entrypoint /usr/local/bin/obfs4proxy quay.io/bugfest/tor:0.4.7.13-test@sha256:e977bc8487ca3441949ff66e47108ea62cd4508cf67a9d3581554acd67489b1f -version

All looks fine on rpi4:

a.sviridkin@mbp:~/git/github.com/lexfrei/k8s$ kubectl run  --rm -i --tty --restart=Never --image quay.io/bugfest/tor:0.4.7.13-test@sha256:e977bc8487ca3441949ff66e47108ea62cd4508cf67a9d3581554acd67489b1f tor -- /usr/local/bin/tor --version
Tor version 0.4.7.13 (git-7c1601fb6edd780f).
Tor is running on Linux with Libevent 2.1.12-stable, OpenSSL 3.0.8, Zlib 1.2.13, Liblzma N/A, Libzstd N/A and Unknown N/A as libc.
Tor compiled with GCC version 12.2.1
pod "tor" deleted
✓ @ Mon Mar 20 21:49:41 +03 2023
a.sviridkin@mbp:~/git/github.com/lexfrei/k8s$ kubectl run  --rm -i --tty --restart=Never --image quay.io/bugfest/tor:0.4.7.13-test@sha256:e977bc8487ca3441949ff66e47108ea62cd4508cf67a9d3581554acd67489b1f obfs4 -- /usr/local/bin/obfs4proxy --version
Tor version 0.4.7.13 (git-7c1601fb6edd780f).
Tor is running on Linux with Libevent 2.1.12-stable, OpenSSL 3.0.8, Zlib 1.2.13, Liblzma N/A, Libzstd N/A and Unknown N/A as libc.
Tor compiled with GCC version 12.2.1
pod "obfs4" deleted
✓ @ Mon Mar 20 21:50:47 +03 2023

Nice, gonna push the new build and replace the 0.4.7.13 with this one. It will include your apk cache fix too!

It will take >1h due to the emulation phases. Live build logs at https://github.com/bugfest/tor-docker/actions/runs/4471779921

The tor-docker:0.4.7.13 image was successfully built & pushed to the registry. I've just rebuilt the tor-controller:0.9.0 ones:

@lexfrei please let me know if chart v0.1.11 now works in your arm64 cluster

It works!

Great. Thanks for confirming @lexfrei!!