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

Memcached unix socket panic #841

Closed
tdewolff opened this issue Mar 12, 2016 · 1 comment · Fixed by #912
Closed

Memcached unix socket panic #841

tdewolff opened this issue Mar 12, 2016 · 1 comment · Fixed by #912
Labels
bug unexpected problem or unintended behavior

Comments

@tdewolff
Copy link

I have configured memcached as

# Read metrics from one or many memcached servers
[[inputs.memcached]]
  ## An array of address to gather stats about. Specify an ip on hostname
  ## with optional port. ie localhost, 10.0.0.1:11211, etc.
  # servers = ["localhost:11211"]
  unix_sockets = ["/var/run/memcached/memcached.sock"]

But this throws the following panic:

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x40 pc=0x56e61b]

goroutine 1 [running]:
github.com/influxdata/telegraf/plugins/inputs/memcached.(*Memcached).gatherServer(0xc8200c3950, 0xc8200c38c1, 0x21, 0xc8200c8101, 0x7f4120b25340, 0xc82004af00, 0x0, 0x0)
        /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/plugins/inputs/memcached/memcached.go:117 +0x1fb
github.com/influxdata/telegraf/plugins/inputs/memcached.(*Memcached).Gather(0xc8200c3950, 0x7f4120b25340, 0xc82004af00, 0x0, 0x0)
        /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/plugins/inputs/memcached/memcached.go:83 +0x261
github.com/influxdata/telegraf/agent.(*Agent).Test(0xc820028000, 0x0, 0x0)
        /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/agent/agent.go:228 +0x434
main.main()
        /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/cmd/telegraf/telegraf.go:190 +0x120e

The file /var/run/memcached/memcached.sock exists and has 766 memcached:memcached permissions.

@sparrc
Copy link
Contributor

sparrc commented Mar 22, 2016

thanks for the report, it looks like we were overwriting our own net connection within an if statement that was going out of scope. This will be fixed in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants