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

[BUG] Failure of creating Subscription for event-mesh-sap2sap #1004

Closed
1 task done
mvk-abs opened this issue Jan 28, 2025 · 2 comments · Fixed by #1005
Closed
1 task done

[BUG] Failure of creating Subscription for event-mesh-sap2sap #1004

mvk-abs opened this issue Jan 28, 2025 · 2 comments · Fixed by #1005
Assignees
Labels
bug Something isn't working
Milestone

Comments

@mvk-abs
Copy link

mvk-abs commented Jan 28, 2025

Is there an existing issue for this?

  • I have searched the existing issues

What version of the Terraform provider are you using?

1.9.0

What version of the Terraform CLI are you using?

1.10.5

What type of issue are you facing

bug report

Describe the bug

Currently the deployment of a subscription for event-mesh-sap2sap resource fails with error

 Error: API Error Creating Resource Subscription (Subaccount)
│ 
│   with btp_subaccount_subscription.sap2sap_subscribe,
│   on main.tf line 33, in resource "btp_subaccount_subscription" "sap2sap_subscribe":
│   33: resource "btp_subaccount_subscription" "sap2sap_subscribe" {
│ 
│ undefined API error during subscription

Checking the resource in the BTP Cockpit revelas following error

Couldn't subscribe to SAP Cloud Application Event Hub. Please try again. If the problem persists, open a support case using the component: CA-EB.

So i investigated th btp cli using btp get accounts/subscription --subaccount xxxxxx --of-app event-mesh-sap2sap --plan standard and checked the state of the subscription there. This revealed

app name:                                             event-mesh-sap2sap
commercial app name:                                  event-mesh-sap2sap
app id:                                               event-mesh-sap2sap-app!t26928
plan name:                                            standard
supports plan updates:                                false
Whether it supports subscription parameters update:   false
type:                                                 
status:                                               SUBSCRIBE_FAILED
application url:                                      
subscribed tenant id:                                 xxxxxx
subscribed subaccount id:                             xxxxxx
subscription id:                                      
app error:   {"description":"failed to unmarshal SubscriptionContext json"}

This seems to be an issue of the GO BTP Provider unmarshalling a json file obviously.

Expected Behavior

When i create the subscription using the btp cli then it all works fine. So this should also be the case using the BTP Terraform provider.

Steps To Reproduce

  1. Execute a terraform init
  2. Execute a terraform apply with the following configuration
hcl
resource "random_uuid" "uuid" {}
resource "btp_subaccount" "project" {
  name         = "terraform-test"
  subdomain    = "terraform-test-${random_uuid.uuid.result}"
  region       = lower("eu20")
  usage        = "USED_FOR_PRODUCTION"
  parent_id    = [inclue your parentId here]
  beta_enabled = true
}

resource "btp_subaccount_entitlement" "sap2sap" {
  subaccount_id = btp_subaccount.project.id
  service_name  = "event-mesh-sap2sap"
  plan_name     = "standard"
}

resource "btp_subaccount_subscription" "sap2sap_subscribe" {
  depends_on    = [btp_subaccount_entitlement.sap2sap]
  subaccount_id = btp_subaccount.project.id
  app_name      = "event-mesh-sap2sap"
  plan_name     = "standard"
}

User's Role Collections

  • Global Account Administrator
  • Subaccount Administrator

Add screenshots to help explain your problem

No response

Additional context

No response

@mvk-abs mvk-abs added bug Something isn't working needs-triage For new issues labels Jan 28, 2025
@lechnerc77 lechnerc77 removed the needs-triage For new issues label Jan 28, 2025
@lechnerc77
Copy link
Member

Error could be reproduced. The implementation of the event-mesh-sap2sap app cannot handle an empty JSON file for parameters (in contrast to other subscriptions)

The provisioning of parameter JSON must be relaxed.

In addition, the error message could be improved if saas manager response object returns an app error (as displayed in the cockpit)

@lechnerc77 lechnerc77 added this to the 1.10.0 milestone Jan 28, 2025
@lechnerc77
Copy link
Member

@mvk-abs PR #1005 is open and in review. The fix should be available with the next release of the provider (release 1.10.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants