MicroStrategy / mstrio-py

Python integration for MicroStrategy
Apache License 2.0
89 stars 57 forks source link

full_search by date_modified failing for very large project with Java heap space I-Server Error ERR001 #160

Closed hustontrevor closed 4 months ago

hustontrevor commented 8 months ago

Project has over 30k objects. Only 250 modified in the desired range.
modified = full_search(connection=source_conn,project=prj,name='',date_modified='>=2023-09-01')

Connection to MicroStrategy Intelligence Server has been established. Error getting search result for search with ID DA0CF8AE814B05C83C06699CC9FEDA31 I-Server Error ERR001, Java heap space Ticket ID: 1b082734a30541e6b3062b96e71a39bb Connection to MicroStrategy Intelligence Server has been closed.

Traceback (most recent call last): File "c:\Users\u68398\Desktop\MicroStrategy GitLab\automation\Python_Mstrio_REST\hwpy\mstrio\ServerUpgrade_Package_All_Project_by_ModDate.py", line 185, in main() File "c:\Users\u68398\Desktop\MicroStrategy GitLab\automation\Python_Mstrio_REST\hwpy\mstrio\ServerUpgrade_Package_All_Project_by_ModDate.py", line 83, in main modified = full_search(connection=source_conn,project=prj,name='',date_modified=searchValue) File "c:\Users\u68398\Desktop\MicroStrategy GitLab\automation\Python_Mstrio_REST.venv\lib\sitepackages\mstrio\utils\version_helper.py", line 41, in inner return function(args, kwargs) File "c:\Users\u68398\Desktop\MicroStrategy GitLab\automation\Python_Mstrio_REST.venv\lib\sitepackages\mstrio\object_management\search_operations.py", line 366, in full_search return get_search_results(search_result_params) File "c:\Users\u68398\Desktop\MicroStrategy GitLab\automation\Python_Mstrio_REST.venv\lib\sitepackages\mstrio\utils\version_helper.py", line 41, in inner return function(args, kwargs) File "c:\Users\u68398\Desktop\MicroStrategy GitLab\automation\Python_Mstrio_REST.venv\lib\sitepackages\mstrio\object_management\search_operations.py", line 538, in get_search_results return _get_search_result_list_format(get_result_params) File "c:\Users\u68398\Desktop\MicroStrategy GitLab\automation\Python_Mstrio_REST.venv\lib\sitepackages\mstrio\object_management\search_operations.py", line 552, in _get_search_result_list_format response = browsing.get_search_results( File "c:\Users\u68398\Desktop\MicroStrategy GitLab\automation\Python_Mstrio_REST.venv\lib\sitepackages\mstrio\utils\error_handlers.py", line 61, in inner response_handler(response, error_msg, **handler_kwargs) File "c:\Users\u68398\Desktop\MicroStrategy GitLab\automation\Python_Mstrio_REST.venv\lib\sitepackages\mstrio\utils\helper.py", line 255, in response_handler raise IServerError( mstrio.helpers.IServerError: Java heap space; code: 'ERR001', ticket_id: '1b082734a30541e6b3062b96e71a39bb'

urszulajaczewska commented 8 months ago

Hi @hustontrevor, we've logged a defect for it and we'll investigate the issue.

hustontrevor commented 5 months ago

If anyone needs a workaround for this, I cheated and just queried the metadata database directly. The Platform_Analytics lu_objects table is another option, but it's a messy list that needs lots of filtering.

        sql = f'''SELECT p.OBJECT_NAME project_name ,o.OBJECT_ID id ,o.OBJECT_TYPE type 
                FROM {schema}.DSSMDOBJINFO o JOIN {schema}.DSSMDOBJINFO p on p.OBJECT_ID = o.PROJECT_ID
                WHERE o.mod_time >= to_date({sqlsearchValue},'YYYY-MM-DD') 
                    and o.object_name <> 'Managed Objects' 
                    and o.object_type not in (75) '''
mgorskiMicroStrategy commented 4 months ago

Hi @hustontrevor This issue should be solved with the latest Microstrategy One March 2024 release Error message was improved also full_search has new parameters begin_modification_time and end_modification_time that will give possibility to filter results on server side