Skip to content
This repository has been archived by the owner on Aug 22, 2022. It is now read-only.

[plex] unable to attach or mount volumes #18

Closed
sample-usr opened this issue Aug 18, 2020 · 6 comments
Closed

[plex] unable to attach or mount volumes #18

sample-usr opened this issue Aug 18, 2020 · 6 comments

Comments

@sample-usr
Copy link

I'm new to kubernetes so I'm not sure if this is expected or not. I'm trying to add the plex chart to my cluster and I have only a single PV and PVC. After starting the chart it's stuck at ContainerCreating because it cannot attach the volumes

Unable to attach or mount volumes: unmounted volumes=[data transcode], unattached volumes=[data config transcode shared default-token-8s7wb]: timed out waiting for the condition

It seems to me that it might be because deployment.yml file storing hardcoded values for volumeMounts as they don't exist in my cluster. e.g. https://github.com/billimek/billimek-charts/blob/master/charts/plex/templates/deployment.yaml#L196

Is there a reason we are hardcoding those values, do I need to setup extra PVC named as they are?

There is a similar issue here which seems to have the same problem.

Here is the kubectl describe pod ...

Name:           plex-69fb48c94f-tf56c
Namespace:      media
Priority:       0
Node:           mona-2/192.168.0.224
Start Time:     Tue, 18 Aug 2020 20:57:35 +0200
Labels:         app.kubernetes.io/instance=plex
                app.kubernetes.io/name=plex
                pod-template-hash=69fb48c94f
Annotations:    <none>
Status:         Pending
IP:             
IPs:            <none>
Controlled By:  ReplicaSet/plex-69fb48c94f
Containers:
  plex:
    Container ID:   
    Image:          plexinc/pms-docker:1.19.1.2645-ccb6eb67e
    Image ID:       
    Ports:          32400/TCP, 32469/TCP, 1900/UDP, 32410/UDP, 32412/UDP, 32413/UDP, 32414/UDP
    Host Ports:     0/TCP, 0/TCP, 0/UDP, 0/UDP, 0/UDP, 0/UDP, 0/UDP
    State:          Waiting
      Reason:       ContainerCreating
    Ready:          False
    Restart Count:  0
    Liveness:       http-get http://:32400/identity delay=15s timeout=5s period=10s #success=1 #failure=5
    Readiness:      http-get http://:32400/identity delay=15s timeout=5s period=10s #success=1 #failure=5
    Environment:
      TZ:                    Europe/London
      PLEX_CLAIM:            REDACTED
      PMS_INTERNAL_ADDRESS:  http://plex:32400
      PMS_IMAGE:             plexinc/pms-docker:1.19.1.2645-ccb6eb67e
      KUBE_NAMESPACE:        media (v1:metadata.namespace)
      TRANSCODE_PVC:         media-ssd
      DATA_PVC:              media-ssd
      CONFIG_PVC:            media-ssd
      PLEX_UID:              1000
      PLEX_GID:              1000
    Mounts:
      /config from config (rw)
      /data from data (rw)
      /shared from shared (rw)
      /transcode from transcode (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-8s7wb (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             False 
  ContainersReady   False 
  PodScheduled      True 
Volumes:
  data:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  media-ssd
    ReadOnly:   false
  config:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  media-ssd
    ReadOnly:   false
  transcode:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  media-ssd
    ReadOnly:   false
  shared:
    Type:       EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:     
    SizeLimit:  <unset>
  default-token-8s7wb:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-8s7wb
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason       Age                  From               Message
  ----     ------       ----                 ----               -------
  Normal   Scheduled    <unknown>            default-scheduler  Successfully assigned media/plex-69fb48c94f-tf56c to hydra-2
  Warning  FailedMount  22m (x3 over 35m)    kubelet, hydra-2   Unable to attach or mount volumes: unmounted volumes=[data transcode], unattached volumes=[shared default-token-8s7wb data config transcode]: timed out waiting for the condition
@dcplaya
Copy link
Contributor

dcplaya commented Aug 18, 2020

Can you post your helm chart values too? Make sure to remove any private bits if you have any. Or if it's public, link to it.

@sample-usr
Copy link
Author

@dcplaya Sure, here you go

claimToken: "REDACTED"

timezone: Europe/London

service:
  type: LoadBalancer # We will use a LoadBalancer to obtain a virtual IP that can be exposed to Plex Media via our router
  port: 32400 # Port to expose Plex

plexUid: 1000
plexGid: 1000

persistence:
  transcode:
    enabled: true
    claimName: media-ssd 
  data:
    enabled: true
    claimName: media-ssd 
  config:
    claimName: media-ssd

@dcplaya
Copy link
Contributor

dcplaya commented Aug 19, 2020

Hmmm, is your media-ssd PV/PVC set to

accessModes:
  - ReadWriteMany

From your pod description, it seems like it isn't since the pod complains about not being able to mount transcode and data but doesn't seem to complain about config.

@sample-usr
Copy link
Author

@dcplaya Both are set to ReadWriteMany
Here is the describe on my PVC

Name:          media-ssd
Namespace:     media
StorageClass:  manual
Status:        Bound
Volume:        media-ssd
Labels:        <none>
Annotations:   pv.kubernetes.io/bind-completed: yes
               pv.kubernetes.io/bound-by-controller: yes
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      600Gi
Access Modes:  RWX
VolumeMode:    Filesystem
Mounted By:    jackett-6988b9c445-xjg8z
               plex-69fb48c94f-tf56c
               plex-69fb48c94f-tf56c
               plex-69fb48c94f-tf56c
               sonarr-5869b4584b-plmrk
               transmission-transmission-openvpn-5f7ddd8b86-q7vzj
Events:        <none>

Also it seems like it's mounted by the plex container from here as well.

@blmhemu
Copy link
Contributor

blmhemu commented Aug 22, 2020

I think it may be because of using same pvc twice in "volumes" section. Try creating different pvc for different volume mounts.

@billimek billimek transferred this issue from billimek/billimek-charts Aug 29, 2020
@billimek billimek transferred this issue from another repository Aug 29, 2020
@sample-usr
Copy link
Author

@blmhemu Thanks, instead of creating new ones I just removed them from the values file and left only the data volume. It now works so I think you were right that it's the same PVC multiple times.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants