{"record":{"id":"22e600d4523e5f4d","repo":"pentaho/pentaho-kettle","slug":"status","errorCode":null,"errorMessage":" status:","messagePattern":" status:","errorType":"exception","errorClass":"RepositoryClientException","httpStatus":null,"severity":"error","filePath":"plugins/repo-vfs/repo-vfs-ws/src/main/java/org/pentaho/di/plugins/repovfs/ws/repo/RepositoryClient.java","lineNumber":289,"sourceCode":"    return \":\" + Stream.of( path ).map( Encode::forUriComponent ).collect( Collectors.joining( \":\" ) );\n  }\n\n  private void throwOnError( final Response response ) throws RepositoryClientException {\n    final int status = response.getStatus();\n\n    if ( status != HttpStatus.SC_OK ) {\n      if ( status == HttpStatus.SC_MOVED_TEMPORARILY\n        || status == HttpStatus.SC_FORBIDDEN\n        || status == HttpStatus.SC_UNAUTHORIZED ) {\n        throw new RepositoryClientException( \"Auth error\" );\n      } else {\n        String errMsg;\n        try {\n          errMsg = response.readEntity( String.class );\n        } catch ( Exception e ) {\n          errMsg = \"Unable to get error response entity\";\n        }\n        throw new RepositoryClientException( errMsg + \" status:\" + status );\n      }\n    }\n  }\n\n  private static String encodePath( String path ) {\n    String repoEncoded = RepositoryPathEncoder.encodeRepositoryPath( path );\n    return Encode.forUriComponent( repoEncoded );\n  }\n}\n","sourceCodeStart":271,"sourceCodeEnd":299,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/repo-vfs/repo-vfs-ws/src/main/java/org/pentaho/di/plugins/repovfs/ws/repo/RepositoryClient.java#L271-L299","documentation":"RepositoryClient.throwOnError reads the HTTP error body from a Pentaho repository REST response and wraps it in a RepositoryClientException containing the raw body plus the status code (e.g. '... status:404'). It is thrown whenever the repo-vfs web-service client receives a non-success HTTP response on writeData, moveTo, rename, or getFileInfo. It signals that the server rejected the repository operation at the HTTP level.","triggerScenarios":"Calling writeData, moveTo, rename, or getFileInfo via RepositoryClient when the server returns a non-2xx status (401 unauthenticated, 404 file not found, 409 conflict, 500 server error). Common when the repository path was deleted or renamed by another client between calls, or when the session cookie expired.","commonSituations":"Expired JCR session mid-operation; two Spoon instances editing the same file causing 409 on moveTo/rename; proxy or firewall returning HTML error pages that fail readEntity and yield 'Unable to get error response entity'; wrong repository base URL.","solutions":["Read the status code and body in the exception message and address the underlying HTTP cause (401 => re-authenticate/reconnect the repository; 404 => refresh the VFS cache and re-check file existence)","Reconnect to the repository if the status indicates an expired session (401/403) and retry the operation","Check whether another client moved/deleted the target file; refresh the file object before retrying","Verify repository base URL and network/proxy configuration if the body is empty or unparseable"],"exampleFix":"// before\nclient.getFileInfo( path ); // may throw RepositoryClientException '... status:404'\n// after\ntry {\n  client.getFileInfo( path );\n} catch ( RepositoryClientException e ) {\n  if ( e.getMessage() != null && e.getMessage().endsWith( \"status:404\" ) ) {\n    fileObject.refresh(); // re-check existence before proceeding\n  } else {\n    throw e;\n  }\n}","handlingStrategy":"try-catch","validationCode":"// before the call\nif ( !fileObject.exists() ) { fileObject.refresh(); if ( !fileObject.exists() ) return; }\nif ( repository == null || !repository.isConnected() ) { reconnectRepository(); }","typeGuard":"boolean isHttpStatusFailure( RepositoryClientException e ) {\n  String m = e.getMessage();\n  return m != null && m.matches( \".* status:\\\\d{3}$\" );\n}","tryCatchPattern":"try {\n  client.writeData( name, data );\n} catch ( RepositoryClientException e ) {\n  if ( e.getMessage() != null && e.getMessage().endsWith( \"status:401\" ) ) {\n    reconnectAndRetry();\n  } else {\n    throw e;\n  }\n}","preventionTips":["Check repository connectivity before long operation batches","Refresh FileObjects before write/move operations in long-lived sessions","Handle 401/403 statuses by re-authenticating instead of surfacing raw errors","Avoid concurrent modification of the same repository files from multiple clients"],"tags":["http","repository","vfs","rest-client"],"backgroundTag":"http-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"}