Discussion:
[Gmod-gbrowse] connect gbrowse to drupal db
Sofia Robb
2014-10-01 19:41:38 UTC
Permalink
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
-----------------------------------------------------------
Sofia Robb
2014-10-01 19:54:57 UTC
Permalink
-- sorry if this message comes thru a few times, I forgot which email
address I am registered under for the the mailing list.



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
-----------------------------------------------------------
Cook, Malcolm
2014-10-01 20:29:42 UTC
Permalink
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:***@sofiarobb.com]
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 -----------------------------------------------------------
Scott Cain
2014-10-01 20:05:35 UTC
Permalink
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
Post by Sofia Robb
Hello,
I am trying to connect gbrowse to my drupal chado database but I am
unsuccessful. What am I missing?
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;
[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"
------------- 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
Bio::DB::Das::Chado::new
Bio::Graphics::Browser2::DataBase::open_database
Bio::Graphics::Browser2::DataSource::open_database
Bio::Graphics::Browser2::Render::region
Bio::Graphics::Browser2::Render::segment
Bio::Graphics::Browser2::Render::_update_state
Bio::Graphics::Browser2::Render::update_state
Bio::Graphics::Browser2::Render::run
/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
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
Sofia Robb
2014-10-01 20:42:22 UTC
Permalink
Yes that was it.

nobody could not select * on ...

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

Thanks!!
Sofia
Post by Cook, Malcolm
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
Post by Sofia Robb
Hello,
I am trying to connect gbrowse to my drupal chado database but I am
unsuccessful. What am I missing?
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;
[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"
------------- 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
Bio::DB::Das::Chado::new
Bio::Graphics::Browser2::DataBase::open_database
Bio::Graphics::Browser2::DataSource::open_database
Bio::Graphics::Browser2::Render::region
Bio::Graphics::Browser2::Render::segment
Bio::Graphics::Browser2::Render::_update_state
Bio::Graphics::Browser2::Render::update_state
Bio::Graphics::Browser2::Render::run
/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
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
Loading...