coreos / mayday

A diagnostics tool for capturing system state.
Apache License 2.0
80 stars 27 forks source link

Config file parsing is incomplete #53

Closed brianredbeard closed 7 years ago

brianredbeard commented 7 years ago

It seems that #36 isn't actually searching the correct paths (or filenames). I've moved default.json from the repo into /usr/share/mayday/default.json but it seems to be really intent on calling the file config.json (or toml, yaml, really anything except default.json). In addition --help is still not working:

[bharrington@leviathan mayday]$ ./bin/mayday  --help
2016/08/22 21:32:14 Fatal error reading config: %s 
Unsupported Config Type ""

At least at this point a bunch of the functional pieces are in place and we can dig through from there.

[bharrington@leviathan mayday]$ sha1sum /usr/share/mayday/default.json 
5f5bb0f360b7d2a184ce431d850c53df0fdccc6e  /usr/share/mayday/default.json
[bharrington@leviathan mayday]$ sha1sum default.json 
5f5bb0f360b7d2a184ce431d850c53df0fdccc6e  default.json
[bharrington@leviathan mayday]$ git log --oneline -1
2721a67 Merge pull request #36 from tschuy/confignotfounderror
[bharrington@leviathan mayday]$ strace -e trace=stat ./bin/mayday 
stat(".", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
stat("/home/bharrington/Projects/mayday", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
stat("/etc/mayday/config.json", 0xc820150ac8) = -1 ENOENT (No such file or directory)
stat("/etc/mayday/config.toml", 0xc820150b98) = -1 ENOENT (No such file or directory)
stat("/etc/mayday/config.yaml", 0xc820150c68) = -1 ENOENT (No such file or directory)
stat("/etc/mayday/config.yml", 0xc820150d38) = -1 ENOENT (No such file or directory)
stat("/etc/mayday/config.properties", 0xc820150e08) = -1 ENOENT (No such file or directory)
stat("/etc/mayday/config.props", 0xc820150ed8) = -1 ENOENT (No such file or directory)
stat("/etc/mayday/config.prop", 0xc820150fa8) = -1 ENOENT (No such file or directory)
stat("/etc/mayday/config.hcl", 0xc820151078) = -1 ENOENT (No such file or directory)
stat("/home/bharrington/Projects/mayday/config.json", 0xc820151148) = -1 ENOENT (No such file or directory)
stat("/home/bharrington/Projects/mayday/config.toml", 0xc820151218) = -1 ENOENT (No such file or directory)
stat("/home/bharrington/Projects/mayday/config.yaml", 0xc8201512e8) = -1 ENOENT (No such file or directory)
stat("/home/bharrington/Projects/mayday/config.yml", 0xc8201513b8) = -1 ENOENT (No such file or directory)
stat("/home/bharrington/Projects/mayday/config.properties", 0xc820151488) = -1 ENOENT (No such file or directory)
stat("/home/bharrington/Projects/mayday/config.props", 0xc820151558) = -1 ENOENT (No such file or directory)
stat("/home/bharrington/Projects/mayday/config.prop", 0xc820151628) = -1 ENOENT (No such file or directory)
stat("/home/bharrington/Projects/mayday/config.hcl", 0xc8201516f8) = -1 ENOENT (No such file or directory)
stat("/etc/mayday/config.json", 0xc8201517c8) = -1 ENOENT (No such file or directory)
stat("/etc/mayday/config.toml", 0xc820151898) = -1 ENOENT (No such file or directory)
stat("/etc/mayday/config.yaml", 0xc820151968) = -1 ENOENT (No such file or directory)
stat("/etc/mayday/config.yml", 0xc820151a38) = -1 ENOENT (No such file or directory)
stat("/etc/mayday/config.properties", 0xc820151b08) = -1 ENOENT (No such file or directory)
stat("/etc/mayday/config.props", 0xc820151bd8) = -1 ENOENT (No such file or directory)
stat("/etc/mayday/config.prop", 0xc820151ca8) = -1 ENOENT (No such file or directory)
stat("/etc/mayday/config.hcl", 0xc820151d78) = -1 ENOENT (No such file or directory)
stat("/home/bharrington/Projects/mayday/config.json", 0xc820151e48) = -1 ENOENT (No such file or directory)
stat("/home/bharrington/Projects/mayday/config.toml", 0xc820151f18) = -1 ENOENT (No such file or directory)
stat("/home/bharrington/Projects/mayday/config.yaml", 0xc8201be038) = -1 ENOENT (No such file or directory)
stat("/home/bharrington/Projects/mayday/config.yml", 0xc8201be108) = -1 ENOENT (No such file or directory)
stat("/home/bharrington/Projects/mayday/config.properties", 0xc8201be1d8) = -1 ENOENT (No such file or directory)
stat("/home/bharrington/Projects/mayday/config.props", 0xc8201be2a8) = -1 ENOENT (No such file or directory)
stat("/home/bharrington/Projects/mayday/config.prop", 0xc8201be378) = -1 ENOENT (No such file or directory)
stat("/home/bharrington/Projects/mayday/config.hcl", 0xc8201be448) = -1 ENOENT (No such file or directory)
2016/08/22 21:28:44 Fatal error reading config: %s 
Unsupported Config Type ""
+++ exited with 1 +++
brianredbeard commented 7 years ago

Appears that this was weirdness with the build script and my specific environment.

$ glide list
....
MISSING packages:
    github.com/coreos/mayday/mayday
    github.com/coreos/mayday/mayday/plugins/command
    github.com/coreos/mayday/mayday/plugins/docker
    github.com/coreos/mayday/mayday/plugins/file
    github.com/coreos/mayday/mayday/plugins/journal
    github.com/coreos/mayday/mayday/plugins/rkt
    github.com/coreos/mayday/mayday/tar
    github.com/coreos/mayday/mayday/tarable
    github.com/coreos/mayday/mayday/plugins/rkt/v1alpha