Bug #622
crushtool useless parse error
0%
Description
I can't decide whether this is a bug in crushtool or a bug in my crushmap but whichever it is, the error message isn't helpful.
Attached is my human readable crushmap. When I compile this with crushtool, I get an error:
root@srv-an56n:~# crushtool -c /tmp/crush.txt -o /tmp/crush.new /tmp/crush.txt:28 error: parse error at '# regions'
If I delete that comment line I get:
/tmp/crush.txt:27 error: parse error at ''
I'm certain I successfully compiled a very similar crushmap with 0.23.1
This is with 78a14622438addcd5c337c4924cce1f67d053ee9 from the rc branch.
History
#1 Updated by Sage Weil over 13 years ago
- Assignee set to Colin McCabe
#2 Updated by Sage Weil over 13 years ago
- Target version set to v0.24
#3 Updated by Colin McCabe over 13 years ago
I was able to get the crushmap.txt to work by deleting the word "domain" in the gb1 region.
We should definitely have some kind of better error message here. I'll take a quick look at whether Sprite has any obvious way of improving this. (Just letting the user know that the problem was with region gb1 would be a plus.)
--- crushmap.txt.1 2010-12-02 11:38:43.816441440 0800 item domain gb1a weight 4.000
++ crushmap.txt 2010-12-02 11:38:32.696350797 -0800@ -30,8 +30,8
@
id -3
alg straw
hash 0
- item domain gb1b weight 4.000
item gb1a weight 4.000
+ item gb1b weight 4.000
}
#4 Updated by Colin McCabe over 13 years ago
Reposting the diff; hopefully clearer this time.
--- crushmap.txt.1 2010-12-02 11:38:43.816441440 -0800
+++ crushmap.txt 2010-12-02 11:38:32.696350797 -0800
@ -30,8 +30,8
@
id -3
alg straw
hash 0
- item domain gb1a weight 4.000
- item domain gb1b weight 4.000
+ item gb1a weight 4.000
+ item gb1b weight 4.000
}
#5 Updated by Colin McCabe over 13 years ago
There is a more advanced error handling API for spirit described at:
http://www.boost.org/doc/libs/1_41_0/libs/spirit/classic/doc/error_handling.html
Using this, we could give the user more information about errors than just a line number.
#6 Updated by Colin McCabe over 13 years ago
- Status changed from New to Resolved
Resolved-- the crushmap.txt was bad.
I created #628 for getting better error messages from crushtool.