#!/usr/bin/env bash # What happens when the resource server starts and the issuer is not reachable. # Worth capturing because the failure is at STARTUP, not at first request - which means # a provider outage during a rolling deploy takes your API down with it. set -u cd "$(dirname "$0")/.." . scripts/lib.sh OUT=../docs/output/as-rs-startup-failure.txt mkdir -p ../docs/output kill_app ResourceServerApplication 8090 kill_app AuthServerApplication 9000 sleep 1 mvn -B -o -pl resource-server org.springframework.boot:spring-boot-maven-plugin:run \ > /tmp/rs-fail.log 2>&1 || true { echo "# resource-server started with spring.security.oauth2.resourceserver.jwt.issuer-uri" echo "# pointing at an authorization server that is not running." echo grep -E '^Caused by|Unable to resolve the Configuration' /tmp/rs-fail.log \ | sed 's/^Caused by: //' | head -8 } > "$OUT" cat "$OUT"