-
Notifications
You must be signed in to change notification settings - Fork 675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow networks to be created pre-emptively #3129
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, however podman should return error code 409 if the network already exists. See containers/podman#15499 and
if ($e->getCode() !== 409) { |
This patch is needed for Nextcloud-AIO to work with Podman version 4.6.0. The most recent reply to containers/podman#15499 was 7 months ago, yet no related change has landed in Podman yet. If my setup breaks in the future, would you like me to submit another PR? |
Can you tell which error code is returned if the network already exists? Before the bug was fixed it was 500 if I remember correctly. Now it should in theory be 409 but apparently it is not... |
diff --git a/php/src/Docker/DockerActionManager.php b/php/src/Docker/DockerActionManager.php
index 93abcdc..a3350d6 100644
--- a/php/src/Docker/DockerActionManager.php
+++ b/php/src/Docker/DockerActionManager.php
@@ -788,7 +788,8 @@ class DockerActionManager
$responseBody = json_decode((string)$response->getBody(), true);
$connectedNetworks = $responseBody['NetworkSettings']['Networks'];
if (array_key_exists($network, $connectedNetworks)) {
- return;
+ error_log(sprintf("IAMHERE: THE ERROR IS %s", $e));
+ //return;
}
} catch (RequestException $e) {
// do nothing logs
|
No I meant what error code is thrown here if the network should already exist?
|
error_log(sprintf("IAMHERE: THE ERROR IS %s", $e)); The specific log line is
|
Ah I see. However since the error code is 409, AIO should not throw, right? |
That is correct. Since the error code is 409, |
This is what I am wondering about: if the network already exists, it should return 409 and then not throw an error anymore. So why does it do on podman but not on docker? |
Oh, I left out some information. My bad. The error with network creation is handled correctly, however the error fails later on here: all-in-one/php/src/Docker/DockerActionManager.php Lines 785 to 803 in e8ab2c7
This is because of the linked Podman bug: containers/podman#19577 logs
|
Ah I see. Since this apparently is a Podman bug, I would rather not like to merge your change into AIO as podman is not supported by us anyway. |
Currently,
nextcloud-aio-mastercontainer
will crash if thenextcloud-aio
network already exists. This PR changes the behavior so that thenextcloud-aio
network may be created preemptively.I did this as a workaround to a bug in rootless Podman: containers/podman#19577