MicroStrategy / mstrio-py

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

list_cube_caches has different behaviour on different environments #117

Closed jaypk closed 1 year ago

jaypk commented 1 year ago

On one environment, this API call works fine and returns expected output. On other environment, exact same call fails with the error mentioned below. Both environments have same mstrio package version, same I-server version, same Library version. Any idea what could be the reason for behind this issue?

Traceback (most recent call last): File "/Users/jaykakkad/PycharmProjects/NewProject/Test.py", line 29, in for cache in list_cube_caches(connection=con_mstr): File "/Users/jaykakkad/PycharmProjects/NewProject/venv/lib/python3.10/site-packages/mstrio/utils/version_helper.py", line 42, in inner return function(*args, **kwargs) File "/Users/jaykakkad/PycharmProjects/NewProject/venv/lib/python3.10/site-packages/mstrio/project_objects/datasets/cube_cache.py", line 69, in list_cube_caches caches += fetch_objects_async( File "/Users/jaykakkad/PycharmProjects/NewProject/venv/lib/python3.10/site-packages/mstrio/utils/helper.py", line 397, in fetch_objects_async objects = _prepare_objects(response.json(), filters, dict_unpack_value) File "/Users/jaykakkad/PycharmProjects/NewProject/venv/lib/python3.10/site-packages/mstrio/utils/helper.py", line 312, in _prepare_objects objects = objects[dict_unpack_value] KeyError: 'cubeCaches' None I-Server Error ERR006, state.loadedState is not valid Ticket ID: cb869d16dfd44ea0a8c27b861350616c

urszulajaczewska commented 1 year ago

Hi @jaypk, is this the same I-server or two different machines?

jaypk commented 1 year ago

Hi @urszulajaczewska , Thanks for your response! These are two different I-servers (same product version: 11.3.76) running on separate machines.

urszulajaczewska commented 1 year ago

@jaypk can you try finding and deleting cache that causes the problem? Or you can delete all of the caches if it won't cause any issues for users.

jaypk commented 1 year ago

@urszulajaczewska I tried your suggestion:

  1. Deleted cache of a cube
  2. Tried printing output of : print(list_cube_caches(connection=con_mstr, cube_id = cube_id)) and got the same error. It should have run without any error and returned an empty dictionary
  3. Refreshed the cube to generate cache again and tried printing the output of above command and got same response
  4. Now tried running the same print statement on different environment for same cube (with cache already available), it works and returns cache object
urszulajaczewska commented 1 year ago

@jaypk It seems like there is some issue with the server. Could you contact support?