cancel
Showing results for 
Search instead for 
Did you mean: 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
cancel
Showing results for 
Search instead for 
Did you mean: 

Google PubSub for DLT - Error

itamarwe
New Contributor II

I'm trying to create a delta live table from a Google PubSub stream.

Unfortunately I'm getting the following error:

org.apache.spark.sql.streaming.StreamingQueryException: [PS_FETCH_RETRY_EXCEPTION] Task in pubsub fetch stage cannot be retried. Partition 0.3 in stage 3.0, TID 14. SQLSTATE: 22000

My code is below. What could explain this error and how can it be solved?

authOptions = {

"clientId" : "XXX",

"clientEmail" : "XXX",

"privateKey" : "-----BEGIN PRIVATE KEY-----\nXXX-----END PRIVATE KEY-----\n",

"privateKeyId" : "XXX"

}

stream=spark.readStream \

.format("pubsub") \

.option("subscriptionId","XXX") \

.option("topicId","XXX") \

.option("projectId","XXX") \

.options(**authOptions) \

.load()
1 ACCEPTED SOLUTION

Accepted Solutions

Kaniz_Fatma
Community Manager
Community Manager

Hi @itamarwe, Could you please double-check your authentication credentials (authOptions). Please ensure that the client ID, client email, private key, and private key ID are correctly specified and verify that the service account associated with these credentials has the necessary permissions to access the PubSub topic and subscription.

View solution in original post

3 REPLIES 3

Kaniz_Fatma
Community Manager
Community Manager

Hi @itamarwe, Could you please double-check your authentication credentials (authOptions). Please ensure that the client ID, client email, private key, and private key ID are correctly specified and verify that the service account associated with these credentials has the necessary permissions to access the PubSub topic and subscription.

itamarwe
New Contributor II

Hi @Kaniz_Fatma, it was indeed a permissions issue. Nevertheless, I must admit that the error message is slightly misleading.
Thanks.

Cheers, Glad to hear that.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group