{"record":{"id":"9e2cb1ff61a9d071","repo":"apple/pkl","slug":"e-getmessage-9e2cb1","errorCode":null,"errorMessage":"e.getMessage()","messagePattern":"e\\.getMessage\\(\\)","errorType":"exception","errorClass":"PklException","httpStatus":null,"severity":"error","filePath":"pkl-core/src/main/java/org/pkl/core/project/ProjectPackager.java","lineNumber":250,"sourceCode":"                computedChecksum,\n                receivedChecksum));\n      }\n    } catch (PackageLoadError e) {\n      if (e.getMessageName().equals(\"badHttpStatusCode\")) {\n        var firstArg = e.getArguments()[0];\n        assert firstArg != null;\n        var statusCode = (int) firstArg;\n        if (statusCode == 404) {\n          return;\n        } else {\n          throw new PklException(\n              ErrorMessages.create(\n                  \"unableToAccessPublishedPackage\", pkg.name(), pkg.packageZipUrl(), statusCode));\n        }\n      }\n      throw e;\n    } catch (SecurityManagerException e) {\n      throw new PklException(e.getMessage());\n    }\n  }\n\n  private String createDependencyMetadataAndComputeChecksum(\n      Project project, Package pkg, Path metadataFile, String zipFileChecksum) throws IOException {\n    var dependencyMetadata = createDependencyMetadata(project, pkg, zipFileChecksum);\n    try (var fos = newDigestOutputStream(Files.newOutputStream((metadataFile)))) {\n      dependencyMetadata.writeTo(fos);\n      return ByteArrayUtils.toHex(fos.getMessageDigest().digest());\n    }\n  }\n\n  /** If the project has a local dependency, package it as well, so we can record its checksum. */\n  private Map<String, RemoteDependency> buildDependencies(Project project) throws IOException {\n    try {\n      var ret =\n          new HashMap<String, RemoteDependency>(\n              project.getDependencies().localDependencies().size()","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/apple/pkl/blob/f3efcbfc9b60d30053b0536d664948d7aa1b8673/pkl-core/src/main/java/org/pkl/core/project/ProjectPackager.java#L232-L268","documentation":"Wraps a SecurityManagerException raised while checking the already-published package into a PklException with the raw exception message. This happens when the registry access check itself fails at a lower level (e.g. connection failure) rather than returning an HTTP status code.","triggerScenarios":"During checkAlreadyPublishedPackage, the SecurityManager-based fetch of the published package zip throws SecurityManagerException — e.g. network connection failure, DNS failure, or TLS error.","commonSituations":"No network access or offline CI machine; DNS misconfiguration; corporate TLS-intercepting proxy breaking certificate validation; wrong registry hostname.","solutions":["Fix network connectivity / DNS to the registry host and retry the package command","Check proxy settings (https_proxy) and TLS trust store if behind a corporate proxy","Verify the registry URL in PklProject resolves correctly"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// preflight connectivity\nnslookup <registry-host> && curl -sI https://<registry-host> | head -1","typeGuard":null,"tryCatchPattern":"catch (PklException e) { if (isNetworkMessage(e.getMessage())) { Thread.sleep(retryDelay); retryPackaging(); } else throw e; }","preventionTips":["Run packaging with network access guaranteed (no air-gapped CI without proxy config)","Configure proxy/TLS settings explicitly in constrained environments","Pin and verify registry hostnames"],"tags":["network","connection","publishing"],"backgroundTag":"network-request-failed","analyzedSha":"f3efcbfc9b60d30053b0536d664948d7aa1b8673","analyzedAt":"2026-09-08T13:10:45.570Z","contentChangedAt":"2026-09-08T13:10:45.570Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}