description: orch:cephadm/workunits/{0-distro/ubuntu_22.04 agent/off mon_election/classic task/test_mgmt_gateway} duration: 1032.3634016513824 failure_reason: 'Command failed on trial040 with status 1: ''sudo /home/ubuntu/cephtest/cephadm --image quay.ceph.io/ceph-ci/ceph:042df16cd9ee8a8df553b188fef8a8c4a9e7ab01 shell -c /etc/ceph/ceph.conf -k /etc/ceph/ceph.client.admin.keyring --fsid 5998a032-0b90-11f1-a7ea-d404e6e7d460 -- bash -c \''set -ex\n\n# Function to wait for a service to be healthy and log response on error\nwait_for_service() {\n local name="$1"\n local url="$2"\n local jq_filter="$3"\n\n echo "Waiting for service $name to be healthy at $url..."\n for i in {1..30}; do\n local response\n response=$(curl -k -s -u admin:admin "$url")\n if echo "$response" | jq -e "$jq_filter" > /dev/null; then\n echo "Service $name is healthy."\n return 0\n fi\n echo "Attempt $i: service $name not ready yet"\n sleep 10\n done\n\n echo "Timeout waiting for $name at $url"\n echo "Last HTTP response:"\n echo "$response"\n echo "jq output:"\n echo "$response" | jq "$jq_filter" || echo "(jq parse error or no match)"\n return 1\n}\n\n# retrieve mgmt hostname and ip\nMGMT_GTW_HOST=$(ceph orch ps --daemon-type mgmt-gateway -f json | jq -e \''"\''"\''.[]\''"\''"\'' | jq -r \''"\''"\''.hostname\''"\''"\'')\nMGMT_GTW_IP=$(ceph orch host ls -f json | jq -r --arg MGMT_GTW_HOST "$MGMT_GTW_HOST" \''"\''"\''.[] | select(.hostname==$MGMT_GTW_HOST) | .addr\''"\''"\'')\n\n# check mgmt-gateway health\ncurl -k -s https://${MGMT_GTW_IP}/health\ncurl -k -s https://${MGMT_GTW_IP}:29443/health\n\n# wait for monitoring services\nwait_for_service "Grafana" "https://${MGMT_GTW_IP}/grafana/api/health" \''"\''"\''.database == "ok"\''"\''"\'' || exit 1\nwait_for_service "Prometheus" "https://${MGMT_GTW_IP}/prometheus/api/v1/status/config" \''"\''"\''.status == "success"\''"\''"\'' || exit 1\nwait_for_service "Alertmanager" "https://${MGMT_GTW_IP}/alertmanager/api/v2/status" \''"\''"\''.cluster.status == "ready"\''"\''"\'' || exit 1\n\''''' flavor: default owner: scheduled_adking@soko04.front.sepia.ceph.com sentry_event: null status: fail success: false