5

Back-off restarting the failed container, the description is Container image mongo:3.4.20 already present on the machine

I have removed all container into that system name mongo, removed all POD, svc, deployment, and rc, but getting the same error, also I tried to label another node with a different name and used that label in yaml but I got the same error.

I used below yaml for creating Deployment, in this case, I used to map system with name app=mongodb, also attached one 8 GB disk in AWS as persistentVolumeClaim.

kind: Deployment
metadata:
    name: mongo-deployment
    labels:
      app: mongo
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mongodb
  template:
    metadata:
      labels:
        app: mongodb
    spec:
      containers:
      - image: mongo:3.4.20
        name: mongo
        ports:
        - name: mongo
          containerPort: 27017
          hostPort: 27017
        volumeMounts:
        - mountPath: "/data/db"
          name: db-storage
      volumes:
        - name: db-storage
          persistentVolumeClaim:
            claimName: db-storage

why its always going failed and saying Container image already present on the machine, any cache?

Arslanbekov Denis
  • 1,674
  • 12
  • 26
shufilkhan
  • 521
  • 2
  • 6
  • 22
  • Are you sure that's the full status and not just one event? Does it appear to be starting and then immediately crashing? – coderanger Apr 22 '19 at 05:20
  • 1
    It looks like the problem is not with image, but with container itself. Generally it help to view logs of failed container "kubectl logs -p POD_NAME". – Vasili Angapov Apr 22 '19 at 05:59
  • @coderanger, yes.. its immediately went to down , – shufilkhan Apr 22 '19 at 08:05
  • @VasilyAngapov `[initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=mongo-deployment-5-94v E STORAGE [initandlisten] WiredTiger error (2) [8][40], file:WiredTiger.wt, connection: /data/db/WiredTiger.wt: handle-open: open: No such file or directory I - [initandlisten] Assertion: 28595:2: No such file or directory src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 277 I STORAGE [initandlisten] exception in initAndListen: 28595 2: No such file or directory, terminating I NETWORK [initandlisten] shutdown: going to close listening sockets... ` – shufilkhan Apr 22 '19 at 08:09
  • I have changed mount path from "/data/db" to "/data" then after its started correctly , anyway not getting error but the massage still getting "Container image "mongo:3.4.20" already present on machine", - may be the container still running in same node – shufilkhan Apr 22 '19 at 08:32
  • 3
    That is simply information message saying that docker image "mongo:3.4.20 "already present on machine, no need to pull again. You can ignore it. – Vasili Angapov Apr 22 '19 at 09:28

1 Answers1

8

Addressed in comments, "already present on the machine" is not an error message. That's a pod event and is there only for debugging and tracing to give you an idea of what steps the kubelet is taking during the pod setup process.

coderanger
  • 52,400
  • 4
  • 52
  • 75