{"record":{"id":"3df4618cc3b4d942","repo":"microsoft/qlib","slug":"invalid-mount-path-mount-path","errorCode":null,"errorMessage":"Invalid mount path: {mount_path}!","messagePattern":"Invalid mount path: (.+?)!","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"qlib/__init__.py","lineNumber":90,"sourceCode":"                    logger.warning(f\"auto_path is False, please make sure {mount_path} is mounted\")\n        elif uri_type == C.NFS_URI:\n            _mount_nfs_uri(provider_uri, C.dpm.get_data_uri(_freq), C[\"auto_mount\"])\n        else:\n            raise NotImplementedError(f\"This type of URI is not supported\")\n\n    C.register()\n\n    if \"flask_server\" in C:\n        logger.info(f\"flask_server={C['flask_server']}, flask_port={C['flask_port']}\")\n    logger.info(\"qlib successfully initialized based on %s settings.\" % default_conf)\n    data_path = {_freq: C.dpm.get_data_uri(_freq) for _freq in C.dpm.provider_uri.keys()}\n    logger.info(f\"data_path={data_path}\")\n\n\ndef _mount_nfs_uri(provider_uri, mount_path, auto_mount: bool = False):\n    LOG = get_module_logger(\"mount nfs\", level=logging.INFO)\n    if mount_path is None:\n        raise ValueError(f\"Invalid mount path: {mount_path}!\")\n    if not re.match(r\"^[a-zA-Z0-9.:/\\-_]+$\", provider_uri):\n        raise ValueError(f\"Invalid provider_uri format: {provider_uri}\")\n    # FIXME: the C[\"provider_uri\"] is modified in this function\n    # If it is not modified, we can pass only  provider_uri or mount_path instead of C\n    mount_command = [\"sudo\", \"mount.nfs\", provider_uri, mount_path]\n    # If the provider uri looks like this 172.23.233.89//data/csdesign'\n    # It will be a nfs path. The client provider will be used\n    if not auto_mount:  # pylint: disable=R1702\n        if not Path(mount_path).exists():\n            raise FileNotFoundError(\n                f\"Invalid mount path: {mount_path}! Please mount manually: {' '.join(mount_command)} or Set init parameter `auto_mount=True`\"\n            )\n    else:\n        # Judging system type\n        sys_type = platform.system()\n        if \"windows\" in sys_type.lower():\n            # system: window\n            try:","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/microsoft/qlib/blob/79633dd9506ea689e5400dea0197717b5b3d74b7/qlib/__init__.py#L72-L108","documentation":"Raised by Yahoo Run.download_data when interval is \"1d\" and the requested end date is in the future relative to today's local date. Yahoo Finance cannot return daily bars for dates that have not happened yet, so the collector refuses the request up front rather than downloading truncated/confusing data. Note the guard applies only to 1d; 1min downloads have their own bounds handling elsewhere.","triggerScenarios":"Calling `python collector.py download_data --interval 1d --end 2030-01-01` (any end > today), or calling Run(source_dir=..., interval=\"1d\", ...).download_data(..., end=<future date>) programmatically. Timezone skew matters too: pd.Timestamp(end) is compared to datetime.now() local date, so running near midnight with date formats that resolve to the next day can trip it.","commonSituations":"Copy-pasted commands from tutorials with stale/hardcoded future end dates (e.g. examples written when '2025-12-31' was in the future); cron scripts that compute end as today+N by mistake; users assuming end is exclusive or that a future end is clamped silently.","solutions":["Pass an end date that is today or earlier: --end $(date +%F).","Omit or adjust the computation producing the future date (check for off-by-one in date arithmetic, e.g. end = today + timedelta(days=1)).","If you genuinely want 'up to now', use today's date explicitly rather than a sentinel future date."],"exampleFix":"# before\npython collector.py download_data --source_dir ~/.qlib/stock_data/source --region CN --start 2020-11-01 --end 2030-01-01 --interval 1d\n\n# after\npython collector.py download_data --source_dir ~/.qlib/stock_data/source --region CN --start 2020-11-01 --end $(date +%F) --interval 1d","handlingStrategy":"validation","validationCode":"import datetime\nend = min(pd.Timestamp(end), pd.Timestamp(datetime.date.today()))  # clamp before calling download_data","typeGuard":null,"tryCatchPattern":"try:\n    run.download_data(..., end=end)\nexcept ValueError as e:\n    if \"greater than the current date\" in str(e):\n        end = datetime.date.today().isoformat()\n        run.download_data(..., end=end)\n    else:\n        raise","preventionTips":["Always derive end dates from datetime.date.today() instead of hardcoding them in scripts/crons.","Check for off-by-one in date arithmetic (end = today + 1 day) before passing to download_data."],"tags":["yahoo","download","date-validation","cli","argument-validation"],"backgroundTag":null,"analyzedSha":"79633dd9506ea689e5400dea0197717b5b3d74b7","analyzedAt":"2026-08-15T07:01:27.511Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}