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

Issue with gene-panel-data/fetch API When molecularProfileIds is Empty #11252

Open
jonkiky opened this issue Dec 4, 2024 · 3 comments
Open

Comments

@jonkiky
Copy link

jonkiky commented Dec 4, 2024

Issue with gene-panel-data/fetch API When molecularProfileIds is Empty

I am facing an issue when using the API gene-panel-data/fetch with an empty molecularProfileIds array as the request payload.

Working Example

The following request works correctly:

curl -X POST https://www.cbioportal.org/api/gene-panel-data/fetch \
-H "Content-Type: application/json" \
-d '{
  "molecularProfileIds": [
    "msk_chord_2024_cna",
    "msk_chord_2024_mutations",
    "msk_chord_2024_structural_variants"
  ]
}'

Problematic Request

When we change the request payload to have an empty molecularProfileIds array:

curl -X POST https://www.cbioportal.org/api/gene-panel-data/fetch \
-H "Content-Type: application/json" \
-d '{"molecularProfileIds": []}'

The API responds with an error:

{
  "message": "interceptedGenePanelDataMultipleStudyFilter size must be between 1 and 10000000"
}

Question

Why does interceptedGenePanelDataMultipleStudyFilter require a size between 1 and 10,000,000?

Context

We set up an empty cBioPortal instance, loading only study metadata and clinical data, without any gene panel data (as we don't have it available currently).

After setting this up, when accessing the study view page, it shows an error page.

Investigation

Upon further investigation, the error originates from the following file in the cBioPortal codebase:

File Path: GenePanelDataController.java

Relevant Code (Line 87):

if (CollectionUtils.isEmpty(interceptedGenePanelDataMultipleStudyFilter.getMolecularProfileIds())) {
    // Error occurs here
}

When the payload's molecularProfileIds is empty, getMolecularProfileIds() returns null. Since the program expects a collection or list, this causes an error.

@jonkiky
Copy link
Author

jonkiky commented Dec 4, 2024

I created PR for this fix. Please help me to review it. Thanks

@Aiosa
Copy link

Aiosa commented Dec 10, 2024

I have the same issue and I have similar bugfix locally.

@arishta
Copy link

arishta commented Dec 23, 2024

@jonkiky This issue seems to be a duplicate of this one:
#11161

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

3 participants