On my docker-compose file I added a healthcheck, but it fails because Sonarqube requires authentication...
It doesn't work:
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/api/system/health"]
start_period: 10s
interval: 30s
timeout: 10s
retries: 5
I did manage to make it work when I added the admin user. However, I don't understand why a simple health check requires the user to be authenticated. The "status" endpoint doesn't require...
It does work:
curl -f -u admin:admin http://localhost:9000/api/system/health
The reason is that api/system/health displays sensitive information. I suggest to replace this call with the API api/system/status. It does not require special permissions and returns {"status": "UP"
} when everything is good.
Meanwhile I close this issue. Thanks for your understanding.
@simonbrandhof Thank you!
Most helpful comment
The reason is that
api/system/healthdisplays sensitive information. I suggest to replace this call with the APIapi/system/status. It does not require special permissions and returns{"status": "UP" }when everything is good.Meanwhile I close this issue. Thanks for your understanding.