Title: Manually set terraform env variable prevents template creation · Issue #1359 · coder/coder · GitHub
Open Graph Title: Manually set terraform env variable prevents template creation · Issue #1359 · coder/coder
X Title: Manually set terraform env variable prevents template creation · Issue #1359 · coder/coder
Description: OS Information OS: Linux coder --version: Coder v0.5.5-devel+2d3dc43 Tue May 10 07:44:09 UTC 2022 Steps to Reproduce Set a terraform environment variable: export TF_LOG=1 Run coder server Create first template: coder templates create doc...
Open Graph Description: OS Information OS: Linux coder --version: Coder v0.5.5-devel+2d3dc43 Tue May 10 07:44:09 UTC 2022 Steps to Reproduce Set a terraform environment variable: export TF_LOG=1 Run coder server Create fi...
X Description: OS Information OS: Linux coder --version: Coder v0.5.5-devel+2d3dc43 Tue May 10 07:44:09 UTC 2022 Steps to Reproduce Set a terraform environment variable: export TF_LOG=1 Run coder server Create fi...
Opengraph URL: https://github.com/coder/coder/issues/1359
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Manually set terraform env variable prevents template creation","articleBody":"## OS Information\r\n\r\n- OS: Linux\r\n- `coder --version`: Coder v0.5.5-devel+2d3dc43 Tue May 10 07:44:09 UTC 2022\r\n\r\n## Steps to Reproduce\r\n\r\n1. Set a terraform environment variable: `export TF_LOG=1`\r\n2. Run `coder server`\r\n3. Create first template: `coder templates create docker-local -d ~/src/cdr/coder/examples/docker-local`\r\n\r\nThere should be no issue creating the template, or detailed hints on how to fix the problem (e.g. coder server is running with these environment variables set, please restart it without).\r\n\r\n## Actual\r\n\r\nTemplate creation fails:\r\n\r\n```console\r\n> Create and upload \"~/src/cdr/coder/examples/docker-local\"? (yes/no) yes\r\n✔ Queued [139ms]\r\n✔ Setting up [6ms]\r\n✔ Parse parameters [17ms]\r\n✘ Detecting persistent resources [420ms]\r\ntemplate import provision for start: recv import provision: set terraform env: manual setting of env var \"TF_LOG\" detected\r\n```\r\n\r\n## Notes\r\n\r\nConsidering [this comment](https://github.com/coder/coder/issues/1198#issuecomment-1120645349) I wanted to see if I can get more information out of terraform (a naive approach). I think it's fine the value can't be changed but I would have expected this value to either propagate to terraform or for the server to either inform of a way to fix it or filter out the variable.\r\n\r\nWe could for instance filter out some incompatible `TF_` env vars here, potentially logging the exclusion as a warning:\r\nhttps://github.com/coder/coder/blob/2d3dc436a81d2fe6fa8af7d4958b7a1f51f56caa/provisioner/terraform/provision.go#L93-L111\r\n\r\n## AC\r\n\r\nReplace the terraform exec command with directly executing terraform\r\nTest for the steps to repro this bug to validate this case is covered\r\nExpose in the logs that the env vars are set","author":{"url":"https://github.com/mafredri","@type":"Person","name":"mafredri"},"datePublished":"2022-05-10T09:58:38Z","url":"https://github.com/coder/coder/issues/1359"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ade316ed-d74b-2f14-e8b3-aef57dcdfa14 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9A4A:266B67:46A8DD:5D526C:6B0176BE |
| html-safe-nonce | 18df4b0b5f2fce9651dc8393912407e173798279eaded9443da1f65533a50686 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QTRBOjI2NkI2Nzo0NkE4REQ6NUQ1MjZDOjZCMDE3NkJFIiwidmlzaXRvcl9pZCI6IjIzODU1NjE5NjM0MTQ1MTc0MzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c5f73eec9415da3c83b71ae5ec1ec15154188e46f48eb940374e41d3ced3cb33 |
| hovercard-subject-tag | issue:1230912224 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/coder/1359/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2baec3639a962dd20023e626b1aff0359230184d605c2bdaaaf9420864e96805/coder/coder/issues/1359 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2baec3639a962dd20023e626b1aff0359230184d605c2bdaaaf9420864e96805/coder/coder/issues/1359 |
| og:image:alt | OS Information OS: Linux coder --version: Coder v0.5.5-devel+2d3dc43 Tue May 10 07:44:09 UTC 2022 Steps to Reproduce Set a terraform environment variable: export TF_LOG=1 Run coder server Create fi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mafredri |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/coder/coder git https://github.com/coder/coder.git |
| octolytics-dimension-user_id | 95932066 |
| octolytics-dimension-user_login | coder |
| octolytics-dimension-repository_id | 440752086 |
| octolytics-dimension-repository_nwo | coder/coder |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 440752086 |
| octolytics-dimension-repository_network_root_nwo | coder/coder |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width