502 Bad gateway error when calling the API

Hello community!

I am trying the retrieve pages with disease → targets associations. Some pages work, then every time, after a while, I get a 502 Error Bad Gateway. I am cautious of not getting my IP blocked, so I prefer to turn to the community for help, instead of trying to brute force this.

Note that I am asking quite a bit of data about the targets: id, symbol, but also
biotype,
chemicalProbes,
dbXrefs,
functionDescriptions,
geneticConstraint,
genomicLocation,
geneOntology,
homologues,
pathways,
proteinIds,
safetyLiabilities,
subcellularLocations,
targetClass,
tep,
tractability,
transcriptIds,
similarEntities,
literatureOcurrences,
expressions,
knownDrugs,

The BigQuery way is not an option at this stage, nor is the full data download.
Am I asking for too much data?

Hi Lucie,

Thank you for reporting this issue! However, to troubleshoot we would need the exact pages that are throwing the 502, or the query that you are using. (Are you using the API?)

For mid-size queries fetching data from API is fine. I don’t expect your queries being blocked because of extensive usage. We are taking a look.

Best,
Daniel

Hi all,

I have been running into the same “502 - server temporarily unavailable error” both when doing a query via R (httr2 package) and I get “JSON Parse error: Unrecognized token ‘<’” when querying via the playground.

Please, find the query below:

query associatedTargets {
  disease(efoId: "EFO_0003767") {
    id
    name
    children {
      id
      name
    }
    associatedTargets {
      rows {
        target {
          id
          approvedSymbol
          approvedName
          knownDrugs {
            uniqueDrugs
            rows {
              drug {
                id
                name
                drugType
                maximumClinicalTrialPhase
                approvedIndications
                indications {
                  rows {
                    disease {
                    	id
                      name
                    }
                    maxPhaseForIndication
                  }
                }
              }
            }
       		 }
        }
        score
        datatypeScores{
          id
          score
        }
      }
    }
  }
}

I have attempted the query a couple of times (~ 50 - 100) over two weeks and sometimes it works, but more often than not I get the 502 error. Using automatic retries in R does not help either. Since some of the queries are made from an HPC environment and some from my personal laptop, I do not think the failure is related to throttling. Nevertheless, it would be great it you could let me knot whether this might be the issue.

I would very much appreciate any feedback on what might be the problem and how to solve it.

Many thanks and best wishes,
Lisa

Hi Lisa,

Thank you for reporting this.

We have fixed the problem.

Kind regards,
Manuel

1 Like

Hi Manuel,

many thanks for looking into this.

The issue had in fact disappeared when you fixed it 13 days ago, but it seems to be back now. At least I am again getting '502 - Bad Gateway" errors.

It would be great if you could investigate this again.

Many thanks and best wishes,
Lisa

Hi Lisa,

I just addressed it in our infrastructure.

It’s an ongoing issue we have with our Elastic Search backend that we haven’t been able to reproduce, so we are walking in the dark there.

As an aside, would you mind providing more details on your activities around the platform (web and/or API) when you find this ‘502 - Bad Gateway’ error? It would be really helpful.

Thanks in advance for your help with this.

Kind regards,
Manuel

Hi Manuel,

thanks so much for looking into this.

I have only encountered the error when accessing the platform via the GraphQL API either in R (httr2 package) or via the playground. In R I do get the 502 error, and on the playground I get a json file parsing error.

Interestingly, the error does not persist for all the time, but the server seems to be available every now and then.

Do let me know if you need any more information.

Thanks for fixing and kind regards,
Lisa