


























@@ -186,18 +186,62 @@ if [ "$ow_ready" -ne 1 ]; then
186186exit 1
187187fi
188188189+echo "Waiting for gateway model endpoint after Open WebUI startup..."
190+gateway_model_ready=0
191+for _ in $(seq 1 90); do
192+if [ "$(docker inspect -f '{{.State.Running}}' "$GW_NAME" 2>/dev/null || echo false)" != "true" ]; then
193+break
194+fi
195+if docker exec "$GW_NAME" bash -lc "node --input-type=module -e '
196+ const controller = new AbortController();
197+ const timeout = setTimeout(() => controller.abort(), 8000);
198+ try {
199+ const res = await fetch(\"http://$GW_NAME:$PORT/v1/models\", {
200+ headers: { authorization: \"Bearer $TOKEN\" },
201+ signal: controller.signal,
202+ });
203+ process.exit(res.status === 200 ? 0 : 1);
204+ } catch {
205+ process.exit(1);
206+ } finally {
207+ clearTimeout(timeout);
208+ }
209+ ' >/dev/null 2>&1"; then
210+ gateway_model_ready=1
211+break
212+fi
213+ sleep 5
214+done
215+216+if [ "$gateway_model_ready" -ne 1 ]; then
217+echo "Gateway model endpoint did not stay reachable after Open WebUI startup"
218+ docker inspect "$GW_NAME" --format '{{json .State}}' 2>/dev/null || true
219+if [ "$(docker inspect -f '{{.State.Running}}' "$GW_NAME" 2>/dev/null || echo false)" = "true" ]; then
220+ docker exec "$GW_NAME" bash -lc 'tail -n 200 /tmp/openwebui-gateway.log' || true
221+fi
222+ docker logs "$GW_NAME" 2>&1 | tail -n 200 || true
223+ docker logs "$OW_NAME" 2>&1 | tail -n 200 || true
224+exit 1
225+fi
226+189227echo "Running Open WebUI -> OpenClaw smoke..."
190228if ! docker exec \
191229 -e "OPENWEBUI_BASE_URL=http://$OW_NAME:$WEBUI_PORT" \
192230 -e "OPENWEBUI_ADMIN_EMAIL=$ADMIN_EMAIL" \
193231 -e "OPENWEBUI_ADMIN_PASSWORD=$ADMIN_PASSWORD" \
194232 -e "OPENWEBUI_EXPECTED_NONCE=$PROMPT_NONCE" \
195233 -e "OPENWEBUI_PROMPT=$PROMPT" \
234+ -e "OPENWEBUI_MODEL_ATTEMPTS=72" \
235+ -e "OPENWEBUI_MODEL_RETRY_MS=5000" \
196236"$GW_NAME" \
197237 node /app/scripts/e2e/openwebui-probe.mjs >/tmp/openwebui-probe.log 2>&1; then
198238 cat /tmp/openwebui-probe.log 2>/dev/null || true
199239echo "Open WebUI probe failed; gateway log tail:"
200- docker exec "$GW_NAME" bash -lc 'tail -n 200 /tmp/openwebui-gateway.log' || true
240+ docker inspect "$GW_NAME" --format '{{json .State}}' 2>/dev/null || true
241+if [ "$(docker inspect -f '{{.State.Running}}' "$GW_NAME" 2>/dev/null || echo false)" = "true" ]; then
242+ docker exec "$GW_NAME" bash -lc 'tail -n 200 /tmp/openwebui-gateway.log' || true
243+fi
244+ docker logs "$GW_NAME" 2>&1 | tail -n 200 || true
201245echo "Open WebUI container logs:"
202246 docker logs "$OW_NAME" 2>&1 | tail -n 200 || true
203247exit 1
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。