carbon keeps creating empty whisper files

Asked by Erik Blas

the daemon is running as root. its writing to a striped array that collectd has no problem writing to. I've:

cleared out the whisper files.
explicitly put root as the username to run carbon as.
the directory is writeable
restarted carbon-cache daemon.
console.log
http://screencast.com/t/RujVpxtI4L

this package has been driving me nuts.

Question information

Language:
English Edit question
Status:
Solved
For:
Graphite Edit question
Assignee:
No assignee Edit question
Solved by:
chrismd
Solved:
Last query:
Last reply:
Revision history for this message
Nicholas Leskiw (nleskiw) said :
#1

So some simple checks first.

0.) Are you using trunk? If not, please upgrade to trunk.
1.) df -h
2.) Do you know which wsp files are empty? It is just one of many, or do all of your metrics end up being empty .wsp files?

Revision history for this message
Erik Blas (erik-blas) said :
#2

0) i just grabbed the latest release tarball
1) all my drives have > 50% disk space left
2) all whisper files

Revision history for this message
Erik Blas (erik-blas) said :
#3

So tried again from scratch thinking there was a hidden config somewhere breaking crap, errors changed a bit to :
http://screencast.com/t/vDGjy8XLjVk3

Revision history for this message
Erik Blas (erik-blas) said :
#4

nor is carbon creating any new metrics sent to it:

listener saw the request:
http://screencast.com/t/yIvcw8WFrbE

the call i'm making and tail of creates.log right after:
http://screencast.com/t/4JXLo0L17pdO

Revision history for this message
Nicholas Leskiw (nleskiw) said :
#5

I'm not saying this is your issue, but in the last screenshot, you're using echo -n. That will skip the trailing newline. A trailing newline is *required* for graphite messages.

Try

echo -e "local.testing.var 200 `date +%s`\n\n" | nc localhost 2003

( -e interprets escape characters such as \n -> newline. Otherwise it'll print a literal 'n' )

See what happens with creates.log and the .wsp file.

For sanity's sake try a different filesystem. I'm running trunk r584 and can't reproduce this.

Revision history for this message
Best chrismd (chrismd) said :
#6

I had this happen to me when I tried trunk carbon with an older whisper.py installed. whisper.create calls can fail with the change to how xFilesFactor and aggregationMethod are now getting passed to it, so I would suggest doing a setup.py install --force of whisper and carbon, both from trunk, and see if this problem still exists.

Revision history for this message
Erik Blas (erik-blas) said :
#7

I removed the tarball install. I removed whisper through pip (which is how i originally installed it)

I did the following to reinstall:
http://graphite.wikidot.com/installation

finally got things to write properly, but now some slight wonkyness:
http://screencast.com/t/S9gNbso672

getting invalid line from client with that echo command, but graphite is rendering the graph with the change in value.

2ndly, if a remote host tries to connect nc just hangs and the listener never closes the connection (left hand side)

Revision history for this message
Nicholas Leskiw (nleskiw) said :
#8

Please do the following:

mkdir bzr
cd bzr
bzr co lp:graphite
cd graphite/whisper
sudo python ./setup.py install --force
cd ../carbon
python ./setup.py install --force # sudo this and the next line if the files were installed as root.
cd ../
python ./setup.py install --force
cd /opt/graphite/webapp/graphite
python ./manage.py syncdb

I don't know anything about pip, so I don't know what version of Graphite it installs. This will get trunk installed for sure, and the --force option is usually necessary.

Lastly, we have a new wiki: http://graphite.readthedocs.org/
I've updated the Wiki link on our Launchpad homepage to reflect this. The wikidot site is out-of-date.

Revision history for this message
Erik Blas (erik-blas) said :
#9

Thanks for the steps, I know of that wiki but it doesn't have the bzr steps outlined like the old docs page does. Not to mention entirely missing web app configuration. Remote hosts still need to use the -w flag from for nc to automatically kill the connection, though a local call seems to work just fine. Once I've that part figured out I'll be hella joyous!

Revision history for this message
Nicholas Leskiw (nleskiw) said :
#10

Are you still seeing empty wsp files? Or are you getting your data stored properly now?

Revision history for this message
Erik Blas (erik-blas) said :
#11

I'll go ahead and mark this issue as resolved. Data is being stored. The invalid lines bother me a bit, that's still happening, and the need to manually kill the netcat call, but I'll work around it. Thanks guys for all your help1

Revision history for this message
Erik Blas (erik-blas) said :
#12

Thanks chrismd, that solved my question.

Revision history for this message
Aman Gupta (tmm1) said :
#13

The invalid lines are because you are including multiple newlines at the end of your data.

The TCP line based protocol is designed to accept multiple lines over time, so it keeps the connection open. If you want to close the connection after one packet, it is up to you to configure your client (nc in this case) to do so.

Revision history for this message
Erik Blas (erik-blas) said :
#14

Hrm, that's curious that running the same line on the localhost closes the connection immediately, only remote connections hang.

Revision history for this message
Erik Blas (erik-blas) said :
#15

Argh, I wish I could edit comments, but if you look at posted screenshot, I tried echoing with just 1 new line char at the end of the statement and got the same line. No big deal though, the data's getting in.

Revision history for this message
Muhammad Umer Farooq (umer-g) said :
#16

Hi.

I am having the same problem. I installed graphite using the following fabric script,

https://github.com/gingerlime/graphite-fabric/blob/master/fabfile.py

which I believe installed the latest version of whisper. (http://pypi.python.org/pypi/whisper)

After deleting the files, If i restart the carbon daemon it creates the empty whisper files, which same filename and directory hierarchy.

Thanks.

Revision history for this message
Muhammad Umer Farooq (umer-g) said :
#17

Just wanted to add this problem has seemed to be solved. I was using statsd counter. which also returns 0 as value if that event did not occur.

sorry for the late reply.