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

Getting status: 406 (Not Acceptable) when configuring example #116

Open
chomey opened this issue Jul 27, 2021 · 0 comments
Open

Getting status: 406 (Not Acceptable) when configuring example #116

chomey opened this issue Jul 27, 2021 · 0 comments

Comments

@chomey
Copy link

chomey commented Jul 27, 2021

My terraform looks like this:

terraform {
  required_providers {
    teamcity = {
      source = "cvbarros/teamcity"
      version = "1.0.1"
    }
  }
}

provider "teamcity" {
  # It is strongly recommended to configure this provider through the
  # environment variables described above, so that each user can have
  # separate credentials set in the environment.

  address = "<redacted>"
  username = "<redacted>"
  password = "<redacted>"
}

resource "teamcity_project" "parent" {
  name        = "Parent"
  description = "Parent Project, will be created under the 'Root' project"

  env_params = {
    variable1 = "env_value1"
    variable2 = "env_value2"
  }
}

resource "teamcity_project" "child" {
  name        = "Child"
  description = "Child Project, will be created under 'Parent' project"
  parent_id   = teamcity_project.parent.id

  config_params = {
    variable1 = "config_value1"
    variable2 = "config_value2"
  }

  sys_params = {
    variable1 = "system_value1"
    variable2 = "system_value2"
  }
}

This is basically copy pasted out of https://github.com/cvbarros/terraform-provider-teamcity/blob/master/examples/project/project.tf

I'm getting the following result (with debug logging):

teamcity_project.parent: Creating...
2021-07-27T16:39:51.927-0700 [INFO]  Starting apply for teamcity_project.parent
2021-07-27T16:39:51.928-0700 [DEBUG] teamcity_project.parent: applying the planned Create change
2021-07-27T16:39:51.928-0700 [TRACE] GRPCProvider: ApplyResourceChange
2021-07-27T16:39:52.913-0700 [TRACE] maybeTainted: teamcity_project.parent encountered an error during creation, so it is now marked as tainted
2021-07-27T16:39:52.913-0700 [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState to workingState for teamcity_project.parent
2021-07-27T16:39:52.913-0700 [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState: removing state object for teamcity_project.parent
2021-07-27T16:39:52.913-0700 [TRACE] evalApplyProvisioners: teamcity_project.parent is tainted, so skipping provisioning
2021-07-27T16:39:52.913-0700 [TRACE] maybeTainted: teamcity_project.parent was already tainted, so nothing to do
2021-07-27T16:39:52.913-0700 [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState to workingState for teamcity_project.parent
2021-07-27T16:39:52.913-0700 [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState: removing state object for teamcity_project.parent
2021-07-27T16:39:52.913-0700 [TRACE] vertex "teamcity_project.parent": visit complete
2021-07-27T16:39:52.913-0700 [TRACE] dag/walk: upstream of "teamcity_project.child" errored, so skipping
2021-07-27T16:39:52.913-0700 [TRACE] dag/walk: upstream of "provider[\"registry.terraform.io/cvbarros/teamcity\"] (close)" errored, so skipping
2021-07-27T16:39:52.913-0700 [TRACE] dag/walk: upstream of "meta.count-boundary (EachMode fixup)" errored, so skipping
2021-07-27T16:39:52.913-0700 [TRACE] dag/walk: upstream of "root" errored, so skipping
╷
│ Error: Error '406' when performing 'PUT' operation - project name: Responding with error, status code: 406 (Not Acceptable).
│ Make sure you have supplied correct 'Accept' header.
│ 
│   with teamcity_project.parent,
│   on main.tf line 20, in resource "teamcity_project" "parent":
│   20: resource "teamcity_project" "parent" {
│ 
╵

Weirdly, this is actually creating the project in my Root Project on my TeamCity instance though.

Any advice would be super helpful, as I'm not sure how to debug this!

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

1 participant