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 when creating tags with Triton provider #5836

Closed
chorrell opened this issue Mar 24, 2016 · 6 comments
Closed

Error when creating tags with Triton provider #5836

chorrell opened this issue Mar 24, 2016 · 6 comments
Labels

Comments

@chorrell
Copy link

I'm hitting an issue setting a tag for an instance using the Triton provider.

It works fine for simple tags like this:

  tags = {
          hello = "world"
          foo = "bar"
      }

But it fails with a tag like this:

  tags = {
          triton.cns.services = "test"
      }

The above tag sets a DNS name for the instance via the CNS service.

Here's the error I get:

Error applying plan:

1 error(s) occurred:

* triton_machine.test: failed to replace tags for machine with id 43f8bff9-ba48-4dae-89d3-d31e6c6c9d7f
caused by: Missing parameters https://us-east-1.api.joyent.com/christopher/machines/43f8bff9-ba48-4dae-89d3-d31e6c6c9d7f/tags
caused by: request "https://us-east-1.api.joyent.com/christopher/machines/43f8bff9-ba48-4dae-89d3-d31e6c6c9d7f/tags" returned unexpected status 409 with body "{\"code\":\"ValidationFailed\",\"message\":\"error replacing tags: Invalid tag parameters\",\"errors\":[{\"field\":\"tags\",\"code\":\"Invalid\",\"message\":\"\\\"\\\" is not DNS safe\"}]}"

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

What I think is happening is the CNS service tag name "test" is that some sort of escaping issue is happening, hence the "Invalid tag parameters" error and \"message\":\"\\\"\\\" is not DNS safe\". I think this might be because the tag name has periods ( .)

@jen20 jen20 added the bug label Mar 24, 2016
@jen20
Copy link
Contributor

jen20 commented Mar 24, 2016

Hi @chorrell! Just as a quick way of narrowing this down - do you get the same error if you specifiy the key as "triton.cns.services"?

@phinze
Copy link
Contributor

phinze commented Mar 25, 2016

Hi folks, this is an expression of a current limitation of Terraform's config that we're probably going to need to address soon - dots in keys do not work!

You can track the canonical issue for this problem over here: #2143

Going to close this issue to consolidate into that thread, feel free to follow up if you believe there's an independent problem to track here. 👍

@phinze phinze closed this as completed Mar 25, 2016
@chorrell
Copy link
Author

OK, makes sense. Is there any kind of workaround for this to get tags with . to work?

@sodre
Copy link
Contributor

sodre commented Apr 10, 2016

@phinze I would like to follow up on this bug/feature request. If what @chorrell really wants is to support Triton's CNS then it is an easier problem than #2143.

Triton CNS has a predefined set of tags that we can easily do an invertible transformation as data is exchanged between Terraform and Triton.

I have this working in my fork, I'll follow up with a pull-request shortly.

@jen20
Copy link
Contributor

jen20 commented Jun 11, 2016

Tags with dots now work ok (in 0.7.0-rc1)!

@ghost
Copy link

ghost commented Apr 25, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants