mozilla-services / heka

DEPRECATED: Data collection and processing made easy.
http://hekad.readthedocs.org/
Other
3.39k stars 529 forks source link

panic if no config file (?) #1597

Open haf opened 9 years ago

haf commented 9 years ago
heka_1 | panic: assignment to entry in nil map
heka_1 |
heka_1 | goroutine 1 [running]:
heka_1 | github.com/mozilla-services/heka/pipeline.(*PipelineConfig).LoadConfig(0xc208074400, 0x0, 0x0)
heka_1 |    /usr/src/heka/build/heka/src/github.com/mozilla-services/heka/pipeline/config.go:715 +0x9c1
heka_1 | main.loadFullConfig(0xc208074400, 0xc20802b210, 0x0, 0x0)
heka_1 |    /usr/src/heka/build/heka/src/github.com/mozilla-services/heka/cmd/hekad/main.go:221 +0x504
heka_1 | main.main()
heka_1 |    /usr/src/heka/build/heka/src/github.com/mozilla-services/heka/cmd/hekad/main.go:188 +0x112a
heka_1 |
heka_1 | goroutine 5 [syscall]:
heka_1 | os/signal.loop()
heka_1 |    /usr/src/go/src/os/signal/signal_unix.go:21 +0x1f
heka_1 | created by os/signal.init·1
heka_1 |    /usr/src/go/src/os/signal/signal_unix.go:27 +0x35

Maybe it's because there are no config folder. But the software should not panic like this; it should specify the error of the config.

trixpan commented 9 years ago

Hmmmm... not sure what is going on in here.

I've just tried to reproduce and could not.

System is a vanilla CentOS.

# /usr/bin/hekad
2015/09/20 21:08:27 Error reading config: Error opening config file: open /etc/hekad.toml: no such file or directory
# touch heka.toml
# /usr/bin/hekad -config=heka.toml
2015/09/20 21:09:24 Pre-loading: [ProtobufDecoder]
2015/09/20 21:09:24 Loading: [ProtobufDecoder]
2015/09/20 21:09:24 Pre-loading: [ProtobufEncoder]
2015/09/20 21:09:24 Loading: [ProtobufEncoder]
2015/09/20 21:09:24 Pre-loading: [TokenSplitter]
2015/09/20 21:09:24 Loading: [TokenSplitter]
2015/09/20 21:09:24 Pre-loading: [HekaFramingSplitter]
2015/09/20 21:09:24 Loading: [HekaFramingSplitter]
2015/09/20 21:09:24 Pre-loading: [NullSplitter]
2015/09/20 21:09:24 Loading: [NullSplitter]
2015/09/20 21:09:24 Starting hekad...
2015/09/20 21:09:24 MessageRouter started.
^C2015/09/20 21:09:25 Shutdown initiated.
2015/09/20 21:09:25 Waiting for decoders shutdown
2015/09/20 21:09:25 Decoders shutdown complete
2015/09/20 21:09:25 Shutdown complete.
rafrombrc commented 9 years ago

The issue happens if you explicitly use an empty directory as the config setting, or if you point it at an empty TOML file. I've opened #1740 which should resolve.

trixpan commented 9 years ago

@rafrombrc

Cool. I could not reproduce the issue, even with an empty file (note the touch heka.toml step taken above) but happy to assume it happens.

Cheers

rafrombrc commented 9 years ago

Yeah I think it was only happening when the empty TOML file was in a directory and Heka was pointed at the folder for its config.