Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Genome::Sys::Lock::backends error #162

Open
malachig opened this issue Feb 23, 2015 · 19 comments
Open

Genome::Sys::Lock::backends error #162

malachig opened this issue Feb 23, 2015 · 19 comments

Comments

@malachig
Copy link
Collaborator

Running the installer since the merge I now get this error on initial priming of the genome database:

WARNING: Re-creating /opt/gms/8L4FU54/sw/genome/lib/perl/Genome/DataSource/Meta.sqlite3 from /opt/gms/8L4FU54/sw/genome/lib/perl/Genome/DataSource/Meta.sqlite3-dump.
No backends registered for scope 'site' at /opt/gms/8L4FU54/sw/genome/lib/perl/Genome/Sys/Lock.pm line 201
    Genome::Sys::Lock::backends('site') called at /opt/gms/8L4FU54/sw/genome/lib/perl/Genome/Sys/Lock.pm line 171
    Genome::Sys::Lock::release_all() called at /opt/gms/8L4FU54/sw/genome/lib/perl/Genome/Sys/Lock.pm line 263
    Genome::Sys::Lock::END() called at setup/prime-disk-allocations.pl line 0
    eval {...} called at setup/prime-disk-allocations.pl line 0
END failed--call queue aborted.
make: *** [done-host/db-schema] Error 22
make[1]: *** [setup] Error 2
rm done-repo/download-java-2013-08-27.tgz done-repo/download-apt-mirror-min-ubuntu-12.04-2014.04.02.tgz
make[1]: Leaving directory `/vagrant'
make: *** [all] Error 2

This type of error is not immediately reminiscent of error we observed in past merge attempts. Though issues relating to changes in the db schema were common.

@malachig
Copy link
Collaborator Author

It looks like locking (with respect to 'scope') was recently reworked (Jan/2015) by Mark Burnett. It possible that there is some expectation/environment related to this that is not being met in the standalone environment now.

@sakoht
Copy link
Contributor

sakoht commented Feb 23, 2015

@mkiwala you mentioned the nessy vs. old split. Is there a way to configure this to work with the old locking, since nessy isn't ready yet?

@mkiwala
Copy link

mkiwala commented Feb 23, 2015

In lib/perl/Genome/Site/TGI/Extension/Sys/Lock.pm locking backends are registered for different locking scopes. This error messages sounds like the site scope is being used (perhaps by default), yet no locking backend has been added for that scope.

The concept of scopes was introduced recently after it was discovered that some code was requesting a lock on a local filesystem path called /tgisan. Contrary to what the name of this path seems to communicate, /tgisan is not a network-mounted path, it is local to some machines (I forget where).

There is also the concept of locking backends Genome::Sys::Lock::FileBackend and Genome::Sys::Lock::NessyBackend. In sGMS, we should avoid using the NessyBackend for now, and stick to the FileBackend. In sGMS we should make sure that the at least the FileBackend is added to the site scope. It looks to me like the first 16 lines of lib/perl/Genome/Site/TGI/Extension/Sys/Lock.pm would take care of that for us.

Michael

On Feb 22, 2015, at 8:34 PM, Scott [email protected] wrote:

@mkiwala https://github.com/mkiwala you mentioned the nessy vs. old split. Is there a way to configure this to work with the old locking, since nessy isn't ready yet?


Reply to this email directly or view it on GitHub #162 (comment).


This email message is a private communication. The information transmitted, including attachments, is intended only for the person or entity to which it is addressed and may contain confidential, privileged, and/or proprietary material. Any review, duplication, retransmission, distribution, or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is unauthorized by the sender and is prohibited. If you have received this message in error, please contact the sender immediately by return email and delete the original message from all computer systems. Thank you.

@malachig
Copy link
Collaborator Author

One possible fix.

Create a new site module and place necessary setup in there. For example to configure the 'backends' it could contain the following.

Genome/Site/SGMS.pm

package Genome::Site::SGMS;
use strict;
use warnings;

BEGIN {
    unless ($INC{'Genome/Sys/Lock.pm'}) {
        die 'must load Genome::Sys::Lock first';
    }
};

require Genome::Sys::Lock::FileBackend;
Genome::Sys::Lock->add_backend('site',
    Genome::Sys::Lock::FileBackend->new(is_mandatory => 1,
        parent_dir => $ENV{GENOME_LOCK_DIR}));

Genome::Sys::Lock->add_backend('unknown',
    Genome::Sys::Lock::FileBackend->new(is_mandatory => 1,
        parent_dir => '/'));

1;

Then update:
Genome/Site/edu/wustl/gsc.pm

Change:

#use Genome::Site::TGI;

To:

use Genome::Site::SGMS;

@malachig
Copy link
Collaborator Author

One thing that confuses me still. How does Genome/Site/edu/wustl/gsc.pm get loaded?

Within Genome/Site.pm, the hostname is parsed and based on that Genome/Site/edu/wustl/gsc.pm gets loaded on all machines inside TGI, and within gsc.pm we load Genome/Site/TGI.pm.

However, in the standalone GMS we won't know what the domain is going to be... So how do we ensure that this stuff gets loaded...

On possibility is that instead of updating Genome/Site/edu/wustl/gsc.pm we would add logic in Genome/Site.pm that does use Genome::Site::SGMS;. But this need to happen only in the sGMS. So we could do something like this maybe?:

    if ($ENV{GENOME_SYS_ID} && $ENV{GENOME_SYS_ID} ne 'GMS1') {
        use Genome::Site::SGMS;
    }

OR... maybe we can take advantage of the GENOME_CONFIG environment variable. In Genome/Site.pm we have:

sub import {
    if (my $config = $ENV{GENOME_CONFIG}) {
        require_module($config);
    }
    else {
        load_host_config();
    }
}

Depending on how require_module works maybe we could set GENOME_CONFIG=Genome::Site::SGMS.pm

@mkiwala
Copy link

mkiwala commented Feb 24, 2015

I agree that the change to Genome::Site::edu::wustl::gsc to add the use Genome::Site::StandaloneGMS is not going to be effective outside of TGI’s network. We’ll need to find another place to load Genome::Site::StandaloneGMS.

I’m not sure what would make the most sense. I think it would work to just add the use Genome::Site::StandaloneGMS statement to Genome/Site.pm, bypassing the hostname parsing, but also introducing a new difference between the sGMS branch and master.

Perhaps a better approach would be to introduce a new optional environment variable in master which overrides the hostname parsing. The purpose of the environment variable would be to set the site name. The variable could be called GENOME_INSTALL_SITE with a value of ‘StandaloneGMS’. The presence of the variable with this value could cause Genome/Site.pm to load the StandaloneGMS site code.

On Feb 23, 2015, at 6:12 PM, Malachi Griffith [email protected] wrote:

One thing that confuses me still. How does Genome/Site/edu/wustl/gsc.pm get loaded?

Within Genome/Site.pm, the hostname is parsed and based on that Genome/Site/edu/wustl/gsc.pm gets loaded on all machines inside TGI, and within gsc.pm we load Genome/Site/TGI.pm.

However, in the standalone GMS we won't know what the domain is going to be... So how do we ensure that this stuff gets loaded...


Reply to this email directly or view it on GitHub #162 (comment).


This email message is a private communication. The information transmitted, including attachments, is intended only for the person or entity to which it is addressed and may contain confidential, privileged, and/or proprietary material. Any review, duplication, retransmission, distribution, or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is unauthorized by the sender and is prohibited. If you have received this message in error, please contact the sender immediately by return email and delete the original message from all computer systems. Thank you.

@gatoravi
Copy link
Contributor

is $GENOME_CONFIG supposed to do something similar to what @mkiwala describes ?

@malachig
Copy link
Collaborator Author

I agree, it seems that perhaps GENOME_CONFIG is already there to meet this goal? It has been there for a while, initially added by ddooling and modified by @nnutter. Perhaps Nathan can comment on its intended function.

This search:

cd ~/git/genome/lib/perl/Genome
grep -R GENOME_CONFIG *

Yields this result:

Env/GENOME_CONFIG.pm:package Genome::Env::GENOME_CONFIG;
Site.pm:    if (my $config = $ENV{GENOME_CONFIG}) {

Perhaps it was added with this idea in mind a while back, but never wound up being used. If that's the case I say we try it out now.

@gatoravi
Copy link
Contributor

Genome::Sys::Lock.pm has some scopes hardcoded,
https://github.com/genome/genome/blob/master/lib/perl/Genome/Sys/Lock.pm#L210-212
Looks like backends (not sure what these are.) need to be created for each of these scopes in order to be able to run any Genome commands.
These scopes might be specific to TGI and might not be relevant to the SGMS as of now. To go ahead with the GMS 2 alternatives can be implemented.

  1. add an SGMS.pm as described above with three backends.
  2. configure the @scopes array variable better in Lock.pm. Suggestions so far are this could be configured via an environment variable which might make it more flexible but its yet another environment variable. Another option is to set this array to empty in the SGMS branch but that might cause further divergence from master.

@sakoht
Copy link
Contributor

sakoht commented Feb 25, 2015

So Genome/Site.pm was supposed to have generic/external defaults, and Genome/Site/TGI.pm was supposed to override them.

The question was then how does the system automatically figure out that it is a TGI system?

Because parsing the hostname leads to edu/wustl/gsc.pm, this is the TGI-specific entry point.

So, can we register the default handlers in Genome/Site.pm, and let Site/TGI.pm override those with Nessy? Or is it problematic to even ever set-up the default handlers?

@sakoht
Copy link
Contributor

sakoht commented Feb 25, 2015

Because parsing the hostname leads to edu/wustl/gsc.pm, this is the TGI-specific entry point.

At one point there was another subnet that was also active at TGI and it, like edu/wustl/gsc.pm also used Site/TGI.pm.

@gatoravi
Copy link
Contributor

gatoravi commented Mar 2, 2015

A couple of pull requests addressing this was made to genome/gms and genome/genome. We basically set $GENOME_CONFIG=Genome::Site::SGMS and configure two backends in Site/SGMS.pm

@gatoravi gatoravi changed the title Error during installation at make target 'done-host/db-schema' Genome::Sys::Lock::backends error Mar 3, 2015
@gatoravi
Copy link
Contributor

gatoravi commented Mar 4, 2015

this still needs to be merged into master. merged into the SGMS branch so that we can test this.

@gatoravi
Copy link
Contributor

this was addressed in master here and the same changes are in the SGMS branches, genome/genome@97226f1 and
genome/genome@e859d97

@gatoravi
Copy link
Contributor

closing since it looks like the backends stuff was resolved.

@GrubLord
Copy link

Doing a fresh install of gms... we seem to have encountered this issue anew. Here's a log:

sudo bash -l -c 'source /etc/genome.conf; /usr/bin/perl setup/prime-disk-allocations.pl'
setting GENOME_* variables...
updating PATH, PERL5LIB, and CLASSPATH for the GMS
configuring tab-completion...
Can't locate Mouse.pm in @inc (@inc contains: /opt/gms/II26B153/sw/ur/lib /opt/gms/II26B153/sw/workflow/lib /opt/gms/II26B153/sw/genome/lib/perl/x86_64-linux-gnu-thread-multi /opt/gms/II26B153/sw/genome/lib/perl /opt/gms/II26B153/sw/genome/lib/perl-added /usr/lib/perl5/x86_64-linux-gnu-thread-multi /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14.2 /usr/share/perl/5.14.2 /usr/local/lib/site_perl /home/ubuntu/gms) at /opt/gms/II26B153/sw/genome/lib/perl/Genome/Sys/Lock/FileBackend.pm line 17.
BEGIN failed--compilation aborted at /opt/gms/II26B153/sw/genome/lib/perl/Genome/Sys/Lock/FileBackend.pm line 17.
Compilation failed in require at /opt/gms/II26B153/sw/genome/lib/perl/Genome/Site/SGMS.pm line 12.
Compilation failed in require at /usr/share/perl/5.14.2/Module/Runtime.pm line 317.
BEGIN failed--compilation aborted at /opt/gms/II26B153/sw/genome/lib/perl/Genome/Site.pm line 49.
Compilation failed in require at /opt/gms/II26B153/sw/genome/lib/perl/Genome.pm line 24.
Compilation failed in require at setup/prime-disk-allocations.pl line 4.
BEGIN failed--compilation aborted at setup/prime-disk-allocations.pl line 4.
No backends registered for scope 'site' at /opt/gms/II26B153/sw/genome/lib/perl/Genome/Sys/Lock.pm line 201
Genome::Sys::Lock::backends('site') called at /opt/gms/II26B153/sw/genome/lib/perl/Genome/Sys/Lock.pm line 171
Genome::Sys::Lock::release_all() called at /opt/gms/II26B153/sw/genome/lib/perl/Genome/Sys/Lock.pm line 263
Genome::Sys::Lock::END() called at setup/prime-disk-allocations.pl line 4
eval {...} called at setup/prime-disk-allocations.pl line 4
END failed--call queue aborted at setup/prime-disk-allocations.pl line 4.

@gatoravi
Copy link
Contributor

This is really strange since as you have mentioned there hasn't been an update to the gms-pub branch. We definitely expect issues with using the master branch for this project and hence would not recommend that, there is code unique to both of these branches.

The Can't locate Mouse.pm in @INC line looks strange to me as well, have you seen this one before?

Two questions,

  1. Was this one a completely fresh install? Are you able to replicate this if you install again?
  2. Does echo $GENOME_CONFIG show Genome::Site::SGMS? Does the output of env look ok to you?

If this is still an issue we'd be glad to take a look at this and the other issue, could you email me on the email address on my profile!

Thanks,
Avi

@gatoravi
Copy link
Contributor

cc'ing @GrubLord just in case this old issue gets drowned amidst notifications.

@GrubLord
Copy link

Thanks kindly, Avi... this issue is rather odd to be sure. Generally speaking we've found GMS to behave rather unexpectedly when it comes to handling storage... and this was an outgrowth of that - perhaps caused my trying to do a fresh GMS setup over the drives of our old instance.

While I have done as fresh an install as possible, with new drives, and managed to circumvent this - it's the other issues we have reported recently that have been real show-stoppers - particularly the fact that without us making direct changes to the "Creator.pm" code to invoke Volume.pm's "sync_total_kb()" method, our disk is considered to run out of space long before the drive actually fills up...

It was this issue that caused us to have to rebuild our GMS setup altogether, along with issues around re-priming, and an unfortunate problem where GMS started writing its temporary files to "/home/ubuntu" rather than /tmp (due to an accessibility problem caused by replacing /tmp with a symlink, which we then reverted). Despite re-creating the original setup as best we could, and various attempts using environment variables and poking around in the code, we were unable to get GMS to write to /tmp any more, and every job would fail due to lack of space in /home/ubuntu.

While I think we can consider this issue closed, I would very much appreciate your assistance with these other two - particularly as your colleague appears to have misunderstood our setup (we've been using an 80 Gb root drive, and two additional drives of 4 TB and 7 TB each, mounted at /tmp and /opt respectively, which we understand to be your recommended setup).

Also, the replacement of /tmp with a symlink was done because we would keep getting disk space errors, and believed that perhaps consolidating to a single larger /opt disk and symlinking /tmp onto this drive would ensure that we never run out of temporary space due to a mismatch in size between the two volumes. While this was perhaps ill-advised, due to how GMS handles storage, it did bring to light the rather show-stopping issues that occur when /tmp becomes unavailable.

Would very much appreciate your assistance with the /tmp and Volume.pm issues any time you can manage.

-- Liviu

On 16 Jan 2016, at 3:29 am, Avi Ramu <[email protected]mailto:[email protected]> wrote:

This is really strange since as you have mentioned there hasn't been an update to the gms-pub branch. We definitely expect issues with using the master branch for this project and hence would not recommend that, there is code unique to both of these branches.

Two questions,

  1. Was this one a completely fresh install? Are you able to replicate this if you install again?
  2. Does echo $GENOME_CONFIG show Genome::Site::SGMS?

If this is still an issue we'd be glad to take a look at this and the other issue, could you email me on the email address on my profile!

Thanks,
Avi


Reply to this email directly or view it on GitHubhttps://github.com//issues/162#issuecomment-172007448.

NOTICE
Please consider the environment before printing this email. This message and any attachments are intended for the addressee named and may contain legally privileged/confidential/copyright information. If you are not the intended recipient, you should not read, use, disclose, copy or distribute this communication. If you have received this message in error please notify us at once by return email and then delete both messages. We accept no liability for the distribution of viruses or similar in electronic communications. This notice should not be removed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants