Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terraform SAP provider 500 error while provisioning multiple resources #840

Closed
1 task done
rohitsinghsap opened this issue Jun 27, 2024 · 5 comments
Closed
1 task done
Labels
question Further information is requested

Comments

@rohitsinghsap
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

What version of the Terraform provider are you using?

1.8.5

What version of the Terraform CLI are you using?

1.8.5

What type of issue are you facing

bug report

Describe the bug

I have written a terraform code for different BTP resources and then created a main.tf file where I am calling modules for provisioning of BTP resources. When I have added 3-4 resources then I was not getting any error but when I have completed with incorporating all eight resources module for provisioning then it gives an error of 500. Sample error
"Error: unableToCreateClient

│ with module.role.provider["registry.terraform.io/sap/btp"],
│ on Modules/prod/produs/btp/role/provider.tf line 10, in provider "btp":
│ 10: provider "btp" {

│ received response with unexpected status [Status: 500; Correlation ID: 718fcf36-1b2e-f6de-759b-07ed33b543d9]"

Expected Behavior

While running terraform plan and apply this error is coming unexpectedly. but expected behaviour is that terraform plan and apply command will run without any error.

Steps To Reproduce

No response

User's Role Collections

No response

Add screenshots to help explain your problem

Screenshot 2024-06-27 at 9 46 55 PM

Additional context

No response

@rohitsinghsap rohitsinghsap added bug Something isn't working needs-triage For new issues labels Jun 27, 2024
@lechnerc77 lechnerc77 added question Further information is requested and removed bug Something isn't working needs-triage For new issues labels Jun 28, 2024
@lechnerc77
Copy link
Member

@rohitsinghsap This error has nothing to do with your configuration. You are probably having a wrong configuration of your provider as it is unable to create the client defined in the module.
Please make sure that the module only contains the required provider and not the a full provider configuration as in your main configuration files.

The provider block should look like this in your modules:

terraform {
  required_providers {
    btp = {
      source  = "sap/btp"
      version = "~> 1.4.0"
    }
  }
}

Your main configuration should be the only place that contains the provider configuration.

@rohitsinghsap
Copy link
Author

@lechnerc77 Hi, The provider block in modules are same as you mentioned.
terraform {
required_providers {
btp = {
source = "SAP/btp"
version = "1.4.0"
}
}
}

With the configurations I have I am able to provision resources but sometime 500 error is there while running terraform plan or apply command. If there is any issue with the provider configuration, it shouldn't work anytime.

@lechnerc77
Copy link
Member

This error is raised when the authentication with the SAP BTP fails. So maybe there is an temporal issue with the SAP BTP that you ran into or an issue with your IdP.

@rohitsinghsap
Copy link
Author

@lechnerc77 should I try with custom IdP? right now I am using default IdP.

@lechnerc77
Copy link
Member

@lechnerc77 should I try with custom IdP? right now I am using default IdP.

No, this can also be an issue with standard IdP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants