SOLVED: Greyhole daemon won't start?

kogimus
Posts: 8
Joined: Thu Apr 17, 2014 10:07 pm

SOLVED: Greyhole daemon won't start?

Postby kogimus » Thu Apr 17, 2014 10:23 pm

So, i'm using ubuntu/amahi 6.3 because the main reason i came to amahi from WHSv1 was for storage pooling, now, all of a sudden the greyhole daemon will not start, and i haven't been able to figure out why, or, more importantly, how to go about fixing it.

How do i go about fixing the greyhole daemon NOT STARTING problem?

Link to the requested data for assistance follows
http://sprunge.us/HIHO

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: Greyhole daemon won't start?

Postby bigfoot65 » Fri Apr 18, 2014 5:13 am

Not sure what has caused your difficulty. Have you tried doing OS updates?

Code: Select all

sudo apt-get update
Another option is to update Greyhole to the latest version. There have been many bugs fixed:
https://wiki.amahi.org/index.php/Greyhole_updating
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

kogimus
Posts: 8
Joined: Thu Apr 17, 2014 10:07 pm

Re: Greyhole daemon won't start?

Postby kogimus » Fri Apr 18, 2014 7:52 am

Yup, i've run the apt-get update (nothing spectacular except an error from the greyhole repository, something about a malformed sources.list?)
and i've manually updated greyhole to the current release 0.9.49-1, to no avail... if i try to use greyhole -D from the command line to start it, it says

Found an already running Greyhole daemon with PID .
Can't start multiple Greyhole daemons.
Quitting.
but if i try to restart the service (using service greyhole restart) i get the following output :
stop: Unknown instance:
greyhole start/running, process (whatever process ID it decides it's going to be)
which is all well and good, except that if i issue a greyhole --status, i still get
Greyhole daemon is currently stopped.
likewise, when i run that really awesome and helpful gethelp.sh i get
restart: Unknown instance:
Here's the URL you will need to give the to person who's helping you:
before it spits out the helpful URL to give the person(s) helping me, in this case it's now
http://sprunge.us/YXCM
post apt-get updates / manual greyhole updates.

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: Greyhole daemon won't start?

Postby bigfoot65 » Fri Apr 18, 2014 8:02 am

if i try to use greyhole -D from the command line to start it, it says
Best if you use the service vs doing it this way. Can you try the following:

Code: Select all

service greyhole stop service greyhole start
I cannot access the URL you posted from work, but that's not a problem. Also have you checked the /var/log/greyhole.log since updating Greyhole? Would be interested if it offers any help.

Have you rebooted since doing all this? Not that it may matter, but I have seen some problems solved in this manner. Will have to think more about this one to see what else to recommend.
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

kogimus
Posts: 8
Joined: Thu Apr 17, 2014 10:07 pm

Re: Greyhole daemon won't start?

Postby kogimus » Fri Apr 18, 2014 8:32 am

yup i've tried rebooting, it didn't do anything

service greyhole stop returns
stop: unknown instance:
and service greyhole start returns
greyhole start/running, process (process id#)
the last entry in my greyhole.log is
Apr 18 14:14:55 INFO daemon: Greyhole (version %VERSION%) daemon started.
Apr 18 14:14:55 INFO daemon: Optimizing MySQL tables...
Apr 18 14:14:55 INFO daemon: Moving /var/hda/files/drives/drive1/gh/.gh_graveyard_backup to /var/hda/files/drives/drive1/gh/.gh_metastore_backup...
Apr 18 14:14:55 INFO daemon: Moving /var/hda/files/drives/drive2/gh/.gh_graveyard_backup to /var/hda/files/drives/drive2/gh/.gh_metastore_backup...
Apr 18 14:14:55 ERROR daemon: PHP Fatal Error: Uncaught exception 'Exception' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'metastore_backup_directory' for key 'PRIMARY'' in /usr/bin/greyhole:491
then it spits a lot of these out at the end :
Apr 18 15:07:37 INFO daemon: Greyhole (version %VERSION%) daemon started.
Apr 18 15:07:37 INFO daemon: Optimizing MySQL tables...
Apr 18 15:07:37 INFO daemon: Moving /var/hda/files/drives/drive2/gh/.gh_graveyard_backup to /var/hda/files/drives/drive2/gh/.gh_metastore_backup...
Apr 18 15:07:37 INFO daemon: Moving /var/hda/files/drives/drive1/gh/.gh_graveyard_backup to /var/hda/files/drives/drive1/gh/.gh_metastore_backup...
Apr 18 15:07:37 ERROR daemon: PHP Fatal Error: Uncaught exception 'Exception' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'metastore_backup_directory' for key 'PRIMARY'' in /usr/bin/greyhole:491
Stack trace:
#0 /usr/bin/greyhole(865): DB::execute('UPDATE settings...', Array)
#1 /usr/bin/greyhole(919): Settings::rename('graveyard_backu...', 'metastore_backu...')
#2 /usr/bin/greyhole(905): MigrationHelper::convertDatabase()
#3 /usr/bin/greyhole(3427): MigrationHelper::terminologyConversion()
#4 /usr/bin/greyhole(3412): DaemonRunner->initialize()
#5 /usr/bin/greyhole(3441): DaemonRunner->run()
#6 {main}
thrown; BT: greyhole[L491]

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: Greyhole daemon won't start?

Postby bigfoot65 » Fri Apr 18, 2014 8:49 am

Seems there is a problem with inserting a dupliate row in the database. Not sure how it got this way, but you could try some of the guidance on this page:
https://wiki.amahi.org/index.php/Greyho ... leshooting
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

kogimus
Posts: 8
Joined: Thu Apr 17, 2014 10:07 pm

Re: Greyhole daemon won't start?

Postby kogimus » Fri Apr 18, 2014 9:44 am

I'm looking at that guidance, and I'm not really seeing anything that looks relevant...

Do you suppose that perhaps reinstalling amahi over itself would rebuild the databases correctly? of course, if I do that, i'm betting i'd have to let greyhole run the fix orphaned links thing, wouldn't I?

...or would attempting to reinstall amahi over itself (using the same install code, in this case) just completely and utterly break everything?

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: Greyhole daemon won't start?

Postby bigfoot65 » Fri Apr 18, 2014 10:30 am

Reinstall is not the answer.

How about looking for the offending entry in the greyhole table in the hda_production database and remove it? Once that is done, things may work correctly. Much simpler and more practical step than reinstall, which could break it all.

You can use a web app such as Adminer or phpMyAdmin to do this. You can also consider purging the Greyhole tables and once it restarts, it will repopulate the database.
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

kogimus
Posts: 8
Joined: Thu Apr 17, 2014 10:07 pm

Re: Greyhole daemon won't start?

Postby kogimus » Fri Apr 18, 2014 11:47 am

First off : cannot thank you enough for the help.

So, upon looking into the hda_production db, there IS no greyhole db in there...
HOWEVER there IS a greyhole DB.

upon investigation of the greyhole db, if find what appears to be the offending entry (the one throwing the error),
but....
a:2:{i:0;s:52:"/var/hda/files/drives/drive2/gh/.gh_metastore_backup";i:1;s:52:"/var/hda/files/drives/drive1/gh/.gh_metastore_backup";}
is the only entry i can find anywhere in the DB that appears to match up with the offending entry's name, which as far as i can tell is
metastore_backup_directory
if i'm reading the error message
Integrity constraint violation: 1062 Duplicate entry 'metastore_backup_directory' for key 'PRIMARY'
correctly, right?

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: Greyhole daemon won't start?

Postby bigfoot65 » Fri Apr 18, 2014 11:55 am

That is the way I would perceive it. If you remove that entry and restart Greyhole, you should see progress. It may throw another error, so you could end up having to remove more data from the greyhole database.
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

Who is online

Users browsing this forum: No registered users and 40 guests