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

Dapr Binding with GCP Storage Bucket Giving parse error #3671

Open
ujala-singh opened this issue Feb 17, 2025 · 0 comments
Open

Dapr Binding with GCP Storage Bucket Giving parse error #3671

ujala-singh opened this issue Feb 17, 2025 · 0 comments
Labels
kind/bug Something isn't working

Comments

@ujala-singh
Copy link

Expected Behavior

It should create and download the file on GCS bucket when I try to make curl requests from a k8s pod within GKE Cluster.

Actual Behavior

Its not creating and downloading the files via curl. Create operation does not produce any error but Get operation does.

[root@postgres-app-757599df69-px5bk application]# curl -d '{ "operation": "create", "data": "Hello World! GCP Test", "metadata": { "key": "my-test-file.txt" } }' http://localhost:3500/v1.0/bindings/objectstore
{"objectURL":"https://storage.googleapis.com/bucket-enpla9up56/my-test-file.txt"}[root@postgres-app-757599df69-px5bk application]#
[root@postgres-app-757599df69-px5bk application]#
[root@postgres-app-757599df69-px5bk application]# curl -d '{ "operation": "get", "metadata": { "key": "my-test-file.txt" } }' http://localhost:3500/v1.0/bindings/objectstore
{"errorCode":"ERR_INVOKE_OUTPUT_BINDING","message":"error invoking output binding objectstore: gcp bucketgcp bucket binding error: error downloading bucket object: Get \"https://storage.googleapis.com/bucket-enpla9up56/my-test-file.txt\": private key should be a PEM or plain PKCS1 or PKCS8; parse error: asn1: structure error: tags don't match (16 vs {class:0 tag:13 length:45 isCompound:true}) {optional:false explicit:false application:false private:false defaultValue:\u003cnil\u003e tag:\u003cnil\u003e stringType:0 timeType:0 set:false omitEmpty:false} pkcs1PrivateKey @2"}[root@postgres-app-757599df69-px5bk application]#
[root@postgres-app-757599df69-px5bk application]#

Steps to Reproduce the Problem

I am running a sidecar based deployment for my app. Below is my component config:

apiVersion: dapr.io/v1alpha1
auth:
  secretStore: kubernetes
kind: Component
metadata:
  labels:
    argocd.argoproj.io/instance: enpla9up56
  name: objectstore
  namespace: default
spec:
  metadata:
    - name: bucket
      value: bucket-enpla9up56
    - name: project_id
      value: enpla9up56-402407
    - name: type
      value: service_account
  type: bindings.gcp.bucket
  version: v1

And I am using below annotation to my deployment's service account where sidecar is attached:

annotations:
      iam.gke.io/gcp-service-account: [email protected]

I am able to list the buckets using gcloud cli using the same service account.

Dapr Runtime Version: 1.14.4

@ujala-singh ujala-singh added the kind/bug Something isn't working label Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant