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

Make server work under non-admin user on Windows #77

Closed
radeksimko opened this issue Apr 29, 2020 · 1 comment · Fixed by #78
Closed

Make server work under non-admin user on Windows #77

radeksimko opened this issue Apr 29, 2020 · 1 comment · Fixed by #78
Labels
bug Something isn't working
Milestone

Comments

@radeksimko
Copy link
Member

Server Version

0.1.0

(launched as regular, non-admin user on Windows 10 Pro)

Terraform Version

0.12.24

Client Version

Sublime Text LSP v0.9.8

Terraform Configuration Files

provider "aws" {
}

Log Output

2020/04/29 22:29:10 exec.go:172: Starting C:\ProgramData\chocolatey\bin\terraform.exe ["terraform" "version"] in "C:\\Users\\RADEKS~1\\AppData\\Local\\Temp"...
2020/04/29 22:29:10 exec.go:138: Waiting for command to finish ...
2020/04/29 22:29:10 rpc_logger.go:45: Error for "initialize" (ID 1): [-32098] failed to get version: terraform (pid 5008) exited (code 1): exit status 1
stdout: ""
stderr: "Couldn't setup logging tempfile: open C:\\Windows\\terraform-log151023907: Access is denied."

Expected Behavior

terraform version should've run successfully, with log file being created in temporary directory.

Actual Behavior

Server stopped because Terraform stopped because Terraform couldn't create the temp log file in C:\Windows (which is the default TempDir location if no ENV variables are available, as Windows doesn't seem to have a static system-wide temp dir? 😱 ).

Steps to Reproduce

  1. Open a folder with the above config
  2. Open file with the above config from that folder
  3. Watch log

Proposal

We just need to whitelist a few more ENV variables here

// We don't perform upgrade from the context of executor
// and don't report outdated version to users,
// so we don't need to ask checkpoint for upgrades.
cmd.Env = append(cmd.Env, "CHECKPOINT_DISABLE=1")
// This allows Terraform to find custom-built providers
if v := os.Getenv("HOME"); v != "" {
cmd.Env = append(cmd.Env, "HOME="+v)
}
if v := os.Getenv("USER"); v != "" {
cmd.Env = append(cmd.Env, "USER="+v)
}

@radeksimko radeksimko added the bug Something isn't working label Apr 29, 2020
@radeksimko radeksimko changed the title Pass TempDir related ENV variables to Terraform Make server work under non-admin user on Windows Apr 29, 2020
@radeksimko radeksimko added this to the v0.2.0 milestone Apr 29, 2020
@ghost
Copy link

ghost commented Jun 12, 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 context necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Jun 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant