{"record":{"id":"4291e74abc3bb072","repo":"apache/iceberg","slug":"failed-to-load-version-properties-from","errorCode":null,"errorMessage":"Failed to load version properties from {}","messagePattern":"Failed to load version properties from (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"api/src/main/java/org/apache/iceberg/IcebergBuild.java","lineNumber":54,"sourceCode":"  private static final String VERSION_PROPERTIES_FILE = \"/iceberg-build.properties\";\n  private static final String UNKNOWN_DEFAULT = \"unknown\";\n\n  private static volatile boolean isLoaded = false;\n\n  private static String shortId; // 10 character short git hash of the build\n  private static String commitId; // 40 character full git hash of the build\n  private static String branch;\n  private static List<String> tags;\n  private static String version;\n  private static String fullVersion;\n\n  /** Loads the version.properties file for this module. */\n  public static void loadBuildInfo() {\n    Properties buildProperties = new Properties();\n    try (InputStream is = readResource(VERSION_PROPERTIES_FILE)) {\n      buildProperties.load(is);\n    } catch (Exception e) {\n      LOG.warn(\"Failed to load version properties from {}\", VERSION_PROPERTIES_FILE, e);\n    }\n\n    IcebergBuild.shortId = buildProperties.getProperty(\"git.commit.id.abbrev\", UNKNOWN_DEFAULT);\n    IcebergBuild.commitId = buildProperties.getProperty(\"git.commit.id\", UNKNOWN_DEFAULT);\n    IcebergBuild.branch = buildProperties.getProperty(\"git.branch\", UNKNOWN_DEFAULT);\n    String tagList = buildProperties.getProperty(\"git.tags\", \"\");\n    if (!tagList.isEmpty()) {\n      IcebergBuild.tags = ImmutableList.copyOf(Splitter.on(\",\").split(tagList));\n    } else {\n      IcebergBuild.tags = ImmutableList.of();\n    }\n    IcebergBuild.version = buildProperties.getProperty(\"git.build.version\", UNKNOWN_DEFAULT);\n    IcebergBuild.fullVersion = String.format(\"Apache Iceberg %s (commit %s)\", version, commitId);\n  }\n\n  public static String gitCommitId() {\n    ensureLoaded();\n    return commitId;","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/api/src/main/java/org/apache/iceberg/IcebergBuild.java#L36-L72","documentation":"IcebergBuild.loadBuildInfo() reads /iceberg-build.properties from the classpath to populate build metadata (git commit, branch, version). If the resource is missing or unreadable, it logs this warning and falls back to 'unknown' for all fields; it never throws. The library emits it so operators know runtime version reporting (e.g. in logs and diagnostics) is degraded.","triggerScenarios":"Calling any IcebergBuild static accessor (version(), fullVersion(), gitCommitId(), etc.) triggers ensureLoaded() -> loadBuildInfo(), which warns when /iceberg-build.properties is absent from the classpath or its InputStream fails to load (e.g. corrupted jar, classloader shading stripped the resource).","commonSituations":"Shading/relocating Iceberg jars without including resource files; fat jars built with resource filtering that excludes .properties; running a repackaged or IDE-compiled build where the build-time resource generation step was skipped; custom classloaders that don't see the resource in the Iceberg jar.","solutions":["Verify iceberg-build.properties exists at the jar root of the iceberg-api jar on the classpath (unzip -l iceberg-api-*.jar | grep iceberg-build.properties).","Use official, unmodified Iceberg release artifacts instead of manually repackaged jars, or ensure your shading config (e.g. Maven Shade) does not exclude .properties resources.","Run a full Gradle build (or use published artifacts) so the build-info resource is generated rather than compiling the module alone in an IDE.","If the warning is cosmetic in a controlled deployment, it can be safely ignored — the library continues with 'unknown' version strings."],"exampleFix":"// before (maven-shade-plugin)\n<filters>\n  <filter><artifact>*:*</artifact><excludes><exclude>*.properties</exclude></excludes></filter>\n</filters>\n\n// after\n<filters>\n  <filter><artifact>*:*</artifact><excludes><exclude>META-INF/*.SF</exclude></excludes></filter>\n</filters>","handlingStrategy":"validation","validationCode":"// Check the resource is on the classpath before relying on build metadata\nboolean present = IcebergBuild.class.getResource(\"/iceberg-build.properties\") != null;\nif (!present) {\n  LOG.warn(\"iceberg-build.properties missing from classpath; version reporting will be 'unknown'\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use official Iceberg artifacts; don't strip .properties files when shading.","Verify jar contents after packaging (unzip -l | grep iceberg-build.properties).","Prefer full Gradle builds over IDE-only compilation for deployable artifacts.","Remember the accessor methods never throw — treat 'unknown' values as a classpath packaging signal."],"tags":["classpath","missing-resource","build-metadata","logging","iceberg"],"backgroundTag":"config-file-not-found","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}