Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conflicting terraform metadata keys results in error: internal provisionerserver error with no details #14387

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

Closed
Emyrk opened this issue Aug 21, 2024 · 1 comment · Fixed by coder/terraform-provider-coder#277

Comments

@Emyrk
Copy link
Member

Emyrk commented Aug 21, 2024

If you repeat a metadata block, such as doing this:

  metadata {
    display_name = "CPU Usage"
    key          = "0_cpu_usage"
    script       = "coder stat cpu"
    interval     = 10
    timeout      = 1
  }

  metadata {
    display_name = "CPU Usage"
    key          = "0_cpu_usage"
    script       = "coder stat cpu"
    interval     = 10
    timeout      = 1
  }

The cli output is:

error: internal provisionerserver error

This error is entirely unhelpful. The error in the backend logs is:

error= insert resource: insert agent metadata: pq: duplicate key value violates unique constraint "workspace_agent_metadata_pkey", params: {WorkspaceAgentID:b1951800-89a4-4465-ae67-c8aabd9f32a8 DisplayName:CPU Usage Key:0_cpu_usage Script:coder stat cpu Timeout:1 Interval:10 DisplayOrder:0}: pq: duplicate key value violates unique constraint "workspace_agent_metadata_pkey"
@ethanndickson
Copy link
Member

For any similar errors that wouldn't be caught by the plan validation, #14572 also ensures that the error trace in the backend logs gets appended to internal provisionerserver error.

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

Successfully merging a pull request may close this issue.

2 participants