Init container error on subsequent deploy with child theme from zip file
When deploying I found the playbook fails when there's a child theme with a zip file. Failure only occurs on multiple runs. To reproduce you may use the following (or use your own zip):
themes_install:
- twentytwentytwo
- bravada
- https://codeberg.org/vhs/valkyrie/archive/1.0.0-bravada.zip
The error received:
TASK [wordpress-init : Themes install] *****************************************
failed: [localhost] (item=twentytwentytwo bravada https://codeberg.org/vhs/valkyrie/archive/1.0.0-bravada.zip) => {"ansible_loop_var": "item", "changed": true, "cmd": "wp --path=/var/www/html theme install twentytwentytwo bravada https://codeberg.org/vhs/valkyrie/archive/1.0.0-bravada.zip", "delta": "0:00:03.037365", "end": "2022-03-02 08:42:07.113922", "item": "twentytwentytwo bravada https://codeberg.org/vhs/valkyrie/archive/1.0.0-bravada.zip", "msg": "non-zero return code", "rc": 1, "start": "2022-03-02 08:42:04.076557", "stderr": "Warning: twentytwentytwo: Theme already installed.\nWarning: bravada: Theme already installed.\nWarning: Destination folder already exists. \"/var/www/html/wp-content/themes/valkyrie/\"\nWarning: The 'https://codeberg.org/vhs/valkyrie/archive/1.0.0-bravada.zip' theme could not be found.\nError: No themes installed.", "stderr_lines": ["Warning: twentytwentytwo: Theme already installed.", "Warning: bravada: Theme already installed.", "Warning: Destination folder already exists. \"/var/www/html/wp-content/themes/valkyrie/\"", "Warning: The 'https://codeberg.org/vhs/valkyrie/archive/1.0.0-bravada.zip' theme could not be found.", "Error: No themes installed."], "stdout": "Downloading installation package from https://codeberg.org/vhs/valkyrie/archive/1.0.0-bravada.zip...\nUnpacking the package...\nInstalling the theme...\nTheme installation failed.", "stdout_lines": ["Downloading installation package from https://codeberg.org/vhs/valkyrie/archive/1.0.0-bravada.zip...", "Unpacking the package...", "Installing the theme...", "Theme installation failed."]}
Workaround by commenting out the ZIP file after the first deployment, or deleting the child theme manually before redeploying.
The output of these commands is helpful to debug deployment errors:
stackspin-version-info.sh # not sure where to find this
kubectl get pods -A # see below
Please include this output if possible.
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system helm-install-traefik-crd--1-6lxgp 0/1 Completed 0 51d
kube-system helm-install-traefik--1-5t69f 0/1 Completed 1 51d
kube-system svclb-traefik-9dz8b 2/2 Running 0 51d
kube-system svclb-traefik-8fn6s 2/2 Running 0 51d
lens-metrics node-exporter-fsfwp 1/1 Running 0 51d
lens-metrics node-exporter-ghxfz 1/1 Running 0 51d
lens-metrics kube-state-metrics-78596b555-fcwk5 1/1 Running 0 51d
kube-system coredns-85cb69466-n446d 1/1 Running 1 (37d ago) 51d
lens-metrics prometheus-0 1/1 Running 0 51d
lens-metrics node-exporter-lmj2b 1/1 Running 0 51d
kube-system svclb-traefik-qbspb 2/2 Running 0 51d
kube-system local-path-provisioner-64ffb68fd-ndtqb 1/1 Running 0 51d
kube-system metrics-server-9cf544f65-vkfmh 1/1 Running 0 51d
kube-system traefik-786ff64748-csj8d 1/1 Running 0 51d
wordpress wordpress-production-database-primary-0 1/1 Running 0 92m
wordpress wordpress-production-database-secondary-0 1/1 Running 0 92m
wordpress wordpress-production-0 1/1 Running 0 2m35s