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 run -f uses different relative path to locate file secrets when using a secretstores.local.file component #1505

Open
marcduiker opened this issue Mar 14, 2025 · 0 comments
Labels
kind/bug Something isn't working

Comments

@marcduiker
Copy link
Contributor

Expected Behavior

When running dapr run -f . and a local file secret store is used where the path is relative to the location where the dapr run command is started, Dapr should initialize the secret component successfully.

apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
  name: daprSecretStore
  namespace: default
spec:
  type: secretstores.local.file
  version: v1
  metadata:
  - name: secretsFile
    value: ./Resources/secrets.json
  - name: nestedSeparator
    value: ":"

Actual Behavior

The local secrets.json file can't be found when running dapr run -f ..

Output:

time="2025-03-14T11:19:25.198140021Z" level=fatal msg="Fatal error from runtime: process component daprSecretStore error: [INIT_COMPONENT_FAILURE]: initialization error occurred for daprSecretStore (secretstores.local.file/v1): [INIT_COMPONENT_FAILURE]: initialization error occurred for daprSecretStore (secretstores.local.file/v1): open ./Resources/secrets.json: no such file or directory" app_id=workflow instance=15022173cb30 scope=dapr.runtime type=log ver=1.15.3

When the path in the secretstores.local.file is changed to

    value: ./../Resources/secrets.json

The component is initialized successfully. But this is not the path relative to where the dapr run command is started.


When the regular dapr run command is used it does work with the relative path of value: ./Resources/secrets.json.

dapr run --app-id workflow-app --resources-path ./Resources --app-port 5253 --dapr-http-port 3516 -- dotnet run --project ./WorkflowApp/

Output

INFO[0000] Component loaded: daprSecretStore (secretstores.local.file/v1)  app_id=workflow-app instance=15022173cb30 scope=dapr.runtime.processor type=log ver=1.15.3

Steps to Reproduce the Problem

Run dapr run -f . in the root of this repo. I'm using a devcontainer running in WSL on Windows (it also reproduces on Windows without a Linux devcontainer).

Release Note

RELEASE NOTE:

@marcduiker marcduiker added the kind/bug Something isn't working label Mar 14, 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