{"record":{"id":"fc1dcdf39800fd97","repo":"goharbor/harbor","slug":"can-not-get-file-info","errorCode":null,"errorMessage":"Can not get file info","messagePattern":"Can not get file info","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"make/photon/prepare/utils/configs.py","lineNumber":70,"sourceCode":"    # original is registry_storage_provider_config\n    storage_provider_config = conf.get(\"storage_provider_config\")\n    if storage_provider_name != \"filesystem\":\n        if storage_provider_config == \"\":\n            raise Exception(\n                \"Error: no provider configurations are provided for provider %s\" % storage_provider_name)\n    # ca_bundle validate\n    if conf.get('registry_custom_ca_bundle_path'):\n        registry_custom_ca_bundle_path = conf.get('registry_custom_ca_bundle_path') or ''\n        if registry_custom_ca_bundle_path.startswith('/data/'):\n            ca_bundle_host_path = registry_custom_ca_bundle_path\n        else:\n            ca_bundle_host_path = os.path.join(host_root_dir, registry_custom_ca_bundle_path.lstrip('/'))\n        try:\n            uid = os.stat(ca_bundle_host_path).st_uid\n            st_mode = os.stat(ca_bundle_host_path).st_mode\n        except Exception as e:\n            logging.error(e)\n            raise Exception('Can not get file info')\n        err_msg = 'Cert File {} should be owned by user with uid 10000 or readable by others'.format(registry_custom_ca_bundle_path)\n        if uid == DEFAULT_UID and not owner_can_read(st_mode):\n            raise Exception(err_msg)\n        if uid != DEFAULT_UID and not other_can_read(st_mode):\n            raise Exception(err_msg)\n\n    # TODO:\n    # If user enable trust cert dir, need check if the files in this dir is readable.\n\n    if conf.get('trace'):\n        conf['trace'].validate()\n\n    if conf.get('purge_upload'):\n        conf['purge_upload'].validate()\n\n    if conf.get('cache'):\n        conf['cache'].validate()\n","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/make/photon/prepare/utils/configs.py#L52-L88","documentation":"Thrown by validate() in make/photon/prepare/utils/configs.py during the custom CA bundle check. When harbor.yml sets 'storage_service.ca_bundle', prepare stats the file to later enforce ownership/readability; paths outside /data/ are resolved against the host root as seen inside the prepare container (os.path.join(host_root_dir, path.lstrip('/'))). Any OSError from os.stat (missing file, non-existent directory, permission denied on a parent dir) is logged and re-raised as this generic message.","triggerScenarios":"harbor.yml sets ca_bundle to a path that does not exist on the Docker host, or whose parent directories lack execute (search) permission for the prepare container user, or a /data/-prefixed path that is not actually inside the mounted data volume. Example: ca_bundle: /certs/ca.pem with the file actually at /etc/harbor/ca.pem.","commonSituations":"Private CA bundles for S3 endpoints stored on admin laptops and not copied to the Harbor host; typo'd paths; files under directories with 0700 root-only permissions.","solutions":["Verify the exact path exists on the Docker host: ls -l <path>","Fix the ca_bundle value in harbor.yml to the real absolute path","Ensure every parent directory is traversable (chmod o+x) and the file is inside a location visible to the prepare container","Re-run ./install.sh; the subsequent uid/mode checks (errors 29/30) may then apply"],"exampleFix":"# harbor.yml (before)\nstorage_service:\n  ca_bundle: /certs/root-ca.pem   # not present on host\n\n# harbor.yml (after)\nstorage_service:\n  ca_bundle: /data/secret/root-ca.pem  # shipped into the data volume","handlingStrategy":"try-catch","validationCode":"import os\np = cfg.get('storage_service', {}).get('ca_bundle')\nif p:\n    host_path = p if p.startswith('/data/') else os.path.join('/hostfs', p.lstrip('/'))\n    if not os.path.isfile(host_path):\n        raise SystemExit('ca_bundle not found on host: %s' % host_path)\n    if not os.access(host_path, os.R_OK):\n        raise SystemExit('ca_bundle not readable: %s' % host_path)","typeGuard":null,"tryCatchPattern":"try:\n    validate(config_dict)\nexcept Exception as e:\n    if 'Can not get file info' in str(e):\n        # underlying os.stat error is in the prepare log (logging.error)\n        raise SystemExit('ca_bundle path missing/unreadable - check harbor.yml storage_service.ca_bundle')\n    raise","preventionTips":["Copy CA bundles to the Harbor host and reference them by absolute path before install","Check parent-directory permissions, not just the file","Read the prepare log line above the exception - it contains the real os.stat error"],"tags":["harbor","storage","ca-certificate","file-system","configuration"],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}