{"record":{"id":"ea13697765379448","repo":"spinnaker/spinnaker","slug":"artifact-failed-to-be-retrieved-bucket-s-ref-s","errorCode":null,"errorMessage":"artifact failed to be retrieved: bucket=%s ref=%s: %s","messagePattern":"artifact failed to be retrieved: bucket=(.+?) ref=(.+?): (.+?)","errorType":"http","errorClass":"ResponseStatusException","httpStatus":null,"severity":"error","filePath":"kork/kork-artifacts/src/main/java/com/netflix/spinnaker/kork/artifacts/artifactstore/s3/S3ArtifactStoreGetter.java","lineNumber":87,"sourceCode":"\n    try {\n      ResponseBytes<GetObjectResponse> resp = s3Client.getObjectAsBytes(request);\n      Artifact.ArtifactBuilder builder =\n          Artifact.builder()\n              .type(ArtifactTypes.REMOTE_BASE64.getMimeType())\n              .reference(Base64.getEncoder().encodeToString(resp.asByteArray()));\n\n      if (decorators == null) {\n        return builder.build();\n      }\n\n      for (ArtifactDecorator decorator : decorators) {\n        builder = decorator.decorate(builder);\n      }\n\n      return builder.build();\n    } catch (SdkServiceException e) {\n      throw new ResponseStatusException(e.statusCode(), getErrorMessage(uri, e), e);\n    } catch (Exception e) {\n      throw new RuntimeException(getErrorMessage(uri, e), e);\n    }\n  }\n\n  private String getErrorMessage(ArtifactReferenceURI uri, Exception e) {\n    return String.format(\n        \"artifact failed to be retrieved: bucket=%s ref=%s: %s\", this.bucket, uri, e.getMessage());\n  }\n\n  /**\n   * hasAuthorization will ensure that the user has proper permissions for retrieving the stored\n   * artifact\n   *\n   * @throws AuthenticationServiceException when user does not have correct permissions\n   */\n  private void hasAuthorization(ArtifactReferenceURI uri, String userId) {\n    GetObjectTaggingRequest request =","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/spinnaker/spinnaker/blob/1d4a5d0f6d10d0232b1af077decd559b68a94a5e/kork/kork-artifacts/src/main/java/com/netflix/spinnaker/kork/artifacts/artifactstore/s3/S3ArtifactStoreGetter.java#L69-L105","documentation":"S3ArtifactStoreGetter.get downloads a stored artifact from S3 and wraps any failure that is NOT an AWS SDK service exception in a RuntimeException whose message is formatted by getErrorMessage as \"artifact failed to be retrieved: bucket=%s ref=%s: %s\". This is the generic-failure path: non-SDK errors such as local decoding/processing problems or unexpected runtime exceptions while resolving the artifact reference.","triggerScenarios":"Calling get() (via the artifact endpoint) when reading/building the artifact fails with a non-SdkServiceException — e.g. an IOException or NullPointerException while processing the downloaded object, or a client-level (non-service) SDK failure.","commonSituations":"Corrupt or unexpectedly formatted S3 objects, credential-provider chain failures that surface as generic exceptions, or bugs in registered ArtifactDecorators.","solutions":["Inspect the wrapped cause (getCause()) — the message's trailing %s contains the underlying error text.","Verify the S3 bucket and object referenced by the artifact URI exist and are readable; check AWS credentials/region configuration.","If the object exists but is malformed, re-publish the artifact via S3ArtifactStoreStorer so a valid reference is stored."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Pre-check the reference URI and configured bucket before fetching\nURI.create(ref); // throws early on malformed URIs","typeGuard":null,"tryCatchPattern":"try {\n  byte[] data = artifactStoreGetter.get(uri);\n} catch (RuntimeException e) {\n  log.error(\"artifact retrieval failed for {}: {}\", uri, e.getCause(), e);\n  throw new ArtifactResolutionException(uri, e.getCause());\n}","preventionTips":["Always inspect getCause() — the RuntimeException wraps the real failure.","Verify S3 credentials/region config at service startup with a canary read.","Monitor decorator code paths — a throwing ArtifactDecorator surfaces here."],"tags":["s3","aws","artifacts","retrieval"],"backgroundTag":"file-read-failed","analyzedSha":"1d4a5d0f6d10d0232b1af077decd559b68a94a5e","analyzedAt":"2026-09-10T14:13:07.222Z","contentChangedAt":"2026-09-10T14:13:07.222Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}