Error: Confluent Cloud backend error

Hi,
Im having a problem when I run the following command line while watching the kafka tutorial
Has anyone had the same problem to help me?

confluent api-key create --resource
Error: Confluent Cloud backend error: error getting service account: Bad Request. Must contain id or email

Hi, @josielesgoncalves - I can’t say I’ve seen that before. I would say maybe you need to log into your Confluent Cloud account before running the tutorial. Which one are you attempting to do?

Yes, I logged into my account and I was following the steps exactly like is described into section “CLI and Tools”

Thanks for confirming, @josielesgoncalves - can you give me the full URL of the tutorial you’re trying to work through?

I am getting the same error following the official doc Error: Confluent Cloud backend error: error getting service account: Bad Request. Must contain id or email when running the confluent api-key create --resource lkc-w5gd7m

the login is using the SSO. Checked the user is logged in already.

@bbejeck Im following these two links:

Thanks @josielesgoncalves and @shubh_k for confirming your details.
I can’t seem to reproduce the issue - I’ve asked internally for some support - stay tuned

Hi @josielesgoncalves and @shubh_k - can you confirm that you were passing in the cluster-id for the --resource flag?

One more thing - is this a persistent error for you? If so, can you re-run the command with this flag --unsafe-trace appended at the end and copy-paste the results here?

@bbejeck I’m passing the cluster-id like was discribed in tutorial

Result with the flag:

> 2023-05-08T15:11:34.307-0300 [DEBUG] UserService.GetServiceAccounts request: GET https://confluent.cloud/api/service_accounts
> 2023-05-08T15:11:35.290-0300 [DEBUG] UserService.GetServiceAccounts response: 200 OK X-Request-Id:0890490b5f98a1d196d51e8fcdabaadd Body: {"users":[],"page_info":{"page_size":0,"page_token":""},"error":null} request: GET https://confluent.cloud/api/service_accounts
> 2023-05-08T15:11:35.291-0300 [DEBUG] AuthService.User request: GET https://confluent.cloud/api/me
> 2023-05-08T15:11:35.543-0300 [DEBUG] AuthService.User response: 200 OK X-Request-Id:1b1384843470165a05b17af354cdc2e9 Body: {"error":null,"user":{"id":1307053,"email":"josiele.goncalves@evoluservices.com","first_name":"Josiele","last_name":"Gonçalves","deactivated":false,"verified":"2023-05-02T17:03:48.789116Z","created":"2023-05-02T17:03:48.773337Z","modified":"2023-05-08T18:09:46.061049Z","service_name":"","service_description":"","service_account":false,"preferences":{"branchPageShown":"COMPLETE","firstClusterCreationFlow":"COMPLETE","gettingStarted":"IN_PROGRESS","gettingStarted_accountId":"env-w5k6mj","gettingStarted_clusterId":"","gettingStarted_lastCompleteStep":"clusterCreate","gettingStarted_source":"free-trial-announcement","hasFinishedWelcomeSurvey":"true","sessionNumber":"9","showWelcomePageStatus":"COMPLETE","userReportedGoal":"no project","userReportedKafkaFamiliarity":"new","userReportedObjective":"learn","userReportedObjective_other":"","userReportedRole":"","userReportedRole_other":"","userReportedUseCase":"","userReportedUseCase_other":""},"internal":false,"resource_id":"u-z67z7z","deactivated_at":null,"social_connection":"google-oauth2","auth_type":"AUTH_TYPE_LOCAL"},"organization":{"id":347887,"name":"EvoluServices","deactivated":false,"stripe_customer_id":"","created":"2023-05-02T17:03:47.463541Z","modified":"2023-05-02T17:03:56.811513Z","billing_email":"","plan":{"tax_address":{"street1":"","street2":"","city":"","state":"","country":"","zip":""},"product_level":"UNIFIED","trial_start":null,"trial_end":null,"plan_start":null,"plan_end":null,"product":null,"billing":{"method":"STRIPE","interval":"MONTHLY","accrued_this_cycle":"0","stripe_customer_id":"cus_Np0dwUGLtzKdyp","email":"josiele.goncalves@evoluservices.com"},"referral_code":"","accept_tos":true,"allow_multi_tenant":true,"accept_tos_platform":false},"saml":null,"sso":{"enabled":false,"auth0_connection_name":"","tenant_id":"","multi_tenant":false,"mode":"SSO_MODE_UNKNOWN","connection_name":"","vendor":""},"marketplace":{"partner":"UNKNOWN","customer_id":"","customer_state":"CUSTOMER_APPROVAL_PENDING","console_integrated":false},"resource_id":"2401712a-ceeb-432f-950e-78cbc6f243a4","has_entitlement":false,"show_billing":true,"audit_log":{"cluster_id":"","account_id":"","service_account_id":0,"topic_name":"","service_account_resource_id":""},"has_commitment":false,"marketplace_subscription":"SUBSCRIPTION_NONE","deactivated_at":null,"suspension_status":{"suspended":null,"status":"SUSPENSION_UNKNOWN","event_type":"SUSPENSION_EVENT_UNKNOWN","scheduled_deactivated_at":null,"version":"0","error_message":"","scheduled_resources_deleted_at":null,"resources_deleted_at":null},"display_label":""},"accounts":[{"id":"env-w5k6mj","name":"default","organization_id":347887,"deactivated":false,"created":"2023-05-02T17:03:47.470632Z","modified":"2023-05-02T17:03:47.470632Z","config":{"max_kafka_clusters":0},"internal":false,"deactivated_at":null,"org_resource_id":"2401712a-ceeb-432f-950e-78cbc6f243a4"}],"account":{"id":"env-w5k6mj","name":"default","organization_id":347887,"deactivated":false,"created":"2023-05-02T17:03:47.470632Z","modified":"2023-05-02T17:03:47.470632Z","config":{"max_kafka_clusters":0},"internal":false,"deactivated_at":null,"org_resource_id":"2401712a-ceeb-432f-950e-78cbc6f243a4"}} request: GET https://confluent.cloud/api/me
> 2023-05-08T15:11:35.544-0300 [DEBUG] UserService.GetServiceAccount request: GET https://confluent.cloud/api/service_accounts/0
> 2023-05-08T15:11:35.768-0300 [DEBUG] UserService.GetServiceAccount response: 400 Bad Request X-Request-Id:8a1d5817a94efa85d006e55a65482576 Body: {"error":{"code":400,"message":"Bad Request. Must contain id or email"}}
>  request: GET https://confluent.cloud/api/service_accounts/0
> Error: Confluent Cloud backend error: error getting service account: Bad Request. Must contain id or email

Result with flag:

2023-05-08T15:11:34.307-0300 [DEBUG] UserService.GetServiceAccounts request: GET https://confluent.cloud/api/service_accounts
2023-05-08T15:11:35.290-0300 [DEBUG] UserService.GetServiceAccounts response: 200 OK X-Request-Id:0890490b5f98a1d196d51e8fcdabaadd Body: {"users":[],"page_info":{"page_size":0,"page_token":""},"error":null} request: GET https://confluent.cloud/api/service_accounts
2023-05-08T15:11:35.291-0300 [DEBUG] AuthService.User request: GET https://confluent.cloud/api/me
2023-05-08T15:11:35.543-0300 [DEBUG] AuthService.User response: 200 OK X-Request-Id:1b1384843470165a05b17af354cdc2e9 Body: {"error":null,"user":{"id":1307053,"email":"josiele.goncalves@evoluservices.com","first_name":"Josiele","last_name":"Gonçalves","deactivated":false,"verified":"2023-05-02T17:03:48.789116Z","created":"2023-05-02T17:03:48.773337Z","modified":"2023-05-08T18:09:46.061049Z","service_name":"","service_description":"","service_account":false,"preferences":{"branchPageShown":"COMPLETE","firstClusterCreationFlow":"COMPLETE","gettingStarted":"IN_PROGRESS","gettingStarted_accountId":"env-w5k6mj","gettingStarted_clusterId":"","gettingStarted_lastCompleteStep":"clusterCreate","gettingStarted_source":"free-trial-announcement","hasFinishedWelcomeSurvey":"true","sessionNumber":"9","showWelcomePageStatus":"COMPLETE","userReportedGoal":"no project","userReportedKafkaFamiliarity":"new","userReportedObjective":"learn","userReportedObjective_other":"","userReportedRole":"","userReportedRole_other":"","userReportedUseCase":"","userReportedUseCase_other":""},"internal":false,"resource_id":"u-z67z7z","deactivated_at":null,"social_connection":"google-oauth2","auth_type":"AUTH_TYPE_LOCAL"},"organization":{"id":347887,"name":"EvoluServices","deactivated":false,"stripe_customer_id":"","created":"2023-05-02T17:03:47.463541Z","modified":"2023-05-02T17:03:56.811513Z","billing_email":"","plan":{"tax_address":{"street1":"","street2":"","city":"","state":"","country":"","zip":""},"product_level":"UNIFIED","trial_start":null,"trial_end":null,"plan_start":null,"plan_end":null,"product":null,"billing":{"method":"STRIPE","interval":"MONTHLY","accrued_this_cycle":"0","stripe_customer_id":"cus_Np0dwUGLtzKdyp","email":"josiele.goncalves@evoluservices.com"},"referral_code":"","accept_tos":true,"allow_multi_tenant":true,"accept_tos_platform":false},"saml":null,"sso":{"enabled":false,"auth0_connection_name":"","tenant_id":"","multi_tenant":false,"mode":"SSO_MODE_UNKNOWN","connection_name":"","vendor":""},"marketplace":{"partner":"UNKNOWN","customer_id":"","customer_state":"CUSTOMER_APPROVAL_PENDING","console_integrated":false},"resource_id":"2401712a-ceeb-432f-950e-78cbc6f243a4","has_entitlement":false,"show_billing":true,"audit_log":{"cluster_id":"","account_id":"","service_account_id":0,"topic_name":"","service_account_resource_id":""},"has_commitment":false,"marketplace_subscription":"SUBSCRIPTION_NONE","deactivated_at":null,"suspension_status":{"suspended":null,"status":"SUSPENSION_UNKNOWN","event_type":"SUSPENSION_EVENT_UNKNOWN","scheduled_deactivated_at":null,"version":"0","error_message":"","scheduled_resources_deleted_at":null,"resources_deleted_at":null},"display_label":""},"accounts":[{"id":"env-w5k6mj","name":"default","organization_id":347887,"deactivated":false,"created":"2023-05-02T17:03:47.470632Z","modified":"2023-05-02T17:03:47.470632Z","config":{"max_kafka_clusters":0},"internal":false,"deactivated_at":null,"org_resource_id":"2401712a-ceeb-432f-950e-78cbc6f243a4"}],"account":{"id":"env-w5k6mj","name":"default","organization_id":347887,"deactivated":false,"created":"2023-05-02T17:03:47.470632Z","modified":"2023-05-02T17:03:47.470632Z","config":{"max_kafka_clusters":0},"internal":false,"deactivated_at":null,"org_resource_id":"2401712a-ceeb-432f-950e-78cbc6f243a4"}} request: GET https://confluent.cloud/api/me
2023-05-08T15:11:35.544-0300 [DEBUG] UserService.GetServiceAccount request: GET https://confluent.cloud/api/service_accounts/0
2023-05-08T15:11:35.768-0300 [DEBUG] UserService.GetServiceAccount response: 400 Bad Request X-Request-Id:8a1d5817a94efa85d006e55a65482576 Body: {"error":{"code":400,"message":"Bad Request. Must contain id or email"}}
 request: GET https://confluent.cloud/api/service_accounts/0
