spiffe / spire-tutorials

Apache License 2.0
84 stars 78 forks source link

Error while bootstrapping bundle in SPIRE Federation on Mac #128

Closed rootsongjc closed 10 months ago

rootsongjc commented 10 months ago

Description: I encountered an error while trying to set up SPIRE Federation on my Mac, following the instructions provided in this tutorial. Specifically, when executing the command ./2-bootstrap-federation.sh, I received the following error message:

bootstrapping bundle from broker to quotes-service server...
Error: unable to parse to spiffe bundle: spiffebundle: unable to parse JWKS: unexpected end of JSON input

Environment:

Docker Compose version: v2.23.0

Any guidance on resolving this issue would be greatly appreciated.

Thank you!

rootsongjc commented 10 months ago

Run the commands from 2-bootstrap-federation.sh manually on Mac:

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

echo "${bb}bootstrapping bundle from broker to quotes-service server...${nn}"
docker-compose -f "${DIR}"/docker-compose.yaml exec -T spire-server-broker \
    /opt/spire/bin/spire-server bundle show -format spiffe > "${DIR}"/docker/spire-server-stockmarket.example/conf/broker.example.bundle
docker-compose -f "${DIR}"/docker-compose.yaml exec -T spire-server-stock \
    /opt/spire/bin/spire-server bundle set -format spiffe -id spiffe://broker.example -path /opt/spire/conf/server/broker.example.bundle

echo "${bb}bootstrapping bundle from quotes-service to broker server...${nn}"
docker-compose -f "${DIR}"/docker-compose.yaml exec -T spire-server-stock \
    /opt/spire/bin/spire-server bundle show -format spiffe > "${DIR}"/docker/spire-server-broker.example/conf/stockmarket.example.bundle
docker-compose -f "${DIR}"/docker-compose.yaml exec -T spire-server-broker \
    /opt/spire/bin/spire-server bundle set -format spiffe -id spiffe://stockmarket.example -path /opt/spire/conf/server/stockmarket.example.bundle

The errors gone.