bugfest/tor-controller

[BUG] Tor instance fails to start

wigust opened this issue · 9 comments

wigust commented

Describe the bug
example-tor-instance-tor-daemon-9c8c48cbf-tnxm6 fails to start (following Tor Instances).

To Reproduce
Install tor-controller Helm chart version 0.1.14.

Create Tor object:

apiVersion: tor.k8s.torproject.org/v1alpha2
kind: Tor
metadata:
  name: example-tor-instance
  namespace: tor-controller-instance

You will get a pod like example-tor-instance-tor-daemon-9c8c48cbf-tnxm6 which fails to start because of the error:

Message: failed to create containerd task: failed to create shim task: OCI
runtime create failed: runc create failed: unable to start container process:
error during container init: error mounting
"/var/lib/containerd/io.containerd.grpc.v1.cri/containers/17ea4614b07d137e2e46fe9ead37e639c2bfe7b5c89b6040705b4821f8865044/volumes/0b41a74427d7e4c3db972fb4b3aed48e731b38018f0e6e8411d28c7ba481d3fb"
to rootfs at "/run/tor/service": mkdir
/run/containerd/io.containerd.runtime.v2.task/k8s.io/17ea4614b07d137e2e46fe9ead37e639c2bfe7b5c89b6040705b4821f8865044/rootfs/run/tor/service:
read-only file system: unknown

Expected behavior
Pod in a Running state.

Additional information
A workaround to start Tor is:

Stop the controller:
kubectl -n tor-controller scale --replicas 0 deployments.apps tor-controller

Add DataDirectory to Tor config:
kubectl -n tor-controller-instance edit configmaps example-tor-instance-tor-config
DataDirectory /var/lib/tor

Add mounts:
kubectl` -n tor-controller-instance edit deployments.apps example-tor-instance-tor-daemon

        volumeMounts:
        - mountPath: /run/tor/service
          name: run-tor-service
        - mountPath: /var/lib/tor
          name: var-lib-tor
     ...
     volumes:
      - emptyDir: {}
        name: run-tor-service
      - hostPath:
          path: /var/lib/tor-controller-instance
          type: Directory
        name: var-lib-tor

System (please complete the following information):

  • Platform: Linux 5.13.16 x86_64
  • Kubelet version: 1.25.4

Hi @wigust, can you try with the latest images (https://quay.io/repository/bugfest/tor-daemon?tab=tags)?

Example:

helm upgrade --namespace changeme --install \
    --set image.tag=latest \
    --set daemon.image.tag=latest \
    --set manager.image.tag=latest \
    --set onionbalance.image.tag=latest \
    tor-controller
wigust commented

Hi @bugfest

Latest images fixed the issue. Thank you!

I think it will be great to create a new Helm Chart version to include the fix, so new users could get the fix without specifying image version.

Thanks for the feedback @wigust. Totally, I'm preparing a release alongside other images changes

Hi again @wigust, I've just published 0.1.15-rc.1 to test the latest (many) changes. Once properly tested I'll release 0.1.15

$ helm search repo bugfest --devel
NAME                    CHART VERSION   APP VERSION     DESCRIPTION
bugfest/tor-controller  0.1.15-rc.1     0.10.0          Tor hidden services controller for kubernetes
wigust commented

Hi @bugfest, thank you!

I switched from latest to 0.10.0-rc.2 image tag and 0.1.15-rc.1 helm chart version. It works for me.

I ran into the same isssue and indeed:

NS=tor-controller
helm upgrade --namespace $NS --install \
    --set image.tag=latest \
    --set daemon.image.tag=latest \
    --set manager.image.tag=latest \
    --set onionbalance.image.tag=latest \
    tor-controller bugfest/tor-controller

fixed it for me.

Hi @chevdor, the tor instance issue fix is included in 0.1.15-rc.1. I've spotted some other UID/issues in this RC; related with the way the tor container was defined (bugfest/tor-docker#9). I expect the new release (0.1.15) to be released in a few hours (tor build takes some time)

wigust commented

Hi @bugfest , 0.1.15 works for me, thank you!