italia / Satosa-Saml2Spid

SATOSA SAML-to-SAML proxy with Spid compliances
Apache License 2.0
41 stars 25 forks source link

registry.spid.gov.it often returns 502: Bad Gateway #144

Closed elisanp closed 3 weeks ago

elisanp commented 1 month ago

When executing the demo project presented here the following problem might appear.

When trying to download spid-entities-idps.xml from https://registry.spid.gov.it/entities-idp, the registry.spid.gov.it service is often not available returning the following error which causes the application to crash e not be able to start successfully

Resolving registry.spid.gov.it (registry.spid.gov.it)... 93.147.186.172 Connecting to registry.spid.gov.it (registry.spid.gov.it)|93.147.186.172|:443... connected. HTTP request sent, awaiting response... 502 Bad Gateway ERROR 502: Bad Gateway.

Traceback (most recent call last): File "/usr/lib/python3.12/xml/etree/ElementTree.py", line 1713, in close self.parser.Parse(b"", True) # end of data ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ xml.parsers.expat.ExpatError: no element found: line 1, column 0 ... saml2.SAMLError: Failed to parse metadata file: ./metadata/idp/spid-entities-idps.xml

A possible solution could be to update the example/entrypoint.sh as follows

wget https://registry.spid.gov.it/entities-idp -O metadata/idp/spid-entities-idps.xml status=$? while [ $status != 0 ]; do echo "Retrying download from registry.spid.gov.it..." wget https://registry.spid.gov.it/entities-idp -O metadata/idp/spid-entities-idps.xml status=$? done

elisanp commented 3 weeks ago

Closed with #147