Skip to content

Cache update fails if not run from folder containing core.py / core executable #1403

@ASL-rmarshall

Description

@ASL-rmarshall

If the CLI is run from any location that does not contain a resources/cache subfolder - either directly with core.py or via a binary executable - using the update-cache command, it fails with the following error:

Traceback (most recent call last):
  File "core.py", line 808, in <module>
  File "click\core.py", line 1157, in __call__
  File "click\core.py", line 1078, in main
  File "click\core.py", line 1688, in invoke
  File "click\core.py", line 1434, in invoke
  File "click\core.py", line 783, in invoke
  File "click\decorators.py", line 33, in new_func
  File "core.py", line 485, in update_cache
  File "asyncio\runners.py", line 195, in run
  File "asyncio\runners.py", line 118, in run
  File "asyncio\base_events.py", line 691, in run_until_complete
  File "cdisc_rules_engine\services\cache\cache_populator_service.py", line 54, in update_cache
  File "cdisc_rules_engine\services\cache\cache_populator_service.py", line 115, in save_rules_locally
FileNotFoundError: [Errno 2] No such file or directory: 'resources\\cache\\rules.pkl'
[PYI-38392:ERROR] Failed to execute script 'core' due to unhandled exception!

One of the following should be done:

  • Update the cache location to be relative to the folder containing core.py (not relative to the current folder)
  • Update README.md to indicate the requirement that update-cache is only used in a folder containing a resources/cache subfolder (e.g., the folder containing core.py or the core executable).
  • Make the cache location configurable (though the default should still be relative to the folder containing core.py)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions