Welcome to our community! I’m sorry you are facing some issues using our Terraform Cloud integration so I’ll do my best to help you and solve this issue.
Could you please check if your project on SonarCloud, the one you are trying to configure on Terraform Cloud, has the New Code Definition set for the Quality Gate? I’m suspecting that might be the issue that is not clear from the error message causing the run task pre-plan to fail.
In the example below, this is a screenshot of a new project I added as an example on SonarCloud and since it’s new, it doesn’t have the New Code Definition set:
The New Code Definition was already set (to the previous version) and the quality gate is passing.
The most recent apply which triggered the 500 (during pre-plan for the apply) is today (July 10th) at 11:48:50 GMT, so the timestamp for the pre-plan would be within a few minutes before that.
I have been trying to replicate your issue on my side without being able to do it so far, unfortunately.
I confirmed that if the issue was related to the HMAC key, you would receive a different type of error (403 Forbidden).
Is it possible, in the meantime, to delete all configurations in Terraform Cloud and start from scratch? Meaning, remove the SonarCloud Run Task from the project, delete the Run Task from the organization, create it again, and add it back?
I can understand it can be frustrating as it’s a straightforward configuration. I’ll keep trying to duplicate it.
I wanted to catch up with you on this thread. I still haven’t been able to replicate the issue I’m afraid. Where you able to recreate all the configurations?