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

-config directory doesn't follow symlinks #579

Closed
jippi opened this issue Mar 15, 2016 · 2 comments
Closed

-config directory doesn't follow symlinks #579

jippi opened this issue Mar 15, 2016 · 2 comments
Labels

Comments

@jippi
Copy link
Contributor

jippi commented Mar 15, 2016

when having a -config directory to scan recursively, consul-template seem to error out on symlinks

I'm getting the following error

config: walk error: error reading config at "/etc/consul-template/config/frontend": read /etc/consul-template/config/frontend: is a directory

a ls

root @ local.bownty.net [ /etc/consul-template/config ] [ 15:49:26 ]  (master *%)
-> ls -al
4 -rw-r--r-- 1 root root   62 Mar  4 14:38 config.hcl
4 lrwxrwxrwx 1 root root   68 Mar 15 15:46 frontend -> /var/www/frontend/htdocs/_infrastructure/dist/consul-template/config

a ls on the symlink

root @ local.bownty.net [ /etc/consul-template/config ] [ 15:49:27 ]  (master *%)
-> ll /var/www/frontend/htdocs/_infrastructure/dist/consul-template/config
total 20
4 drwxr-xr-x 2 root root 4096 Mar 15 15:27 .
4 drwxr-xr-x 4 root root 4096 Mar 15 15:27 ..
4 -rw-r--r-- 1 root root  226 Mar 15 15:46 nginx.hcl
4 -rw-r--r-- 1 root root  217 Mar 15 15:46 php-fpm.hcl
4 -rw-r--r-- 1 root root  219 Mar 15 15:46 supervisor.hcl

it works perfectly if i remove the symlink and move the folders inside the directory

command executed:

/usr/local/bin/consul-template -config /etc/consul-template/config/
@sethvargo sethvargo added the bug label Mar 16, 2016
@sethvargo
Copy link
Contributor

Hi @jippi

I did some digging into this issue, and it appears to be a core issue in Go (golang/go#4759). Go's filepath.Walk function does not follow symlinks because it's difficult to get correct and avoid infinite loops.

@sethvargo
Copy link
Contributor

I spent some time thinking (and playing with potential fixes), and I think we should take a hint from the core team here (who are much smarter than me). There doesn't seem to be a good and safe way to follow directory symlinks. I'm going to update the documentation to make this clearer.

sethvargo added a commit that referenced this issue Apr 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants