<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000066">
    Hi Andreas and Anne,<br>
    <br>
    Thank you so much for your replies.<br>
    <br>
    Firstly, as Andreas suggested, I will get a local copy of the
    database before I proceed.<br>
    Thank you for pointing this out. And yes, the web service and
    command line calls are<br>
    run on the same machine.<br>
    <br>
    Anne, if I connect directly from command line it works perfectly
    fine. I have tested it<br>
    a few times over a few days, and it always works from command line,
    and doesn't<br>
    work when I call the script via the web. So, I'm pretty sure it's
    not a problem with<br>
    the database.<br>
    <br>
    I will try it with a local copy of the db and see if I have the same
    problem...<br>
    <br>
    Thank you so much!<br>
    <br>
    Regards,<br>
    Natascha<br>
    <br>
    <pre class="moz-signature" cols="72">

</pre>
    <br>
    On Wednesday 19,October,2011 04:53 PM, Anne Parker wrote:
    <blockquote
      cite="mid:5410B9C1-1973-43C8-95EB-A9F922662634@sanger.ac.uk"
      type="cite">
      <pre wrap="">We were having problems yesterday afternoon with someone "spamming" the public database server with badly-optimised queries. This may well account for your database connection issues. Can you try connecting directly from a command line, and let us know if that works?

Cheers

Anne



On 19 Oct 2011, at 09:48, Andreas Kusalananda Kähäri wrote:

</pre>
      <blockquote type="cite">
        <pre wrap="">Just throwing in another thought about this:

The point in the code where your program breaks is just after failing
to establish a connection to the database. There might be too many
connections open by others for you to connect. In this case, waiting
for others to finish fetching their data and then trying again would
solve the problem.

Kind regards,
AKK

On 19 October 2011 09:24, Andreas Kusalananda Kähäri <a class="moz-txt-link-rfc2396E" href="mailto:ak@ebi.ac.uk"><ak@ebi.ac.uk></a> wrote:
</pre>
        <blockquote type="cite">
          <pre wrap="">Hi Natascha,

I can't see anything obviously wrong with your code. If you get as far
as trying to connect, all modules are most likely loaded ok.

The environment from which the program is executing when running from
the command line is obviously different in some way from when you're
running the program via the web server, but I can't see in what way.
I'm wondering if proxies makes a difference on this level or not, but
unfortunately I'm not experienced enough with web services to make a
proper diagnosis.

Are you running the web service from the same machine as when you run
the program from the command line? If not, do they both have the same
connectivity to external hosts (e.g., ensembldb)?


By the way, if you're developing a web application using the Ensembl
API, I would strongly advise to point it to local copies of the
databases, not at our public database server as this is likely to slow
interactiveness down for you (and possibly slow down access for our
other users).


Kind regards,
Andreas Kusalananda Kähäri


On 19 October 2011 05:44, Natascha May <a class="moz-txt-link-rfc2396E" href="mailto:natascha@tll.org.sg"><natascha@tll.org.sg></a> wrote:
</pre>
          <blockquote type="cite">
            <pre wrap="">Hello everyone,

I am new to using the ensembl perl API (version 63). I would really
appreciate some help for a problem I'm having with my perl script.

The perl script basically connects to the DB and uses the slice method to
retrieve some information. If I run this perl script
from my terminal, it works fine, and I am able to get results from ensembl.
However, if I call this perl script via a php script
(because I am trying to develop a web based tool), the MySQL connection
fails.

Error message in httpd/error_log:

DBI connect('host=ensembldb.ensembl.org;port=5306','anonymous',...) failed:
Can't connect to MySQL server on
'ensembldb.ensembl.org' (13) at
/var/www/cgi-bin/tll_blat/ensembl-src/ensembl/modules/Bio/EnsEMBL/Registry.pm
line 1452
Can't call method "selectall_arrayref" on an undefined value at
/var/www/cgi-bin/tll_blat/ensembl-src/ensembl/modules/Bio/EnsEMBL/Registry.pm
line 1455.

I have explicitly set the location of the ensembl and perl modules at the
top of my perl script as follows:

use warnings;

use lib '/var/www/cgi-bin/tll_blat/ensembl-src/bioperl-1.2.3';
use lib '/var/www/cgi-bin/tll_blat/ensembl-src/ensembl/modules';

use Bio::EnsEMBL::Registry;

$registry = 'Bio::EnsEMBL::Registry';
$slice='Bio::EnsEMBL::Slice';
$gene='Bio::EnsEMBL::Gene';

$registry->load_registry_from_db(-host => 'ensembldb.ensembl.org', -user =>
'anonymous');

All this works when I run it from command line, but not via the web.
Where could I be going wrong...?

Thank you so much!

~ Natascha

Information in this email is confidential and may also be privileged. It is
intended solely for the person to whom it is addressed. If you are not the
intended recipient, please notify the sender, and please delete the message
and any other record of it from your system immediately.

_______________________________________________
Dev mailing list    <a class="moz-txt-link-abbreviated" href="mailto:Dev@ensembl.org">Dev@ensembl.org</a>
List admin (including subscribe/unsubscribe):
<a class="moz-txt-link-freetext" href="http://lists.ensembl.org/mailman/listinfo/dev">http://lists.ensembl.org/mailman/listinfo/dev</a>
Ensembl Blog: <a class="moz-txt-link-freetext" href="http://www.ensembl.info/">http://www.ensembl.info/</a>


</pre>
          </blockquote>
          <pre wrap="">


--
Andreas Kusalananda Kähäri, Ensembl Software Developer
European Bioinformatics Institute (EMBL-EBI)
Wellcome Trust Genome Campus, Hinxton
Cambridge CB10 1SD, United Kingdom

</pre>
        </blockquote>
        <pre wrap="">


-- 
Andreas Kusalananda Kähäri, Ensembl Software Developer
European Bioinformatics Institute (EMBL-EBI)
Wellcome Trust Genome Campus, Hinxton
Cambridge CB10 1SD, United Kingdom

_______________________________________________
Dev mailing list    <a class="moz-txt-link-abbreviated" href="mailto:Dev@ensembl.org">Dev@ensembl.org</a>
List admin (including subscribe/unsubscribe): <a class="moz-txt-link-freetext" href="http://lists.ensembl.org/mailman/listinfo/dev">http://lists.ensembl.org/mailman/listinfo/dev</a>
Ensembl Blog: <a class="moz-txt-link-freetext" href="http://www.ensembl.info/">http://www.ensembl.info/</a>
</pre>
      </blockquote>
      <pre wrap="">
Anne Parker
Ensembl Web Production Manager
<a class="moz-txt-link-freetext" href="http://www.ensembl.org">http://www.ensembl.org</a>





</pre>
    </blockquote>
  
<br>
Information in this email is confidential and may also be privileged. It is intended solely for the person to whom it is addressed. If you are not the
intended recipient, please notify the sender, and please delete the message and any other record of it from your system immediately.
<br>
</body>
</html>