{"record":{"id":"1f088f4667fde502","repo":"pentaho/pentaho-kettle","slug":"googleanalytics-error-unabletoreadfromxml","errorCode":null,"errorMessage":"GoogleAnalytics.Error.UnableToReadFromXML","messagePattern":"GoogleAnalytics\\.Error\\.UnableToReadFromXML","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"plugins/google-analytics/core/src/main/java/org/pentaho/di/trans/steps/googleanalytics/GaInputStepMeta.java","lineNumber":516,"sourceCode":"      allocate( nrFields );\n\n      for ( int i = 0; i < nrFields; i++ ) {\n        Node knode = XMLHandler.getSubNodeByNr( stepnode, \"feedField\", i );\n\n        feedFieldType[ i ] = XMLHandler.getTagValue( knode, \"feedFieldType\" );\n        feedField[ i ] = XMLHandler.getTagValue( knode, \"feedField\" );\n        outputField[ i ] = XMLHandler.getTagValue( knode, \"outField\" );\n        outputType[ i ] = ValueMetaFactory.getIdForValueMeta( XMLHandler.getTagValue( knode, \"type\" ) );\n        conversionMask[ i ] = XMLHandler.getTagValue( knode, \"conversionMask\" );\n\n        if ( outputType[ i ] < 0 ) {\n          outputType[ i ] = ValueMetaInterface.TYPE_STRING;\n        }\n\n      }\n\n    } catch ( Exception e ) {\n      throw new KettleXMLException( BaseMessages.getString( PKG, \"GoogleAnalytics.Error.UnableToReadFromXML\" ), e );\n    }\n\n  }\n\n  @Override\n  public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases )\n    throws KettleException {\n    try {\n      String user = rep.getStepAttributeString( id_step, \"user\" );\n      String pass = rep.getStepAttributeString( id_step, \"pass\" );\n      String apiKey = rep.getStepAttributeString( id_step, \"apiKey\" );\n\n      oauthServiceAccount = rep.getStepAttributeString( id_step, \"oauthServiceAccount\" );\n      oauthKeyFile = rep.getStepAttributeString( id_step, \"oauthKeyFile\" );\n\n      // Are we loading a legacy transformation?\n      if ( ( user != null || pass != null || apiKey != null )\n        && ( oauthServiceAccount == null && oauthKeyFile == null ) ) {","sourceCodeStart":498,"sourceCodeEnd":534,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/google-analytics/core/src/main/java/org/pentaho/di/trans/steps/googleanalytics/GaInputStepMeta.java#L498-L534","documentation":"GaInputStepMeta's XML-loading constructor (loadXML path) wraps any exception occurring while parsing the step's Google Analytics settings from the transformation XML into a KettleXMLException with the localized 'GoogleAnalytics.Error.UnableToReadFromXML' message. Thrown because malformed or incompatible XML would leave the step metadata unparsable.","triggerScenarios":"Loading a .ktr whose <step> node for the Google Analytics input contains malformed or unexpected XML — e.g. invalid date fields, numeric conversion failures while parsing ga fields, or attributes written by a different plugin version.","commonSituations":"Opening a transformation authored in a newer/older Pentaho version with changed XML fields; hand-edited .ktr files with a corrupted step node; copy-pasting step XML between transformations with mismatched attributes.","solutions":["Inspect the nested cause (e.getCause()) — usually a NumberFormatException or NullPointerException on a specific XML attribute.","Open the .ktr in a text editor and fix or remove the malformed <step> node for the GoogleAnalytics step.","Re-create the Google Analytics step in the same Pentaho version that will run the transformation.","Ensure the google-analytics plugin version matches the transformation's authoring version."],"exampleFix":"// before: corrupted numeric attribute in XML causing parse failure\n// <ga_gaField>...<conversionMask>abc</conversionMask>\n\n// after: correct the attribute value\n// <ga_gaField>...<conversionMask>yyyy-MM-dd</conversionMask>","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  transMeta = new TransMeta( fileName, metaStore );\n} catch ( KettleXMLException e ) {\n  log.error( \"XML load failed: \" + e.getMessage(), e.getCause() );\n  // inspect the failing <step> node in the .ktr\n}","preventionTips":["Never hand-edit .ktr XML for GA steps","Use the same Pentaho/plugin version to author and run transformations","Check e.getCause() for the exact attribute that failed to parse"],"tags":["xml","metadata-read","google-analytics"],"backgroundTag":"json-parse-error","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"}