Project

General

Profile

Actions

Bug #2922

closed

mkcephfs fails with error "read: arg count"

Added by Tamilarasi muthamizhan over 11 years ago. Updated over 11 years ago.

Status:
Resolved
Priority:
Urgent
Assignee:
Category:
-
Target version:
-
% Done:

0%

Source:
Q/A
Tags:
Backport:
Regression:
Severity:
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Branch: wip-auth
ceph version 0.49-306-gfc3681f (commit:fc3681f59c4f49298f5a7a5172c30be63068c330)

tamil@tamil-VirtualBox:/etc/ceph$ sudo mkcephfs -a -c /etc/ceph/ceph.conf -k ceph.keyring
temp dir is /tmp/mkcephfs.uHQwrXCJ71
preparing monmap in /tmp/mkcephfs.uHQwrXCJ71/monmap
/usr/bin/monmaptool --create --clobber --add a 127.0.1.1:6789 --print /tmp/mkcephfs.uHQwrXCJ71/monmap
/usr/bin/monmaptool: monmap file /tmp/mkcephfs.uHQwrXCJ71/monmap
/usr/bin/monmaptool: generated fsid 69686aec-24d7-4c24-b8a6-4f1c60e844d5
epoch 0
fsid 69686aec-24d7-4c24-b8a6-4f1c60e844d5
last_changed 2012-08-08 15:10:11.758122
created 2012-08-08 15:10:11.758122
0: 127.0.1.1:6789/0 mon.a
/usr/bin/monmaptool: writing epoch 0 to /tmp/mkcephfs.uHQwrXCJ71/monmap (1 monitors) === osd.0 ===
2012-08-08 15:10:12.453950 7f066a21c780 1 filestore(/var/lib/ceph/osd/ceph-0) limited size xattrs - filestore_xattr_use_omap enabled
2012-08-08 15:10:12.661366 7f066a21c780 -1 filestore(/var/lib/ceph/osd/ceph-0) could not find 23c2fcde/osd_superblock/0//-1 in index: (2) No such file or directory
2012-08-08 15:10:12.805522 7f066a21c780 -1 created object store /var/lib/ceph/osd/ceph-0 journal /var/lib/ceph/osd/ceph-0/journal for osd.0 fsid 69686aec-24d7-4c24-b8a6-4f1c60e844d5
creating private key for osd.0 keyring /tmp/mkcephfs.uHQwrXCJ71/keyring.osd.0
creating /tmp/mkcephfs.uHQwrXCJ71/keyring.osd.0 === osd.1 ===
2012-08-08 15:10:13.641815 7f03e393a780 1 filestore(/var/lib/ceph/osd/ceph-1) limited size xattrs - filestore_xattr_use_omap enabled
2012-08-08 15:10:13.763565 7f03e393a780 -1 filestore(/var/lib/ceph/osd/ceph-1) could not find 23c2fcde/osd_superblock/0//-1 in index: (2) No such file or directory
2012-08-08 15:10:13.951484 7f03e393a780 -1 created object store /var/lib/ceph/osd/ceph-1 journal /var/lib/ceph/osd/ceph-1/journal for osd.1 fsid 69686aec-24d7-4c24-b8a6-4f1c60e844d5
creating private key for osd.1 keyring /tmp/mkcephfs.uHQwrXCJ71/keyring.osd.1
creating /tmp/mkcephfs.uHQwrXCJ71/keyring.osd.1 === mds.a ===
creating private key for mds.a keyring /tmp/mkcephfs.uHQwrXCJ71/keyring.mds.a
creating /tmp/mkcephfs.uHQwrXCJ71/keyring.mds.a
Building generic osdmap from /tmp/mkcephfs.uHQwrXCJ71/conf
/usr/bin/osdmaptool: osdmap file '/tmp/mkcephfs.uHQwrXCJ71/osdmap'
/usr/bin/osdmaptool: writing epoch 1 to /tmp/mkcephfs.uHQwrXCJ71/osdmap
Generating admin key at /tmp/mkcephfs.uHQwrXCJ71/keyring.admin
creating /tmp/mkcephfs.uHQwrXCJ71/keyring.admin
Building initial monitor keyring
added entity mds.a auth auth(auid = 18446744073709551615 key=AQDG4yJQyLtbLxAAsIejlZwlgV65mUE5zbKnjw== with 0 caps)
added entity osd.0 auth auth(auid = 18446744073709551615 key=AQDE4yJQKE0UOhAAY4FGp9FYSelLTlH6E/2MmQ== with 0 caps)
added entity osd.1 auth auth(auid = 18446744073709551615 key=AQDG4yJQgMgkCxAAQyyhf3jrhZBjas8aUoWTjw== with 0 caps) === mon.a ===
/sbin/mkcephfs: 270: read: arg count
ERROR: mon.a mon_data directory /var/run/ceph/mon/ceph-a is not empty.
Please make sure that it is empty before running mkcephfs.
failed: '/sbin/mkcephfs -d /tmp/mkcephfs.uHQwrXCJ71 --init-daemon mon.a'

