Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HttpApplicationError #129

Closed
meghanakaranam1 opened this issue May 19, 2023 · 8 comments
Closed

HttpApplicationError #129

meghanakaranam1 opened this issue May 19, 2023 · 8 comments

Comments

@meghanakaranam1
Copy link

meghanakaranam1 commented May 19, 2023

hi,
I'm getting this error. Is there a problem with my code, or is the api having any server side issues?
please help me out on this @eloyfelix @nclopezo @mnowotka @fredrikw @sshojiro

image

@Acario
Copy link

Acario commented May 20, 2023

I am getting the same error. My code was working fine two weekends ago. Today I tried it on the same compound as two weeks ago and this error came up. I would like to know what is going on as well here.

@fredrikw
Copy link
Contributor

fredrikw commented May 22, 2023

Hello,
Did you check if the api hade any problems? Do you have a minimum reproducible example? It would be a lot better if you copied and pasted the code and error message as text instead of a screen shot. For one, it's possible to copy and paste to test instead of typing everything manually. Also, you have cut the error message, did it include anymore specifics on the server error?
I don't have the library installed on my main computer at the moment so I can't easily try but the API seems to work. (Checkable at https://www.ebi.ac.uk/chembl/api/data/docs)

@Acario
Copy link

Acario commented May 22, 2023

Here is the code I am running:

from chembl_webresource_client.new_client import new_client

Here is the error:

`Exception Traceback (most recent call last)
Input In [1], in <cell line: 1>()
---> 1 from chembl_webresource_client.new_client import new_client

File ~\anaconda3\lib\site-packages\chembl_webresource_client\new_client.py:65, in
60 return client
63 #-----------------------------------------------------------------------------------------------------------------------
---> 65 new_client = client_from_url(Settings.Instance().NEW_CLIENT_URL + '/spore')

File ~\anaconda3\lib\site-packages\chembl_webresource_client\new_client.py:27, in client_from_url(url, base_url)
25 res = requests.get(url)
26 if not res.ok:
---> 27 raise Exception('Error getting schema from url {0} with status {1} and msg {2}'.format(url, res.status_code, res.text))
28 schema = res.json()
29 if 'base_url' not in schema:

Exception: Error getting schema from url https://www.ebi.ac.uk/chembl/api/data/spore with status 500 and msg <!doctype html>

<script> // Detect if JS is on and swap vf-no-js for vf-js on the html element (function(H){H.className=H.className.replace(/\bvf-no-js\b/,'vf-js')})(document.documentElement); </script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- <link rel="stylesheet" media="all" href="/css/styles.css?" /> -->
<title>Error: 500 | EMBL�s European Bionformatics Institute</title>



<link rel="icon" type="image/x-icon"

href="https://ebi.emblstatic.net/web_guidelines/EBI-Framework/v1.4/images/logos/EMBL-EBI/favicons/favicon.ico" />

<!-- Search indexing optimisations -->
<meta class="swiftype" name="what" data-type="string" content="none" />
<meta class="swiftype" name="where" data-type="string" content="EMBL-EBI" />


<!-- Descriptive meta -->
<meta name="title" content="Error: 500">
<meta name="author" content="European Bioinformatics Institute">
<meta name="robots" content="index, follow">
<meta name="keywords" content="">
<meta name="description" content="">

<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://www.ebi.ac.uk/info/error-pages/500-standalone/">
<meta property="og:title" content="Error: 500">
<meta property="og:description" content="">


<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="og:url" content="https://www.ebi.ac.uk/info/error-pages/500-standalone/">
<meta property="twitter:title" content="Error: 500">
<meta property="twitter:description" content="">


<!-- Content descriptors -->
<meta name="embl:who" content="EMBL-EBI Web Dev">
<meta name="embl:where" content="EMBL-EBI">
<meta name="embl:what" content="none">
<meta name="embl:active" content="where">

<!-- Content role -->
<meta name="embl:utility" content="10">
<meta name="embl:reach" content="0">

<!-- Page infromation -->
<meta name="embl:maintainer" content="EMBL-EBI Web Dev">
<meta name="embl:last-review" content="2021.04.01">
<meta name="embl:review-cycle" content="365">
<meta name="embl:expiry" content="never">

<!-- analytics -->
<meta name="vf:page-type" content="404;dimension1">

<!-- CSS only -->
<script src="https://assets.emblstatic.net/vf/v2.5.7/scripts/scripts.js"></script> <style>head, title, link, meta, style, script {--vf-stack-margin--custom: 0; }</style>
<!-- See the EBI Header Footer docs: https://stable.visual-framework.dev/components/ebi-header-footer -->

<link rel="stylesheet" href="https://assets.emblstatic.net/vf/v2.4.5/assets/ebi-header-footer/ebi-header-footer.css" type="text/css" media="all">
<header id="masthead-black-bar" class="clearfix masthead-black-bar | ebi-header-footer vf-content vf-u-fullbleed"></header>
<style> .embl-grid { margin-bottom: 48px; } </style>

Error: 500

There was a technical error.

Something has gone wrong with our web server when attempting to make this page.

Unfortunately, the service you are trying to access is currently unavailable.
Please try again later.

Search
All Genomes & metagenomes Nucleotide sequences Protein sequences Small molecules Gene expression Gene-Disease Associations Diseases Molecular interactions Reactions & pathways Protein families Literature Samples & ontologies EMBL-EBI People EMBL-EBI web
      <button type="submit" class="vf-search__button | vf-button vf-button--primary">
        <span class="vf-button__text">Search</span>
      </button>
    </div>
  </form>
  <p class="vf-text-body--5 vf-u-margin__bottom--0">
    Example searches: <a class="vf-link" href="/ebisearch/search.ebi?db=allebi&amp;requestFrom=ebi_index&amp;query=blast">blast</a>
    <a class="vf-link" href="/ebisearch/search.ebi?db=allebi&amp;query=keratin&amp;requestFrom=ebi_index">keratin</a>
    <a class="vf-link" href="/ebisearch/search.ebi?db=allebi&amp;query=bfl1&amp;requestFrom=ebi_index">bfl1</a>
    | <a class="vf-link" href="https://www.ebi.ac.uk/ebisearch/overview.ebi/about">About EBI Search</a>
  </p>
</section>

Need assistance?

Contact our support team
<!-- embl global footer -->
<script src="https://assets.emblstatic.net/vf/v2.4.9/scripts/scripts.js"></script>
<script nomodule crossorigin="anonymous" src="https://polyfill.io/v3/polyfill.min.js?flags=gated&features=default"></script> <script defer="defer" src="https://ebi.emblstatic.net/web_guidelines/EBI-Framework/v1.4/js/script.js"></script> <script> window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date; ga('create', 'UA-629242-1', 'auto'); </script> <script async src='https://www.google-analytics.com/analytics.js'></script> <script type="text/javascript"> document.addEventListener("DOMContentLoaded", function(event) { //- Code to execute when only the HTML document is loaded. //- This doesn't wait for stylesheets, // images, and subframes to finish loading. }); </script> `

@Acario
Copy link

Acario commented May 22, 2023

Sometimes it does successfully load the package but then I try to run the package over some compounds and get this below.

Code:
chembl_ids=[]
for h in range(0,len(comps)):
molecule=new_client.molecule
molS=molecule.filter(molecule_synonyms__molecule_synonym__iexact=comps[h])
if len(molS)>0:
chembl_ids.append(molS[0]['molecule_chembl_id']) # Synonym hit
else:
chembl_ids.append(0)

This is the error here:

`HttpApplicationError Traceback (most recent call last)
Input In [11], in <cell line: 2>()
3 molecule=new_client.molecule
4 molS=molecule.filter(molecule_synonyms__molecule_synonym__iexact=comps[h])
----> 5 if len(molS)>0:
6 chemblSyn.append(molS[0]['molecule_chembl_id']) # Synonym hit
7 else:

File ~\anaconda3\lib\site-packages\chembl_webresource_client\query_set.py:97, in QuerySet.len(self)
95 if not self.can_filter:
96 return 1
---> 97 return len(self.query)

File ~\anaconda3\lib\site-packages\chembl_webresource_client\url_query.py:144, in UrlQuery.len(self)
142 return
143 if not self.api_total_count:
--> 144 self.get_page()
145 return self.api_total_count

File ~\anaconda3\lib\site-packages\chembl_webresource_client\url_query.py:394, in UrlQuery.get_page(self)
392 self.logger.info('From cache: {0}'.format(res.from_cache if hasattr(res, 'from_cache') else False))
393 if not res.ok:
--> 394 handle_http_error(res)
395 if self.frmt == 'json':
396 json_data = res.json()

File ~\anaconda3\lib\site-packages\chembl_webresource_client\http_errors.py:113, in handle_http_error(request)
111 exception_class = status_to_exception.get(request.status_code, BaseHttpException)
112 if request.text:
--> 113 raise exception_class(request.url, request.text)
114 raise exception_class(request.url, request.content)

HttpApplicationError: Error for url https://www.ebi.ac.uk/chembl/api/data/molecule.json, server response: <!doctype html>

<script> // Detect if JS is on and swap vf-no-js for vf-js on the html element (function(H){H.className=H.className.replace(/\bvf-no-js\b/,'vf-js')})(document.documentElement); </script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- <link rel="stylesheet" media="all" href="/css/styles.css?" /> -->
<title>Error: 500 | EMBL�s European Bionformatics Institute</title>



<link rel="icon" type="image/x-icon"

href="https://ebi.emblstatic.net/web_guidelines/EBI-Framework/v1.4/images/logos/EMBL-EBI/favicons/favicon.ico" />

<!-- Search indexing optimisations -->
<meta class="swiftype" name="what" data-type="string" content="none" />
<meta class="swiftype" name="where" data-type="string" content="EMBL-EBI" />


<!-- Descriptive meta -->
<meta name="title" content="Error: 500">
<meta name="author" content="European Bioinformatics Institute">
<meta name="robots" content="index, follow">
<meta name="keywords" content="">
<meta name="description" content="">

<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://www.ebi.ac.uk/info/error-pages/500-standalone/">
<meta property="og:title" content="Error: 500">
<meta property="og:description" content="">


<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="og:url" content="https://www.ebi.ac.uk/info/error-pages/500-standalone/">
<meta property="twitter:title" content="Error: 500">
<meta property="twitter:description" content="">


<!-- Content descriptors -->
<meta name="embl:who" content="EMBL-EBI Web Dev">
<meta name="embl:where" content="EMBL-EBI">
<meta name="embl:what" content="none">
<meta name="embl:active" content="where">

<!-- Content role -->
<meta name="embl:utility" content="10">
<meta name="embl:reach" content="0">

<!-- Page infromation -->
<meta name="embl:maintainer" content="EMBL-EBI Web Dev">
<meta name="embl:last-review" content="2021.04.01">
<meta name="embl:review-cycle" content="365">
<meta name="embl:expiry" content="never">

<!-- analytics -->
<meta name="vf:page-type" content="404;dimension1">

<!-- CSS only -->
<script src="https://assets.emblstatic.net/vf/v2.5.7/scripts/scripts.js"></script> <style>head, title, link, meta, style, script {--vf-stack-margin--custom: 0; }</style>
<!-- See the EBI Header Footer docs: https://stable.visual-framework.dev/components/ebi-header-footer -->

<link rel="stylesheet" href="https://assets.emblstatic.net/vf/v2.4.5/assets/ebi-header-footer/ebi-header-footer.css" type="text/css" media="all">
<header id="masthead-black-bar" class="clearfix masthead-black-bar | ebi-header-footer vf-content vf-u-fullbleed"></header>
<style> .embl-grid { margin-bottom: 48px; } </style>

Error: 500

There was a technical error.

Something has gone wrong with our web server when attempting to make this page.

Unfortunately, the service you are trying to access is currently unavailable.
Please try again later.

Search
All Genomes & metagenomes Nucleotide sequences Protein sequences Small molecules Gene expression Gene-Disease Associations Diseases Molecular interactions Reactions & pathways Protein families Literature Samples & ontologies EMBL-EBI People EMBL-EBI web
      <button type="submit" class="vf-search__button | vf-button vf-button--primary">
        <span class="vf-button__text">Search</span>
      </button>
    </div>
  </form>
  <p class="vf-text-body--5 vf-u-margin__bottom--0">
    Example searches: <a class="vf-link" href="/ebisearch/search.ebi?db=allebi&amp;requestFrom=ebi_index&amp;query=blast">blast</a>
    <a class="vf-link" href="/ebisearch/search.ebi?db=allebi&amp;query=keratin&amp;requestFrom=ebi_index">keratin</a>
    <a class="vf-link" href="/ebisearch/search.ebi?db=allebi&amp;query=bfl1&amp;requestFrom=ebi_index">bfl1</a>
    | <a class="vf-link" href="https://www.ebi.ac.uk/ebisearch/overview.ebi/about">About EBI Search</a>
  </p>
</section>

Need assistance?

Contact our support team
<!-- embl global footer -->
<script src="https://assets.emblstatic.net/vf/v2.4.9/scripts/scripts.js"></script>
<script nomodule crossorigin="anonymous" src="https://polyfill.io/v3/polyfill.min.js?flags=gated&features=default"></script> <script defer="defer" src="https://ebi.emblstatic.net/web_guidelines/EBI-Framework/v1.4/js/script.js"></script> <script> window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date; ga('create', 'UA-629242-1', 'auto'); </script> <script async src='https://www.google-analytics.com/analytics.js'></script> <script type="text/javascript"> document.addEventListener("DOMContentLoaded", function(event) { //- Code to execute when only the HTML document is loaded. //- This doesn't wait for stylesheets, // images, and subframes to finish loading. }); </script> `

@eloyfelix
Copy link
Member

@juanfmx2 @nclopezo could you please take a look at it?

cc: @BZdrazil @FionaEBI

@fredrikw
Copy link
Contributor

It's working perfectly fine for me both through the package and directly on the API docs page. Most likely they had some problems on the API side. The error messages certainly indicates that. You get a 500-error from the API. So I wouldn't say it's a bug with the client package.

@juanfmx2
Copy link
Member

@fredrikw @Acario @meghanakaranam1 sorry for the late response, we were having intermittent issues with our infrastructure, but the service should be stable now. Please let me know if you are experiencing any other issues.

@Acario
Copy link

Acario commented May 30, 2023

Thanks for the help @fredrikw @juanfmx2!

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

No branches or pull requests

5 participants