connect gbrowse to drupal db

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

connect gbrowse to drupal db

Sofia Robb
Hello,

I am trying to connect gbrowse to my drupal chado database but I am unsuccessful. What am I missing? 

I created the user nobody with the following commands:

CREATE USER nobody;
ALTER USER nobody WITH PASSWORD 'nobody';
GRANT CONNECT ON DATABASE drupal TO nobody;
GRANT USAGE ON SCHEMA chado TO nobody;
ALTER ROLE nobody SET search_path TO chado;


and have this in my config:

[main:database]
db_adaptor    = Bio::DB::Das::Chado
db_args       = -dsn dbi:Pg:dbname=drupal
                -user nobody
                -pass nobody
                -srcfeatureslice 1
                -inferCDS 1
                -organism "Schmidtea mediterranea"

and I am getting this error:

------------- EXCEPTION: Bio::Root::Exception ------------- MSG: trying to find SOFA STACK: Error::throw STACK: Bio::Root::Root::throw /usr/share/perl5/Bio/Root/Root.pm:486 STACK: Bio::DB::Das::Chado::sofa_id /usr/local/share/perl/5.18.2/Bio/DB/Das/Chado.pm:886 STACK: Bio::DB::Das::Chado::new /usr/local/share/perl/5.18.2/Bio/DB/Das/Chado.pm:252 STACK: Bio::Graphics::Browser2::DataBase::open_database /usr/share/perl5/Bio/Graphics/Browser2/DataBase.pm:44 STACK: Bio::Graphics::Browser2::DataSource::open_database /usr/share/perl5/Bio/Graphics/Browser2/DataSource.pm:1005 STACK: Bio::Graphics::Browser2::Render::region /usr/share/perl5/Bio/Graphics/Browser2/Render.pm:1116 STACK: Bio::Graphics::Browser2::Render::segment /usr/share/perl5/Bio/Graphics/Browser2/Render.pm:1197 STACK: Bio::Graphics::Browser2::Render::_update_state /usr/share/perl5/Bio/Graphics/Browser2/Render.pm:1932 STACK: Bio::Graphics::Browser2::Render::update_state /usr/share/perl5/Bio/Graphics/Browser2/Render.pm:1922 STACK: Bio::Graphics::Browser2::Render::run /usr/share/perl5/Bio/Graphics/Browser2/Render.pm:296 STACK: /usr/lib/cgi-bin/gbrowse/gbrowse:50 -----------------------------------------------------------


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
Reply | Threaded
Open this post in threaded view
|

Re: connect gbrowse to drupal db

Scott Cain
Hi Sofia,

It looks to me like it can't find or access the the chado schema; getting SO/SOFA is the first thing the adaptor does when talking to the database, so with that failing, I'm thinking it can't do anything.

Have you tried using the psql shell as that use to see if it can do selects?  I think you have to explicitly give select ("GRANT SELECT ...") for the user, as USAGE is only for procedural languages (I'm honestly not positive about that, I just read about USAGE :-)

Scott


On Wed, Oct 1, 2014 at 3:41 PM, Sofia Robb <[hidden email]> wrote:
Hello,

I am trying to connect gbrowse to my drupal chado database but I am unsuccessful. What am I missing? 

I created the user nobody with the following commands:

CREATE USER nobody;
ALTER USER nobody WITH PASSWORD 'nobody';
GRANT CONNECT ON DATABASE drupal TO nobody;
GRANT USAGE ON SCHEMA chado TO nobody;
ALTER ROLE nobody SET search_path TO chado;


and have this in my config:

[main:database]
db_adaptor    = Bio::DB::Das::Chado
db_args       = -dsn dbi:Pg:dbname=drupal
                -user nobody
                -pass nobody
                -srcfeatureslice 1
                -inferCDS 1
                -organism "Schmidtea mediterranea"

and I am getting this error:

------------- EXCEPTION: Bio::Root::Exception ------------- MSG: trying to find SOFA STACK: Error::throw STACK: Bio::Root::Root::throw /usr/share/perl5/Bio/Root/Root.pm:486 STACK: Bio::DB::Das::Chado::sofa_id /usr/local/share/perl/5.18.2/Bio/DB/Das/Chado.pm:886 STACK: Bio::DB::Das::Chado::new /usr/local/share/perl/5.18.2/Bio/DB/Das/Chado.pm:252 STACK: Bio::Graphics::Browser2::DataBase::open_database /usr/share/perl5/Bio/Graphics/Browser2/DataBase.pm:44 STACK: Bio::Graphics::Browser2::DataSource::open_database /usr/share/perl5/Bio/Graphics/Browser2/DataSource.pm:1005 STACK: Bio::Graphics::Browser2::Render::region /usr/share/perl5/Bio/Graphics/Browser2/Render.pm:1116 STACK: Bio::Graphics::Browser2::Render::segment /usr/share/perl5/Bio/Graphics/Browser2/Render.pm:1197 STACK: Bio::Graphics::Browser2::Render::_update_state /usr/share/perl5/Bio/Graphics/Browser2/Render.pm:1932 STACK: Bio::Graphics::Browser2::Render::update_state /usr/share/perl5/Bio/Graphics/Browser2/Render.pm:1922 STACK: Bio::Graphics::Browser2::Render::run /usr/share/perl5/Bio/Graphics/Browser2/Render.pm:296 STACK: /usr/lib/cgi-bin/gbrowse/gbrowse:50 -----------------------------------------------------------


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse




--
------------------------------------------------------------------------
Scott Cain, Ph. D.                                   scott at scottcain dot net
GMOD Coordinator (http://gmod.org/)                     216-392-3087
Ontario Institute for Cancer Research

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
Reply | Threaded
Open this post in threaded view
|

Re: connect gbrowse to drupal db

Cook, Malcolm
In reply to this post by Sofia Robb

Hi Sofia,

 

Your message comes from perl function sofa_id , relevant part snipped from: https://metacpan.org/source/SCAIN/Bio-DB-Das-Chado-0.34/lib/Bio/DB/Das/Chado.pm

 

 my $query = "select cv_id from cv where name in (

                     'SOFA',

                     'Sequence Ontology Feature Annotation',

                     'sofa.ontology')";

 

  my $sth = $self->dbh->prepare($query);

  $sth->execute() or $self->throw("trying to find SOFA");

 

A cursory glance at the module suggests that dbh is valid and a connection to the database has already successfully been made.

 

Not sure why you’re getting it, but, I would start debugging by patching the perl sofa_id function  to see if the prepare() succeeded, or not, as demonstrated   http://search.cpan.org/~timb/DBI-1.631/DBI.pm#prepare

 

My guess is it fails too, but if you throw the error message it might be more informative.

 

~Malcolm

 

 

From: Sofia Robb [mailto:[hidden email]]
Sent: Wednesday, October 01, 2014 2:42 PM
To: Gbrowse (E-mail)
Subject: [Gmod-gbrowse] connect gbrowse to drupal db

 

Hello,

 

I am trying to connect gbrowse to my drupal chado database but I am unsuccessful. What am I missing? 

 

I created the user nobody with the following commands:

 

CREATE USER nobody;

ALTER USER nobody WITH PASSWORD 'nobody';

GRANT CONNECT ON DATABASE drupal TO nobody;

GRANT USAGE ON SCHEMA chado TO nobody;

ALTER ROLE nobody SET search_path TO chado;

 

 

and have this in my config:

 

[main:database]

db_adaptor    = Bio::DB::Das::Chado

db_args       = -dsn dbi:Pg:dbname=drupal

                -user nobody

                -pass nobody

                -srcfeatureslice 1

                -inferCDS 1

                -organism "Schmidtea mediterranea"

 

and I am getting this error:

 

------------- EXCEPTION: Bio::Root::Exception ------------- MSG: trying to find SOFA STACK: Error::throw STACK: Bio::Root::Root::throw /usr/share/perl5/Bio/Root/Root.pm:486 STACK: Bio::DB::Das::Chado::sofa_id /usr/local/share/perl/5.18.2/Bio/DB/Das/Chado.pm:886 STACK: Bio::DB::Das::Chado::new /usr/local/share/perl/5.18.2/Bio/DB/Das/Chado.pm:252 STACK: Bio::Graphics::Browser2::DataBase::open_database /usr/share/perl5/Bio/Graphics/Browser2/DataBase.pm:44 STACK: Bio::Graphics::Browser2::DataSource::open_database /usr/share/perl5/Bio/Graphics/Browser2/DataSource.pm:1005 STACK: Bio::Graphics::Browser2::Render::region /usr/share/perl5/Bio/Graphics/Browser2/Render.pm:1116 STACK: Bio::Graphics::Browser2::Render::segment /usr/share/perl5/Bio/Graphics/Browser2/Render.pm:1197 STACK: Bio::Graphics::Browser2::Render::_update_state /usr/share/perl5/Bio/Graphics/Browser2/Render.pm:1932 STACK: Bio::Graphics::Browser2::Render::update_state /usr/share/perl5/Bio/Graphics/Browser2/Render.pm:1922 STACK: Bio::Graphics::Browser2::Render::run /usr/share/perl5/Bio/Graphics/Browser2/Render.pm:296 STACK: /usr/lib/cgi-bin/gbrowse/gbrowse:50 -----------------------------------------------------------

 


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
Reply | Threaded
Open this post in threaded view
|

Re: connect gbrowse to drupal db

Sofia Robb
In reply to this post by Scott Cain
Yes that was it.

nobody could not select *  on ...

This worked:  
grant select on all tables in schema chado to nobody;

Thanks!!
Sofia

On Wed, Oct 1, 2014 at 2:05 PM, Scott Cain <[hidden email]> wrote:
Hi Sofia,

It looks to me like it can't find or access the the chado schema; getting SO/SOFA is the first thing the adaptor does when talking to the database, so with that failing, I'm thinking it can't do anything.

Have you tried using the psql shell as that use to see if it can do selects?  I think you have to explicitly give select ("GRANT SELECT ...") for the user, as USAGE is only for procedural languages (I'm honestly not positive about that, I just read about USAGE :-)

Scott


On Wed, Oct 1, 2014 at 3:41 PM, Sofia Robb <[hidden email]> wrote:
Hello,

I am trying to connect gbrowse to my drupal chado database but I am unsuccessful. What am I missing? 

I created the user nobody with the following commands:

CREATE USER nobody;
ALTER USER nobody WITH PASSWORD 'nobody';
GRANT CONNECT ON DATABASE drupal TO nobody;
GRANT USAGE ON SCHEMA chado TO nobody;
ALTER ROLE nobody SET search_path TO chado;


and have this in my config:

[main:database]
db_adaptor    = Bio::DB::Das::Chado
db_args       = -dsn dbi:Pg:dbname=drupal
                -user nobody
                -pass nobody
                -srcfeatureslice 1
                -inferCDS 1
                -organism "Schmidtea mediterranea"

and I am getting this error:

------------- EXCEPTION: Bio::Root::Exception ------------- MSG: trying to find SOFA STACK: Error::throw STACK: Bio::Root::Root::throw /usr/share/perl5/Bio/Root/Root.pm:486 STACK: Bio::DB::Das::Chado::sofa_id /usr/local/share/perl/5.18.2/Bio/DB/Das/Chado.pm:886 STACK: Bio::DB::Das::Chado::new /usr/local/share/perl/5.18.2/Bio/DB/Das/Chado.pm:252 STACK: Bio::Graphics::Browser2::DataBase::open_database /usr/share/perl5/Bio/Graphics/Browser2/DataBase.pm:44 STACK: Bio::Graphics::Browser2::DataSource::open_database /usr/share/perl5/Bio/Graphics/Browser2/DataSource.pm:1005 STACK: Bio::Graphics::Browser2::Render::region /usr/share/perl5/Bio/Graphics/Browser2/Render.pm:1116 STACK: Bio::Graphics::Browser2::Render::segment /usr/share/perl5/Bio/Graphics/Browser2/Render.pm:1197 STACK: Bio::Graphics::Browser2::Render::_update_state /usr/share/perl5/Bio/Graphics/Browser2/Render.pm:1932 STACK: Bio::Graphics::Browser2::Render::update_state /usr/share/perl5/Bio/Graphics/Browser2/Render.pm:1922 STACK: Bio::Graphics::Browser2::Render::run /usr/share/perl5/Bio/Graphics/Browser2/Render.pm:296 STACK: /usr/lib/cgi-bin/gbrowse/gbrowse:50 -----------------------------------------------------------


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse




--
------------------------------------------------------------------------
Scott Cain, Ph. D.                                   scott at scottcain dot net
GMOD Coordinator (http://gmod.org/)                     <a href="tel:216-392-3087" value="+12163923087" target="_blank">216-392-3087
Ontario Institute for Cancer Research


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse