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

Error: Missing environment or workspace id #2372

Closed
davidshare opened this issue Sep 4, 2024 · 9 comments
Closed

Error: Missing environment or workspace id #2372

davidshare opened this issue Sep 4, 2024 · 9 comments

Comments

@davidshare
Copy link

davidshare commented Sep 4, 2024

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
Copy link
Author

davidshare commented Sep 4, 2024

I think this might be a result of the missing button to get the projectSlug

image

@davidshare
Copy link
Author

I ran a curl command to get the workspace, but the result was empty:

{"workspaces":[]}

@akhilmhdh
Copy link
Member

akhilmhdh commented Sep 4, 2024

Can you please update your infisical instance? It seems to be very old.

@davidshare
Copy link
Author

@akhilmhdh I got the most resent image tags and charts.

image
image
image

The versions I am using are the most recent ones.

@CuteSSu
Copy link

CuteSSu commented Oct 21, 2024

@davidshare
Hello, I have deployed both the latest version of the secret-operator(0.7.2) and the latest version of Infisical(0.4.2) using Helm. However, the 'project slug' button is still not visible on the dashboard, and I am encountering the same error as described in the this post. Did deploying the latest Helm version resolve this issue for you?

@davidshare
Copy link
Author

@CuteSSu I gave up trying to use it. The documentation for the chart is really poor, I couldn't find solutions for my issues, so I left it.

@maidul98
Copy link
Collaborator

Hi @davidshare , Infisical version less than v0.46.11 is not supported. This is a legacy version of Infisical running on Mongo DB. To update your instance of Infisical, please follow the guide here: https://infisical.com/docs/self-hosting/guides/mongo-to-postgres. If you have issues with k8s operator after upgrading your Infisical version, please let us know.

@davidshare
Copy link
Author

Hi @davidshare , Infisical version less than v0.46.11 is not supported. This is a legacy version of Infisical running on Mongo DB. To update your instance of Infisical, please follow the guide here: https://infisical.com/docs/self-hosting/guides/mongo-to-postgres. If you have issues with k8s operator after upgrading your Infisical version, please let us know.

I actually updated it to the latest version at the time when someone pointed me to it. I left it because I couldn't get the ingress to work.

@CuteSSu
Copy link

CuteSSu commented Oct 23, 2024

@davidshare
I solved it!
Can you Install infisical-standalone helm chat 1.2.0 instead of infisical helm chart 0.42?
Cuz infisical helm chart get dependencies mongodb, infisical-standalone get postgres (https://cloudsmith.io/~infisical/repos/helm-charts/packages/detail/helm/infisical-standalone/1.2.0/)
so if you install infisical-standalone, you don't have to migrate mongodb to prosgresql

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants