diff --git a/php/src/Container/Container.php b/php/src/Container/Container.php
index 1119a4ba..c1330da3 100644
--- a/php/src/Container/Container.php
+++ b/php/src/Container/Container.php
@@ -91,6 +91,10 @@ class Container {
return $this->dockerActionManager->GetContainerRunningState($this);
}
+ public function GetRestartingState() : IContainerState {
+ return $this->dockerActionManager->GetContainerRestartingState($this);
+ }
+
public function GetUpdateState() : IContainerState {
return $this->dockerActionManager->GetContainerUpdateState($this);
}
diff --git a/php/src/Container/State/NotRestartingState.php b/php/src/Container/State/NotRestartingState.php
new file mode 100644
index 00000000..b035377c
--- /dev/null
+++ b/php/src/Container/State/NotRestartingState.php
@@ -0,0 +1,6 @@
+BuildApiUrl(sprintf('containers/%s/json', urlencode($container->GetIdentifier())));
+ try {
+ $response = $this->guzzleClient->get($url);
+ } catch (RequestException $e) {
+ if ($e->getCode() === 404) {
+ return new ImageDoesNotExistState();
+ }
+ throw $e;
+ }
+
+ $responseBody = json_decode((string)$response->getBody(), true);
+
+ if ($responseBody['State']['Restarting'] === true) {
+ return new RestartingState();
+ } else {
+ return new NotRestartingState();
+ }
+ }
+
public function GetContainerUpdateState(Container $container) : IContainerState
{
$tag = $this->GetCurrentChannel();
diff --git a/php/templates/containers.twig b/php/templates/containers.twig
index 6209266e..6d727afa 100644
--- a/php/templates/containers.twig
+++ b/php/templates/containers.twig
@@ -20,6 +20,7 @@
This is beta software and not production ready.
{% set isAnyRunning = false %}
+ {% set isAnyRestarting = false %}
{% set isWatchtowerRunning = false %}
{% set isBackupContainerRunning = false %}
{% set isRestoreRunning = false %}
@@ -30,6 +31,9 @@
{% if class(container.GetRunningState()) == 'AIO\\Container\\State\\RunningState' and container.GetIdentifier() != 'nextcloud-aio-domaincheck' and container.GetIdentifier() != 'nextcloud-aio-borgbackup' and container.GetIdentifier() != 'nextcloud-aio-watchtower' %}
{% set isAnyRunning = true %}
{% endif %}
+ {% if ( container.GetIdentifier() starts with 'nextcloud-aio-redis' or container.GetIdentifier() starts with 'nextcloud-aio-database' or container.GetIdentifier() starts with 'nextcloud-aio-nextcloud' or container.GetIdentifier() starts with 'nextcloud-aio-apache' ) and class(container.GetRestartingState()) == 'AIO\\Container\\State\\RestartingState' %}
+ {% set isAnyRestarting = true %}
+ {% endif %}
{% if container.GetIdentifier() == 'nextcloud-aio-watchtower' and class(container.GetRunningState()) == 'AIO\\Container\\State\\RunningState' %}
{% set isWatchtowerRunning = true %}
{% endif %}
@@ -81,8 +85,18 @@
Initial Nextcloud password: {{ nextcloud_password }}
Open your Nextcloud ↗
{% else %}
- Containers are currently starting.
- Reload ↻
+ {% if isAnyRestarting == false %}
+ Containers are currently starting.
+ Reload ↻
+ {% else %}
+ It seems like at least one container is currently restarting which means it is not able to start correctly.
+ To break out this endless loop, you can stop the containers below and investigate the issue by having a look at the container logs before starting them again.
+