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

standard_init_linux.go:219: exec user process caused: exec format error #2912

Closed
magicaljellybeans opened this issue Feb 9, 2021 · 1 comment

Comments

@magicaljellybeans
Copy link

magicaljellybeans commented Feb 9, 2021

Environmental Info:
K3s Version:
k3s version v1.20.2+k3s1 (1d4adb0)
go version go1.15.5

Node(s) CPU architecture, OS, and Version: Linux raspi0 5.4.83-v7l+ #1379 SMP Mon Dec 14 13:11:54 GMT 2020 armv7l GNU/Linux

Cluster Configuration: 1 master, 1 worker

Describe the bug:

When I apply a deployment using a docker container I know to work on this architecture in docker, the container never gets started (persistent crashloopbackoff) and logs the sole error standard_init_linux.go:219: exec user process caused: exec format error

Another deployment running a different container is running fine.

Steps To Reproduce:

  • Installed K3s: The standard installation script, no flags.
  • Wrote the following deployment:
apiVersion: v1
kind: Service
metadata:
  name: flaskblog
  labels:
    app: flaskblog
spec:
  ports:
    - port: 5000
  selector:
    app: flaskblog
    tier: frontend
  type: LoadBalancer
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: flaskblog-pv-claim
  labels:
    app: flaskblog
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: flaskblog
  labels:
    app: flaskblog
spec:
  selector:
    matchLabels:
      app: flaskblog
      tier: frontend
  strategy: 
    type: Recreate
  template:
    metadata:
      labels:
        app: flaskblog
        tier: frontend
    spec:
      containers:
      - name: flaskblog
        image: magicaljellybeans/blog:latest
        env:
          - name: MAIL_SERVER
            value: smtp.gmail.com
          - name: MAIL_PORT
            value: '587'
          - name: MAIL_USE_TLS
            value: 'true'
          - name: MAIL_USERNAME
            value: **********
          - name: SECRET_KEY
            valueFrom:
              secretKeyRef:
                name: flaskblog
                key: secretkey
          - name: ADMIN_KEY
            valueFrom:
              secretKeyRef:
                name: flaskblog
                key: adminkey
          - name: MAIL_PASSWORD
            valueFrom:
              secretKeyRef:
                name: flaskblog
                key: mailpassword
          - name: DATABASE_URL
            value: ***********************
        ports:
        - containerPort: 5000
        volumeMounts:
        - name: flaskblog-storage
          mountPath: /home/blog/app/static
      volumes:
      - name: flaskblog-storage
        persistentVolumeClaim:
          claimName: flaskblog-pv-claim
  • Pod description:
Name:         flaskblog-676dbd895c-26t5k
Namespace:    default
Priority:     0
Node:         raspi0/192.168.1.254
Start Time:   Mon, 08 Feb 2021 23:48:47 +0000
Labels:       app=flaskblog
              pod-template-hash=676dbd895c
              tier=frontend
Annotations:  <none>
Status:       Running
IP:           10.42.0.18
IPs:
  IP:           10.42.0.18
Controlled By:  ReplicaSet/flaskblog-676dbd895c
Containers:
  flaskblog:
    Container ID:   containerd://f734432211a97b2113c82a4e255756146be062804e214e32def1802769d55891
    Image:          magicaljellybeans/blog:latest
    Image ID:       docker.io/magicaljellybeans/blog@sha256:16c89fd4b78635a875e894cfdd335d832408975641583bf5df5d554f03fa9fcb
    Port:           5000/TCP
    Host Port:      0/TCP
    State:          Waiting
      Reason:       CrashLoopBackOff
    Last State:     Terminated
      Reason:       Error
      Exit Code:    1
      Started:      Mon, 08 Feb 2021 23:49:09 +0000
      Finished:     Mon, 08 Feb 2021 23:49:09 +0000
    Ready:          False
    Restart Count:  2
    Environment:
      MAIL_SERVER:    smtp.gmail.com
      MAIL_PORT:      587
      MAIL_USE_TLS:   true
      MAIL_USERNAME:  ***********
      SECRET_KEY:     <set to the key 'secretkey' in secret 'flaskblog'>     Optional: false
      ADMIN_KEY:      <set to the key 'adminkey' in secret 'flaskblog'>      Optional: false
      MAIL_PASSWORD:  <set to the key 'mailpassword' in secret 'flaskblog'>  Optional: false
      DATABASE_URL:   *******
    Mounts:
      /home/blog/app/static from flaskblog-storage (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-sn746 (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             False 
  ContainersReady   False 
  PodScheduled      True 
Volumes:
  flaskblog-storage:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  flaskblog-pv-claim
    ReadOnly:   false
  default-token-sn746:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-sn746
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                 node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type     Reason     Age                From               Message
  ----     ------     ----               ----               -------
  Normal   Scheduled  47s                default-scheduler  Successfully assigned default/flaskblog-676dbd895c-26t5k to raspi0
  Normal   Pulled     45s                kubelet            Successfully pulled image "magicaljellybeans/blog:latest" in 1.475226696s
  Normal   Pulled     43s                kubelet            Successfully pulled image "magicaljellybeans/blog:latest" in 1.305015336s
  Normal   Pulled     25s                kubelet            Successfully pulled image "magicaljellybeans/blog:latest" in 1.170779564s
  Normal   Created    25s (x3 over 44s)  kubelet            Created container flaskblog
  Normal   Started    25s (x3 over 44s)  kubelet            Started container flaskblog
  Warning  BackOff    12s (x4 over 42s)  kubelet            Back-off restarting failed container
  Normal   Pulling    0s (x4 over 46s)   kubelet            Pulling image "magicaljellybeans/blog:latest"
  • And the logs show the titled error.

Expected behavior:

My container starts and runs normally.

Actual behavior:

The container never gets started.

Additional context / logs:

This container runs out of docker fine.
I have ufw installed but have tried disabling it totally and redeploying to no effec.

@brandond
Copy link
Member

brandond commented Feb 9, 2021

The image you are trying to use is for amd64 architecture only, not arm: https://hub.docker.com/r/magicaljellybeans/blog/tags

If this is image actually contains arm binaries (although it does not appear to), you need to set the correct architecture when building the image and pushing it to docker hub.

@brandond brandond closed this as completed Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants