infisical icon indicating copy to clipboard operation
infisical copied to clipboard

Error: Missing environment or workspace id

Open davidshare opened this issue 6 months ago • 4 comments

Describe the bug

I self-hosted infisical chart v0.4.2 with appVersion 1.17.0. I also installed the secrets-operator 0.7.1. Everything runs fine except that the secret is not being pulled into the cluster.

The secret is not being created in the namespace of the deployment. When I check the logs of the infisical backend, I see error logs indicating that it is looking for a workspace Id.

To Reproduce

Steps to reproduce the behavior:

  1. Install infisical helm chart 0.42
  2. Install secrets-operator 0.71
  3. create a project and add a secret
  4. Create universal auth credentials and apply it to the cluster
  5. create the invisical secrets CRD
  6. check the logs of the infisical backend

error:

{"level":30,"time":1725426266813,"pid":1,"hostname":"infisical-backend-5bb789bb75-st6pd","severity":"INFO","msg":{"_logLevel":30,"_logName":"INFO","statusCode":400,"type":"bad_request","context":{},"extra":[],"stacktrace":["Error: Missing environment or workspace id","    at BadRequestError (/backend/build/utils/errors.js:79:12)","    at /backend/build/controllers/v3/secretsController.js:196:44","    at Generator.next (<anonymous>)","    at fulfilled (/backend/build/controllers/v3/secretsController.js:28:58)","    at runMicrotasks (<anonymous>)","    at processTicksAndRejections (node:internal/process/task_queues:96:5)"]}}
8
{"level":30,"time":1725426286918,"pid":1,"hostname":"infisical-backend-5bb789bb75-st6pd","severity":"INFO","msg":"getSecretsRaw: fetch raw secrets [environment=dev] [workspaceId=] [secretPath=/] [includeImports=true]"}
7
{"level":30,"time":1725426286919,"pid":1,"hostname":"infisical-backend-5bb789bb75-st6pd","severity":"INFO","msg":{"_logLevel":30,"_logName":"INFO","statusCode":400,"type":"bad_request","context":{},"extra":[],"stacktrace":["Error: Missing environment or workspace id","    at BadRequestError (/backend/build/utils/errors.js:79:12)","    at /backend/build/controllers/v3/secretsController.js:196:44","    at Generator.next (<anonymous>)","    at fulfilled (/backend/build/controllers/v3/secretsController.js:28:58)","    at runMicrotasks (<anonymous>)","    at processTicksAndRejections (node:internal/process/task_queues:96:5)"]}}
6
{"level":30,"time":1725426307030,"pid":1,"hostname":"infisical-backend-5bb789bb75-st6pd","severity":"INFO","msg":"getSecretsRaw: fetch raw secrets [environment=dev] [workspaceId=] [secretPath=/] [includeImports=true]"}

Expected behavior

I expect a secret to be created in the namespace of my deployment and the deployment should be able to access the secret

Screenshots

If applicable, add screenshots to help explain your problem.

Platform you are having the issue on:

infisical chart 0.42

Additional context

Add any other context about the problem here.

apiVersion: secrets.infisical.com/v1alpha1
kind: InfisicalSecret
metadata:
  name: {{ include "busy.fullname" . }}-infisicalsecret-crd
  labels:
    {{- include "busy.labels" . | nindent 4 }}
spec:
  hostAPI: {{ .Values.infisical.hostApi }}
  resyncInterval: {{ .Values.infisical.resyncInterval }}
  authentication:
    universalAuth:
      secretsScope:
        projectSlug: {{ .Values.infisical.projectSlug }}
        envSlug: {{ .Values.infisical.envSlug }}
        secretsPath: "{{ .Values.infisical.secretsPath }}"
      credentialsRef:
        secretName: {{ .Values.infisical.credentialsRef.secretName }}
        secretNamespace: {{ .Values.infisical.credentialsRef.secretNamespace }}
  managedSecretReference:
    secretName: {{ .Values.infisical.managedSecretReference.secretName }}
    secretNamespace: {{ .Values.infisical.managedSecretReference.secretNamespace }}
    creationPolicy: {{ .Values.infisical.managedSecretReference.creationPolicy }}
    ```

davidshare avatar Sep 04 '24 05:09 davidshare