Skip to content

BUG: ERROR: RangeError: Invalid string length #332

Description

@jz-channing

We have the following python script that uses the Gen3Query.raw_data_download function from the gen3sdk to issue queries through guppy's "download" endpoint to the elasticsearch backend:

from gen3.auth import Gen3Auth
from gen3.query import Gen3Query

import pandas as pd

import sys

Auth = Gen3Auth('https://changen3.bwh.harvard.edu/') ## By defau

inst = "der7620"
filter_object={"=": {"source_instrument": inst } }

obs_result = Gen3Query(Auth).raw_data_download('observations',
                                               fields=['instrument_field_id', 'observation_text', 'subject_id', 'source_instrument'],
                                               sort_fields=[{'_observations_id':'asc'},],
                                               filter_object=filter_object,
)

print(f'{len(obs_result)=}')
df = pd.DataFrame(obs_result)
print(f'{df=}')
print(f'{df.shape}')

Using the Explorer interface, we can see that this query should return 121241 rows. Instead, it runs for a 1-2 minutes and fails with the error message:

Traceback (most recent call last):
  File "/udd/rejpz/tmp/der7620-test-raw-chankbetest.py", line 27, in <module>
    obs_result = Gen3Query(Auth).raw_data_download('observations',
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/udd/rejpz/.conda/envs/gen3-sdk/lib/python3.11/site-packages/gen3/query.py", line 203, in raw_data_download
    raise_for_status_and_print_error(response)
  File "/udd/rejpz/.conda/envs/gen3-sdk/lib/python3.11/site-packages/gen3/utils.py", line 98, in raise_for_status_and_print_error
    response.raise_for_status()
  File "/udd/rejpz/.conda/envs/gen3-sdk/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://changen3.bwh.harvard.edu/guppy/download

and in the guppy logs, we see ERROR: RangeError: Invalid string length. We are using the guppy image tagged "2025.03". Nothing seems unusual in the elasticsearch pod logs.

I have tried to increase the verbosity of the guppy logs by setting guppy.log_level=DEBUG in our values.yaml; but it doesn't seem to work. We have also tried cloning the guppy source and building our own image; but we run into permission problems with "FROM 707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/nodejs-base:master" in the guppy Dockerfile.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions