{"record":{"id":"225fdfa23bedb7a0","repo":"pentaho/pentaho-kettle","slug":"vfs-provider-get-type-error-225fdf","errorCode":"vfs.provider/get-type.error","errorMessage":"vfs.provider/get-type.error","messagePattern":"vfs\\.provider/get-type\\.error","errorType":"error_code","errorClass":"FileSystemException","httpStatus":null,"severity":"error","filePath":"plugins/s3-vfs/core/src/main/java/org/pentaho/s3common/S3CommonFileObject.java","lineNumber":246,"sourceCode":"\n    if ( isRootBucket() ) {\n      // cannot attach to root bucket but still need to figure out the type for exists()\n      try {\n        fileSystem.getS3Client().getBucketLocation( bucketName );\n      } catch ( AmazonS3Exception e ) {\n        if ( \"NoSuchBucket\".equals( e.getErrorCode() ) ) {\n          injectType( FileType.IMAGINARY );\n          return;\n        }\n\n        // One common case is \"403 Access Denied\", for bucket names which exist in the same region\n        // but are not of this account. This can also happen for normal files and is being handled\n        // similarly in handleAttachExceptionFallback.\n        // Any other errors should also bubble up.\n\n        // Make sure this gets printed for the user.\n        logger.error( \"Could not get information on {}\", getQualifiedName(), e );\n        throw new FileSystemException( \"vfs.provider/get-type.error\", e, getQualifiedName() );\n      }\n\n      injectType( FileType.FOLDER );\n      return;\n    }\n\n    try {\n      // 1. Is it an existing file?\n      s3ObjectMetadata = fileSystem.getS3Client().getObjectMetadata( bucketName, key );\n      injectType( getName().getType() ); // if this worked then the automatically detected type is right\n    } catch ( AmazonS3Exception e ) { // S3 object doesn't exist\n      // 2. Is it in reality a folder?\n      handleAttachException( key, bucketName );\n    } finally {\n      closeS3Object();\n    }\n  }\n","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/s3-vfs/core/src/main/java/org/pentaho/s3common/S3CommonFileObject.java#L228-L264","documentation":"S3CommonFileObject.doAttach() determines the file type. When the S3 call used to check whether the path is a bucket/key fails with anything other than 'not found'-style codes, it logs 'Could not get information on <name>' and throws FileSystemException('vfs.provider/get-type.error', cause, name). Only paths judged to be folders fall through to injectType(FOLDER).","triggerScenarios":"doAttach() when the backing S3 request (getObjectMetadata / bucket existence check) fails with AccessDenied, InvalidAccessKeyId, signature errors, timeouts, or any non-'NoSuchKey/404' error.","commonSituations":"Wrong region endpoint causing 301/403, IAM missing s3:ListBucket/s3:GetObject, expired credentials in long-running Pentaho servers, proxy blocking AWS endpoints.","solutions":["Check the logged AWS error code for the root cause.","Validate credentials and region configuration of the S3 filesystem.","Grant s3:GetObject and s3:ListBucket on the bucket to the IAM user.","Handle foreign-account buckets (they return 403, not 404) explicitly.","Add retry logic for transient 5xx errors."],"exampleFix":"// before\nthrow new FileSystemException( \"vfs.provider/get-type.error\", e, getQualifiedName() );\n// after\nif ( e instanceof AmazonServiceException && e.getStatusCode() >= 500 ) {\n  retryAttachWithBackoff();\n} else {\n  throw new FileSystemException( \"vfs.provider/get-type.error\", e, getQualifiedName() );\n}","handlingStrategy":"try-catch","validationCode":"// probe account/bucket before attach\ntry {\n  s3.getObjectMetadata( bucketName, key );\n} catch ( AmazonS3Exception e ) {\n  if ( e.getStatusCode() != 404 && !\"NoSuchKey\".equals( e.getErrorCode() ) ) {\n    throw new IllegalStateException( \"S3 attach will fail: \" + e.getErrorCode() );\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  FileObject fo = fs.resolveFile( path );\n  fo.getType();\n} catch ( FileSystemException e ) {\n  logger.debug( \"attach failed for {}\", path, e.getCause() );\n  // distinguish 403 (permissions) from 5xx (retryable)\n}","preventionTips":["Keep server clocks synced (signature skew)","Use region-aware endpoints (s3.<region>.amazonaws.com)","Grant both s3:ListBucket and s3:GetObject to the VFS credentials","Rotate credentials before expiry for long-running jobs"],"tags":["s3","vfs","attach","aws"],"backgroundTag":"api-error-response","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}