{"record":{"id":"27e9c9428a0ffb7d","repo":"microsoft/qlib","slug":"mount-provider-uri-on-mount-path-error-comman","errorCode":null,"errorMessage":"mount {provider_uri} on {mount_path} error! Command error","messagePattern":"mount (.+?) on (.+?) error! Command error","errorType":"exception","errorClass":"OSError","httpStatus":null,"severity":"error","filePath":"qlib/__init__.py","lineNumber":181,"sourceCode":"                except Exception as e:\n                    raise OSError(\n                        f\"Failed to create directory {mount_path}, please create {mount_path} manually!\"\n                    ) from e\n\n                # check nfs-common\n                command_res = os.popen(\"dpkg -l | grep nfs-common\")\n                command_res = command_res.readlines()\n                if not command_res:\n                    raise OSError(\"nfs-common is not found, please install it by execute: sudo apt install nfs-common\")\n                # manually mount\n                try:\n                    subprocess.run(mount_command, check=True, capture_output=True, text=True)\n                    LOG.info(\"Mount finished.\")\n                except subprocess.CalledProcessError as e:\n                    if e.returncode == 256:\n                        raise OSError(\"Mount failed: requires sudo or permission denied\") from e\n                    elif e.returncode == 32512:\n                        raise OSError(f\"mount {provider_uri} on {mount_path} error! Command error\") from e\n                    else:\n                        raise OSError(f\"Mount failed: {e.stderr}\") from e\n            else:\n                LOG.warning(f\"{_remote_uri} on {_mount_path} is already mounted\")\n\n\ndef init_from_yaml_conf(conf_path, **kwargs):\n    \"\"\"init_from_yaml_conf\n\n    :param conf_path: A path to the qlib config in yml format\n    \"\"\"\n\n    if conf_path is None:\n        config = {}\n    else:\n        with open(conf_path) as f:\n            yaml = YAML(typ=\"safe\", pure=True)\n            config = yaml.load(f)","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/microsoft/qlib/blob/79633dd9506ea689e5400dea0197717b5b3d74b7/qlib/__init__.py#L163-L199","documentation":"Base ExpressionCache.update (qlib/data/cache.py:378) is the abstract method that brings expression cache files up to date with the latest calendar; it must return 0 (updated), 1 (no need), or 2 (failure). The base class has no update logic, so it raises NotImplementedError. Callers typically invoke this after new trading days are dumped into the data provider.","triggerScenarios":"Calling ExpressionCache.update(cache_uri, freq) — directly or via cache maintenance scripts — on a subclass (or the base class) that does not override update; common after appending new bar data and wanting to extend cached features.","commonSituations":"Custom expression cache lacking the update hook; calling update on the base provider chain while only DiskExpressionCache implements it.","solutions":["Use DiskExpressionCache, whose update() is implemented for the on-disk format","Override update(self, cache_uri, freq='day') -> int in your custom cache to refresh cache files against the newest calendar","Skip calling update if your cache backend does not support incremental refresh (rebuild the cache instead)"],"exampleFix":"# before\ncache = MyExprCache(provider)  # update() not implemented\ncache.update(cache_uri, \"day\")  # NotImplementedError\n\n# after\nfrom qlib.data.cache import DiskExpressionCache\ncache = DiskExpressionCache(provider)\nstatus = cache.update(cache_uri, \"day\")  # 0/1/2","handlingStrategy":"type-guard","validationCode":"from qlib.data.cache import ExpressionCache\n\nassert MyExprCache.update is not ExpressionCache.update, \\\n    \"custom ExpressionCache must implement update() for daily refresh\"","typeGuard":"def supports_update(cache_cls) -> bool:\n    return cache_cls.update is not ExpressionCache.update and cache_cls.update is not DatasetCache.update","tryCatchPattern":"try:\n    status = cache.update(cache_uri, freq)  # 0/1/2\nexcept NotImplementedError:\n    # backend cannot incrementally refresh -> rebuild\n    shutil.rmtree(cache_dir, ignore_errors=True)\n    regenerate_cache()","preventionTips":["Wrap cache refresh in maintenance tooling that handles NotImplementedError by rebuilding","Pin cache schema and qlib version together","Run update() only after the calendar/data dump succeeded"],"tags":["qlib","cache","custom-backend","not-implemented"],"backgroundTag":null,"analyzedSha":"79633dd9506ea689e5400dea0197717b5b3d74b7","analyzedAt":"2026-08-15T07:01:27.511Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}