It gives the same error in "master branch" as well
ceph version 0.49-334-g6bc1067 (6bc1067fc878cbfb6761146cb154c2985c9d9bd7)

Actions #1

Updated by Mark Kirkwood over 11 years ago

FWIW - this seems to happen even if the mon directory does not exist - there should probably be a check of the form:

[ -d "$mon_data" ]

in there first.

Actions #2

Updated by Sage Weil over 11 years ago

  • Status changed from New to Resolved
Actions #3

Updated by Mark Kirkwood over 11 years ago

Hmm - I don't think so:

The amended code works ok if the directory does not exist, but fails if it exists and is empty!
Further amending the code as below seemed to work correctly. I'll see if I can find a cleaner looking way to do this:

269c269
< if test d $mon_data && ! find "$mon_data" -maxdepth 0 -empty | read; then
--

if test -d $mon_data && ! [ "$(ls -A $mon_data)" ]; then

Actions #4

Updated by Mark Kirkwood over 11 years ago

This might be cleaner (I'll avoid a diff as they seem to get mangled):

Replacing:

if test -d $mon_data && ! find "$mon_data" -maxdepth 0 -empty | read; then

with

if test -d $mon_data && [ -e $mon_data/* ]; then

Seemed to work as expected (I'm not clear why the find construct seems to fail as it looks like it should do this trick)...

Actions #5

Updated by Mark Kirkwood over 11 years ago

Sorry that last one does not work properly either.

Actions #6

Updated by Sage Weil over 11 years ago

  • Status changed from Resolved to In Progress

building right now to test this out... i could have sworn i tested the directory exists situation, but i guess not!

a simple 'mkdir -p $mon_data' on the previous line might be the way to go.

Actions #7

Updated by Josh Durgin over 11 years ago

just fyi you can enclose things in pre tags to make redmine skip its own formatting:

<pre>
</pre>

Actions #8

Updated by Sage Weil over 11 years ago

  • Status changed from In Progress to Resolved

ah, it's just a stupid bash vs dash thing with the 'read' command. i tested on debian (bash), breaks on ubuntu. pushing a fix.

Actions #9

Updated by Mark Kirkwood over 11 years ago

Hmm, my testing of the modifications has a little buggy itself sorry. But after more careful analysis I can confirm the current commit gives a (incorrect) error when the mon_data exists but is empty. Either of the following diffs seem to work correctly:

269c269
< if test d $mon_data && ! find "$mon_data" -maxdepth 0 -empty | read; then
--

if test -d $mon_data && [ "$(ls -A $mon_data)" ]; then

269c269
< if test d $mon_data && ! find "$mon_data" -maxdepth 0 -empty | read; then
--

if test -d $mon_data && [ -e $mon_data/* ]; then

Actions

Also available in: Atom PDF