hashicorp / hashicorp/consul

Windows consul command line paths

Open
#10,918 16 comments 1 reaction 0 assignees View on GitHub
help-wanted theme/windows type/bug
Dominant language
Go
Stars
30.1k
Forks
4.6k
Avg merge
1d 18h
Merged PRs (30d)
39

Description

#### Overview of the Issue

Consul does not understand a windows path correctly when it ends with a `\` as is common for folders. `For example using consul.exe agent -config-dir "C:\Program Files\Consul\consul.d\"` will fail with `==> config: Open failed on C:\Program Files\Consul\consul.d". open C:\Program Files\Consul\consul.d": The filename, directory name, or volume label syntax is incorrect.` notice the error message leaving out the trailing `\`

The same problem can be seen on other config settings also, for example on data_dir.

#### Reproduction Steps

Steps to reproduce this issue, eg:

1. Try to run consul with `consul.exe agent -config-dir "C:\Program Files\Consul\consul.d\" `and config files placed in C:\Program Files\Consul\consul.d\

### Operating system and Environment details

Windows server 2019
Consul v1.10.1
Revision db839f18b

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the Windows command with a trailing backslash in -config-dir, then trace how Consul parses and opens config paths. Check the same behavior for data_dir. Done means trailing-backslash Windows paths work without dropping the slash or producing an invalid path error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.