All Apps and Add-ons

Error on creating a PubSub input from a service-account in the Google Cloud Platform Addon

dcgen17
Explorer

Hello, 

From my client I created a service-account in the Google Cloud Platform: 

{
  "type": "service_account",
  "project_id": "<MY SPLUNK PROJECT>",
  "private_key_id": "<MY PK ID>",
  "private_key": "-----BEGIN PRIVATE KEY-----\<MY PRIVATE KEY>\n-----END PRIVATE KEY-----\n",
  "client_email": "<splunk>@<splunk>-<blabla>,
  "client_id": "<MY CLIENT ID>",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://accounts.google.com/o/oauth2/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/<MY-SPLUNK-URL>"
}

The service-account was recognized by the Addon so I imagined that the connection was established correctly. 

When later I created the first input to collect the logs (a PubSub), when I am searching for the "Projects" connected to this service-account (in the photo)

Foto2.jpg

it returns me the error "External handler failed with code '1' and output ''. see splunkd.log for stderr"

Actually the stderr in splunkd gives no useful information (just a generic error), so I am blocked at the moment.
I also downloaded the code from Google Cloud Platform Add-on but it is not an easy debugging process, I cannot find what is the actual query that the Addon performs when clicking on "Projects". 

Someone have some idea on this error? 

Thanks



Labels (1)
0 Karma
1 Solution

dcgen17
Explorer

Hello @Meett 

In the splunkd I see a copy of the error "External handler failed with code '1' and output ''.  without any specific additional information. 

Luckily I solve the issue for this case:

It was not an Addon problem but a Google Cloud permission issue. In fact, I did not have the Viewer permission for the Projects to execute correctly the queries from Splunk. 

A very simple case, complicated by the fact that the Addon returns no details about the error.

Bye, thanks



View solution in original post

Meett
Splunk Employee
Splunk Employee

Hey @dcgen17 What do you see in Splunkd Logs ? 

0 Karma

dcgen17
Explorer

Hello @Meett 

In the splunkd I see a copy of the error "External handler failed with code '1' and output ''.  without any specific additional information. 

Luckily I solve the issue for this case:

It was not an Addon problem but a Google Cloud permission issue. In fact, I did not have the Viewer permission for the Projects to execute correctly the queries from Splunk. 

A very simple case, complicated by the fact that the Addon returns no details about the error.

Bye, thanks



pkolhatk
Explorer

what access was given to service account for the connection to happen ?

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...