Error: Confluent Cloud backend error: error getting service account: Bad Request. Must contain id or email

@bbejeck when I paste the result, the message is removed.
By the way, I’m passing the cluter-id for the resourse flag.

I am passing the cluster id for --resource.
Results of the --unsafe trace are below

2023-05-09T00:15:58.659+0530 [DEBUG] UserService.GetServiceAccounts request: GET https://confluent.cloud/api/service_accounts
2023-05-09T00:16:00.318+0530 [DEBUG] UserService.GetServiceAccounts response: 200 OK X-Request-Id:86a68b9007b45a194ae7baafc852fc5a Body: {"users":[],"page_info":{"page_size":0,"page_token":""},"error":null} request: GET https://confluent.cloud/api/service_accounts
2023-05-09T00:16:00.318+0530 [DEBUG] AuthService.User request: GET https://confluent.cloud/api/me
2023-05-09T00:16:00.695+0530 [DEBUG] AuthService.User response: 200 OK X-Request-Id:f908b62e2100898f74b2201625c2f818 Body: {"error":null,"user":{"id":1295278,"email":"shubhkapoor43@gmail.com","first_name":"Shubham","last_name":"Kapoor","deactivated":false,"verified":"2023-04-26T19:06:27.153666Z","created":"2023-04-26T19:06:27.139531Z","modified":"2023-05-08T06:56:49.524945Z","service_name":"","service_description":"","service_account":false,"preferences":{"branchPageShown":"COMPLETE","firstClusterCreationFlow":"COMPLETE","gettingStarted":"IN_PROGRESS","gettingStarted_accountId":"env-1j0pg6","gettingStarted_clusterId":"lkc-w5gd7m","gettingStarted_lastCompleteStep":"clusterCreate","gettingStarted_source":"free-trial-announcement","hasFinishedWelcomeSurvey":"true","sessionNumber":"3","showWelcomePageStatus":"COMPLETE","userReportedGoal":"","userReportedKafkaFamiliarity":"unfamiliar","userReportedObjective":"learn","userReportedObjective_other":"","userReportedRole":"developer","userReportedRole_other":"","userReportedUseCase":"etl","userReportedUseCase_other":""},"internal":false,"resource_id":"u-v62zrn","deactivated_at":null,"social_connection":"google-oauth2","auth_type":"AUTH_TYPE_LOCAL"},"organization":{"id":345602,"name":"Afourtech","deactivated":false,"stripe_customer_id":"","created":"2023-04-26T19:06:25.725127Z","modified":"2023-04-26T19:06:38.340581Z","billing_email":"","plan":{"tax_address":{"street1":"","street2":"","city":"","state":"","country":"","zip":""},"product_level":"UNIFIED","trial_start":null,"trial_end":null,"plan_start":null,"plan_end":null,"product":null,"billing":{"method":"STRIPE","interval":"MONTHLY","accrued_this_cycle":"0","stripe_customer_id":"cus_NmnGXJjOiDxyYQ","email":"shubhkapoor43@gmail.com"},"referral_code":"","accept_tos":true,"allow_multi_tenant":true,"accept_tos_platform":false},"saml":null,"sso":{"enabled":false,"auth0_connection_name":"","tenant_id":"","multi_tenant":false,"mode":"SSO_MODE_UNKNOWN","connection_name":"","vendor":""},"marketplace":{"partner":"UNKNOWN","customer_id":"","customer_state":"CUSTOMER_APPROVAL_PENDING","console_integrated":false},"resource_id":"1ccbbd0b-3d1d-4aaa-abb4-12c739002372","has_entitlement":false,"show_billing":true,"audit_log":{"cluster_id":"","account_id":"","service_account_id":0,"topic_name":"","service_account_resource_id":""},"has_commitment":false,"marketplace_subscription":"SUBSCRIPTION_NONE","deactivated_at":null,"suspension_status":{"suspended":null,"status":"SUSPENSION_UNKNOWN","event_type":"SUSPENSION_EVENT_UNKNOWN","scheduled_deactivated_at":null,"version":"0","error_message":"","scheduled_resources_deleted_at":null,"resources_deleted_at":null},"display_label":""},"accounts":[{"id":"env-1j0pg6","name":"default","organization_id":345602,"deactivated":false,"created":"2023-04-26T19:06:25.730279Z","modified":"2023-04-26T19:06:25.730279Z","config":{"max_kafka_clusters":0},"internal":false,"deactivated_at":null,"org_resource_id":"1ccbbd0b-3d1d-4aaa-abb4-12c739002372"}],"account":{"id":"env-1j0pg6","name":"default","organization_id":345602,"deactivated":false,"created":"2023-04-26T19:06:25.730279Z","modified":"2023-04-26T19:06:25.730279Z","config":{"max_kafka_clusters":0},"internal":false,"deactivated_at":null,"org_resource_id":"1ccbbd0b-3d1d-4aaa-abb4-12c739002372"}} request: GET https://confluent.cloud/api/me
2023-05-09T00:16:00.698+0530 [DEBUG] UserService.GetServiceAccount request: GET https://confluent.cloud/api/service_accounts/0
2023-05-09T00:16:01.094+0530 [DEBUG] UserService.GetServiceAccount response: 400 Bad Request X-Request-Id:504dfccd970245427178c0372b341f59 Body: {"error":{"code":400,"message":"Bad Request. Must contain id or email"}}
 request: GET https://confluent.cloud/api/service_accounts/0
Error: Confluent Cloud backend error: error getting service account: Bad Request. Must contain id or email

@bbejeck yes I am passing the cluster id with the flag.
Please find the logs below

2023-05-09T00:16:00.698+0530 [DEBUG] UserService.GetServiceAccount request: GET https://confluent.cloud/api/service_accounts/0

2023-05-09T00:16:01.094+0530 [DEBUG] UserService.GetServiceAccount response: 400 Bad Request X-Request-Id:504dfccd970245427178c0372b341f59 Body: {“error”:{“code”:400,“message”:“Bad Request. Must contain id or email”}}

request: GET https://confluent.cloud/api/service_accounts/0

Error: Confluent Cloud backend error: error getting service account: Bad Request. Must contain id or email

Thanks for confirming the --resource parameter

1 Like

Thanks for providing the error logs!

@bbejeck follow the logs:

2023-05-09T06:10:08.895-0300 [DEBUG] UserService.GetServiceAccount request: GET https://confluent.cloud/api/service_accounts/0
2023-05-09T06:10:09.113-0300 [DEBUG] UserService.GetServiceAccount response: 400 Bad Request X-Request-Id:309ed19023ad850189f520e1c4174899 Body: {"error":{"code":400,"message":"Bad Request. Must contain id or email"}}
 request: GET https://confluent.cloud/api/service_accounts/0
