mittwald / mittwald/cli

mw stack up startet Container bei Image-Update nicht neu, anschließendes mw container restart schlägt mit 412 fehl

Open
#1,827 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
8
Forks
2
Avg merge
13h 26m
Merged PRs (30d)
35

Description

Beschreibung:
Beim Deployment eines neuen Image-Tags via mw stack up meldet der Stack Erfolg, aber die Container werden nicht neu gestartet — der alte Code bleibt aktiv. Ein anschließendes mw container restart schlägt mit einem 412-Fehler fehl.

Umgebung:

  • @mittwald/cli Version: 1.15.x
  • Deployment via GitLab CI

Schritte zur Reproduktion:

  1. Neues Docker-Image mit neuem Tag bauen (z.B. phpfpm-staging-abc1234)
  2. Deployment via mw stack up -c docker-compose.yml -s <stack-id> --env-file .env
  3. Direkt danach mw container restart <container-id> --project-id <project-id> aufrufen

Beobachtetes Verhalten:
Schritt 2 gibt zurück:
Deployment successful. No services were restarted. No services were deleted.
Schritt 3 schlägt fehl mit:

Response     412 Precondition Failed
Message      cannot start service <id>, it is already starting

Auch mit einem sleep 5 zwischen Schritt 2 und 3 bleibt der 412-Fehler bestehen.

Erwartetes Verhalten:
Entweder:

  • mw stack up sollte betroffene Container neu starten, wenn sich der Image-Tag ändert,

oder

  • mw container restart sollte nach Abschluss von mw stack up erfolgreich ausführbar sein

Auswirkung:
Nach einem Deployment mit neuem Image-Tag laufen die Container weiterhin mit dem alten Image. Der neue Code wird nicht übernommen, weil der OPcache von PHP-FPM den alten Bytecode im Speicher hält. Ein Container-Neustart ist der einfachste und zuverlässigste Weg, den OPcache zu leeren und das neue Image zu aktivieren. Dies lässt sich aktuell über die CLI nicht zuverlässig automatisieren.

Workaround:
Ein manueller Neustart über das mStudio funktioniert, macht aber automatisierte CI/CD-Deployments zunichte.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the sequence with mw stack up and mw container restart described in the issue, then trace the CLI entry points for those commands and their deployment-status handling. Determine why the image update leaves the old container active and why the subsequent restart returns 412; done means the documented deployment flow activates the new image and no longer leaves the restart command in a failing state.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, typescript
Domain
cli, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.