charts icon indicating copy to clipboard operation
charts copied to clipboard

You must configure atleast one key in backend.auth.keys for production

Open SriGitHubSri opened this issue 1 year ago • 3 comments

I just tried to clone the chart repo and deployed this backstage helm chart without making any change and getting this error. Please could you suggest the following 2 queries

  1. How can i configure and run in a development environment instead of production?
  2. What configuration is required to resolve this issue?

**_Error Message:

"level":"warn","message":"You should NOT be using the guest provider outside of a development environment.","plugin":"auth","service":"backstage"} /app/node_modules/@backstage/backend-app-api/dist/index.cjs.js:1486 throw new Error( ^

Error: Failed to instantiate service 'core.tokenManager' for 'search' because the factory function threw an error, Error: Failed to instantiate service 'core.tokenManager' because createRootContext threw an error, Error: You must configure at least one key in backend.auth.keysfor production._** at /app/node_modules/@backstage/backend-app-api/dist/index.cjs.js:1486:17 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async BackendInitializer.getInitDeps_fn (/app/node_modules/@backstage/backend-app-api/dist/index.cjs.js:1649:20) at async /app/node_modules/@backstage/backend-app-api/dist/index.cjs.js:1784:32 at async processNode (/app/node_modules/@backstage/backend-app-api/dist/index.cjs.js:1307:22) at async Promise.all (index 0) at async processMoreNodes (/app/node_modules/@backstage/backend-app-api/dist/index.cjs.js:1302:7) at async _DependencyGraph.parallelTopologicalTraversal (/app/node_modules/@backstage/backend-app-api/dist/index.cjs.js:1313:5) at async /app/node_modules/@backstage/backend-app-api/dist/index.cjs.js:1782:9 at async Promise.all (index 7) at async BackendInitializer.doStart_fn (/app/node_modules/@backstage/backend-app-api/dist/index.cjs.js:1762:3) at async BackendInitializer.start (/app/node_modules/@backstage/backend-app-api/dist/index.cjs.js:1616:5) at async BackstageBackend.start (/app/node_modules/@backstage/backend-app-api/dist/index.cjs.js:1886:5)

Requesting your help in getting this resolved. Looking forward to hear from you

SriGitHubSri avatar Apr 05 '24 12:04 SriGitHubSri

in values.yaml you should specify backend.auth.keys image

MarkPorohnja avatar Apr 08 '24 11:04 MarkPorohnja

Example values to make helm chart work: values.yaml

backstage:
  image:
    tag: 1.26.3
  appConfig:
    app:
      baseUrl: http://localhost:7007
    backend:
      auth:
        keys:  # random-bytes-base64
          - secret: aWVzaGllZ2g1aHUzbWVldGg1QWVtb29sCg==
  args:
    - "--config"
    - "/app/app-config.yaml"

chobostar avatar Apr 30 '24 14:04 chobostar

@SriGitHubSri As @chobostar has suggested, you should be able to get around this using the above configuration. Also as @vinzscam describes in 187 this won't be required in the next release of Backstage.

Feel free to close the issue if you're happy with the response.

ChrisJBurns avatar May 11 '24 12:05 ChrisJBurns

Closing the issue, as Backstage 1.27+ doesn't require any secret anymore in app-config.

vinzscam avatar Jul 02 '24 18:07 vinzscam