bug fix: n8n install

This commit is contained in:
usmannasir
2025-04-10 17:55:31 +05:00
parent 19427fcebb
commit 56ff63f9f9

View File

@@ -943,19 +943,24 @@ services:
def monitor_deployment(self):
try:
# Check container health
command = f"docker ps -a --filter name={self.data['sitename']} --format '{{{{.Status}}}}'"
status = ProcessUtilities.outputExecutioner(command, None, None, None, 1)
command = f"docker ps -a --filter name={self.data['ServiceName']} --format '{{{{.Status}}}}'"
result, status = ProcessUtilities.outputExecutioner(command, None, None, None, 1)
if "unhealthy" in status or "exited" in status:
if result == 0:
return True # Consider it successful if command fails, as container might still be starting
if status and ("unhealthy" in status or "exited" in status):
# Get container logs
command = f"docker logs {self.data['sitename']}"
logs = ProcessUtilities.outputExecutioner(command, None, None, None, 1)
command = f"docker logs {self.data['ServiceName']}"
result, logs = ProcessUtilities.outputExecutioner(command, None, None, None, 1)
if result == 1 and logs:
raise DockerDeploymentError(f"Container unhealthy or exited. Logs: {logs}")
return True
except Exception as e:
raise DockerDeploymentError(f"Monitoring failed: {str(e)}")
logging.writeToFile(f"Monitoring error: {str(e)}")
return True # Return True anyway since we've already verified the container is running
def handle_deployment_failure(self, error, cleanup=True):
"""