Skip to content
This repository has been archived by the owner on Dec 5, 2020. It is now read-only.

unexpected EOF when trying to create a rancher_stack #30

Closed
mcanevet opened this issue Aug 25, 2017 · 6 comments
Closed

unexpected EOF when trying to create a rancher_stack #30

mcanevet opened this issue Aug 25, 2017 · 6 comments

Comments

@mcanevet
Copy link
Contributor

Terraform-provider-rancher Version

v0.2.0

Affected Resource(s)

  • rancher_stack

Terraform Configuration Files

resource "rancher_stack" "letsencrypt" {
  name           = "letsencrypt2"
  environment_id = "1a5"
  catalog_id      = "community:letsencrypt:4"
  start_on_create = true
  finish_upgrade  = true

  environment {
    API_VERSION            = "Production"
    AWS_ACCESS_KEY         = ""
    AWS_SECRET_KEY         = ""
    CERT_NAME              = "myservice.example.com"
    DOMAINS                = "myservice.example.com"
    EMAIL                  = "letsencrypt@example.com"
    EULA                   = "Yes"
    PROVIDER               = "HTTP"
    PUBLIC_KEY_TYPE        = "RSA-2048"
    RENEWAL_TIME           = "12"
    CLOUDFLARE_EMAIL       = ""
    CLOUDFLARE_KEY         = ""
    DNSIMPLE_EMAIL         = ""
    DNSIMPLE_KEY           = ""
    DO_ACCESS_TOKEN        = ""
    DYN_CUSTOMER_NAME      = ""
    DYN_PASSWORD           = ""
    DYN_USER_NAME          = ""
    GANDI_API_KEY          = ""
    OVH_APPLICATION_KEY    = ""
    OVH_APPLICATION_SECRET = ""
    OVH_CONSUMER_KEY       = ""
    STORAGE_DRIVER         = ""
    VULTR_API_KEY          = ""
    AZURE_CLIENT_ID        = "" 
    AZURE_CLIENT_SECRET    = "" 
    AZURE_RESOURCE_GROUP   = "" 
    AZURE_SUBSCRIPTION_ID  = "" 
    AZURE_TENANT_ID        = "" 
    DNS_RESOLVERS          = ""
    PROVIDER               = "HTTP" 
    RENEWAL_PERIOD_DAYS    = "20" 
    RUN_ONCE               = "false" 
    STORAGE_DRIVER_OPT     = "" 
    VOLUME_NAME            = "" 
  }
}

Debug Output

https://gist.github.com/mcanevet/b65de88b338b8ee20cfee4b4390e9e77

It's the only stack where I have this issue. All other catalogs I use works fine.

@mcanevet
Copy link
Contributor Author

@raphink any idea?

@mcanevet mcanevet added the crash label Aug 30, 2017
@mathewpeterson
Copy link

@mcanevet I've also ran into an issue like this. I worked around it by using the docker-compose.yml and rancher-compose.yml instead of using the catalog_id

It seems the issue is that the module does not read the docker-compose.yml value: https://github.com/terraform-providers/terraform-provider-rancher/blob/master/rancher/resource_rancher_stack.go#L417-L418

@raphink
Copy link
Contributor

raphink commented Sep 18, 2017

Indeed, it seems quite a few templates in the community catalog have a file called docker-compose.yml.tpl instead of docker-compose.yml, which makes the Rancher provider fail to retrieve the files.

@raphink
Copy link
Contributor

raphink commented Sep 18, 2017

I don't see how this works in Rancher, if it tries both files or just doesn't bother with file names (which seems strange, given that the API clearly requires to pass docker-compose and rancher-compose). @cloudnautique can you bring some light on this?

@raphink raphink added the bug label Sep 18, 2017
@raphink
Copy link
Contributor

raphink commented Sep 20, 2017

Apparently, this is supported in Rancher (although undocumented) through https://github.com/rancher/rancher-compose-executor/blob/master/project/init.go#L90-L93:

		for _, validSuffix := range []string{
			".yml",
			".yaml",
			".yml.tpl",
			".yaml.tpl",
		} {
			if strings.HasSuffix(filename, validSuffix) {
				filtereredTemplates[filename] = contents
				break
			}
		}

@mcanevet
Copy link
Contributor Author

Fix in #41

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

No branches or pull requests

3 participants