Relay troubleshooting
| Response | Likely cause | Solution |
|---|---|---|
401 without a body |
Key missing, truncated or renewed | Copy the whole key; after a renewal, take the new one from App keys, not from the deployment outputs. |
401: Invalid x-relay-key |
x-relay-key header missing or different from RELAY_EXTRA_API_KEY |
Fix the header in the tool. |
404 without a body |
Code not installed, typo in the route (/api/envelope instead of /api/enveloppe) or wrong method |
Redo step 5 of the deployment, check the route and the method. |
400: Invalid JSON body |
Invalid JSON, or unexpected type: number or boolean in quotes, string instead of a list | See Common pitfalls. |
400 with another message |
Required field missing or invalid value: the message names the field | Fix the field. |
500: Relay is not configured |
Credential missing, invalid or empty; invalid SE_ENDPOINT; Key Vault reference not resolved (missing role assignment, unreachable vault) |
Check the application settings, the role assignment on the vault, then restart the application. |
500: internal error |
Network failure or exception during the call | Retry; if the error persists, check the Function App's logs. |
502 |
No usable response from Secure Exchanges, often a licence used on the wrong environment | Change SE_ENDPOINT to the other environment, then restart. |
403 |
Secure Exchanges refuses the licence or the access key, for example on the wrong environment | Check the environment and your licence's API access; if needed, write to supportdev@secure-exchanges.info. |
/api/version answers 200, but /api/enveloppe answers 500 or 502 |
/api/version does not check the configuration |
Handle the /api/enveloppe error according to the lines above. |
A recipient has a status other than 200 |
Secure Exchanges refused them, or the email could not leave | Check their address or number. The other recipients may have been served. |
See the logs
The deployment does not create Application Insights. To diagnose an error that persists, add it to the Function App, in a region suited to your obligations, with a short retention period: see Logs and personal information.