Error: Confluent Cloud backend error: error getting service account: Bad Request. Must contain id or email

Hi @bbejeck! Same problem here. Do you need my logs too?

Thanks!

Thanks @josielesgoncalves !

Yes - more information would be helpful.

Here are the logs @bbejeck

confluent kafka cluster list
  Current |     ID     |       Name        | Type  | Provider |  Region   | Availability | Status  
----------+------------+-------------------+-------+----------+-----------+--------------+---------
  *       | lkc-nw8ddd | rs_poc_cluster_01 | BASIC | aws      | us-east-1 | single-zone  | UP      
❯ confluent api-key list --resource lkc-nw8ddd --unsafe-trace
...

2023-05-09T11:10:29.668-0300 [DEBUG] UserService.GetServiceAccounts request: GET https://confluent.cloud/api/service_accounts
2023-05-09T11:10:29.927-0300 [DEBUG] UserService.GetServiceAccounts response: 200 OK X-Request-Id:4cab8dac1003c0397c430af8ff3798ef Body: {"users":[],"page_info":{"page_size":0,"page_token":""},"error":null} request: GET https://confluent.cloud/api/service_accounts
2023-05-09T11:10:29.928-0300 [DEBUG] AuthService.User request: GET https://confluent.cloud/api/me
2023-05-09T11:10:30.183-0300 [DEBUG] AuthService.User response: 200 OK X-Request-Id:219588ad6ba5b9ea5a2428ba1d91d0d3 Body: {"error":null,"user":{"id":1295191,"email":"hernan.modrow@naranjax.com","first_name":"Hernan Enrique","last_name":"Modrow","deactivated":false,"verified":"2023-04-26T18:23:55.936212Z","created":"2023-04-26T18:23:55.923110Z","modified":"2023-05-09T12:40:26.736342Z","service_name":"","service_description":"","service_account":false,"preferences":{"branchPageShown":"COMPLETE","firstClusterCreationFlow":"COMPLETE","gettingStarted":"SKIPPED","gettingStarted_accountId":"env-7nz231","gettingStarted_clusterId":"","gettingStarted_lastCompleteStep":"bootstrapServer","gettingStarted_source":"free-trial-announcement","hasFinishedWelcomeSurvey":"true","sessionNumber":"5","showWelcomePageStatus":"COMPLETE","userReportedGoal":"","userReportedKafkaFamiliarity":"decided","userReportedObjective":"evaluate","userReportedObjective_other":"","userReportedRole":"architect","userReportedRole_other":"","userReportedUseCase":"microservice","userReportedUseCase_other":""},"internal":false,"resource_id":"u-rjxgq0","deactivated_at":null,"social_connection":"google-oauth2","auth_type":"AUTH_TYPE_LOCAL"},"organization":{"id":345582,"name":"Naranja X","deactivated":false,"stripe_customer_id":"","created":"2023-04-26T18:23:55.036212Z","modified":"2023-04-26T18:24:02.050297Z","billing_email":"","plan":{"tax_address":{"street1":"","street2":"","city":"","state":"","country":"","zip":""},"product_level":"UNIFIED","trial_start":null,"trial_end":null,"plan_start":null,"plan_end":null,"product":null,"billing":{"method":"STRIPE","interval":"MONTHLY","accrued_this_cycle":"0","stripe_customer_id":"cus_NmmZcE4QOekexT","email":"hernan.modrow@naranjax.com"},"referral_code":"","accept_tos":true,"allow_multi_tenant":true,"accept_tos_platform":false},"saml":null,"sso":{"enabled":false,"auth0_connection_name":"","tenant_id":"","multi_tenant":false,"mode":"SSO_MODE_UNKNOWN","connection_name":"","vendor":""},"marketplace":{"partner":"UNKNOWN","customer_id":"","customer_state":"CUSTOMER_APPROVAL_PENDING","console_integrated":false},"resource_id":"20c4b277-0e4a-4100-9e60-1fba93b85bcb","has_entitlement":false,"show_billing":true,"audit_log":{"cluster_id":"","account_id":"","service_account_id":0,"topic_name":"","service_account_resource_id":""},"has_commitment":false,"marketplace_subscription":"SUBSCRIPTION_NONE","deactivated_at":null,"suspension_status":{"suspended":null,"status":"SUSPENSION_UNKNOWN","event_type":"SUSPENSION_EVENT_UNKNOWN","scheduled_deactivated_at":null,"version":"0","error_message":"","scheduled_resources_deleted_at":null,"resources_deleted_at":null},"display_label":""},"accounts":[{"id":"env-7nz231","name":"default","organization_id":345582,"deactivated":false,"created":"2023-04-26T18:23:55.043911Z","modified":"2023-04-26T18:23:55.043911Z","config":{"max_kafka_clusters":0},"internal":false,"deactivated_at":null,"org_resource_id":"20c4b277-0e4a-4100-9e60-1fba93b85bcb"}],"account":{"id":"env-7nz231","name":"default","organization_id":345582,"deactivated":false,"created":"2023-04-26T18:23:55.043911Z","modified":"2023-04-26T18:23:55.043911Z","config":{"max_kafka_clusters":0},"internal":false,"deactivated_at":null,"org_resource_id":"20c4b277-0e4a-4100-9e60-1fba93b85bcb"}} request: GET https://confluent.cloud/api/me
2023-05-09T11:10:30.183-0300 [DEBUG] UserService.GetServiceAccount request: GET https://confluent.cloud/api/service_accounts/0
2023-05-09T11:10:30.433-0300 [DEBUG] UserService.GetServiceAccount response: 400 Bad Request X-Request-Id:088c3f149e3e676d02259c97e233f422 Body: {"error":{"code":400,"message":"Bad Request. Must contain id or email"}}
 request: GET https://confluent.cloud/api/service_accounts/0
Error: Confluent Cloud backend error: error getting service account: Bad Request. Must contain id or email