{"id":"da7a62d39e107c4a","repo":"spring-projects/spring-boot","slug":"docker-context-currentcontext-does-not-exist","errorCode":null,"errorMessage":"Docker context '${currentContext}' does not exist","messagePattern":"Docker context '(.+?)' does not exist","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"buildpack/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/configuration/DockerConfigurationMetadata.java","lineNumber":136,"sourceCode":"\t\t\treturn DockerConfig.empty();\n\t\t}\n\t\ttry {\n\t\t\treturn DockerConfig.fromJson(readPathContent(path));\n\t\t}\n\t\tcatch (JacksonException ex) {\n\t\t\tthrow new IllegalStateException(\"Error parsing Docker configuration file '\" + path + \"'\", ex);\n\t\t}\n\t}\n\n\tprivate static DockerContext createDockerContext(String configLocation, @Nullable String currentContext) {\n\t\tif (currentContext == null || DEFAULT_CONTEXT.equals(currentContext)) {\n\t\t\treturn DockerContext.empty();\n\t\t}\n\t\tString hash = asHash(currentContext);\n\t\tPath metaPath = Path.of(configLocation, CONTEXTS_DIR, META_DIR, hash, CONTEXT_FILE_NAME);\n\t\tPath tlsPath = Path.of(configLocation, CONTEXTS_DIR, TLS_DIR, hash, DOCKER_ENDPOINT);\n\t\tif (!metaPath.toFile().exists()) {\n\t\t\tthrow new IllegalArgumentException(\"Docker context '\" + currentContext + \"' does not exist\");\n\t\t}\n\t\ttry {\n\t\t\tDockerContext context = DockerContext.fromJson(readPathContent(metaPath));\n\t\t\tif (tlsPath.toFile().isDirectory()) {\n\t\t\t\treturn context.withTlsPath(tlsPath.toString());\n\t\t\t}\n\t\t\treturn context;\n\t\t}\n\t\tcatch (JacksonException ex) {\n\t\t\tthrow new IllegalStateException(\"Error parsing Docker context metadata file '\" + metaPath + \"'\", ex);\n\t\t}\n\t}\n\n\tprivate static String asHash(String currentContext) {\n\t\ttry {\n\t\t\tMessageDigest digest = MessageDigest.getInstance(\"SHA-256\");\n\t\t\tbyte[] hash = digest.digest(currentContext.getBytes(StandardCharsets.UTF_8));\n\t\t\treturn HexFormat.of().formatHex(hash);","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/spring-projects/spring-boot/blob/5b2dbdbb8be64415eb6552f81ff7c449c8d251e6/buildpack/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/configuration/DockerConfigurationMetadata.java#L118-L154","documentation":"Error \"Docker context '${currentContext}' does not exist\" thrown in spring-projects/spring-boot.","triggerScenarios":"Thrown at buildpack/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/configuration/DockerConfigurationMetadata.java:136 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"5b2dbdbb8be64415eb6552f81ff7c449c8d251e6","analyzedAt":"2026-08-04T18:53:14.967Z","schemaVersion":2}