{"record":{"id":"b92452fb1777ca1d","repo":"pentaho/pentaho-kettle","slug":"invalid-ip-address","errorCode":null,"errorMessage":"Invalid IP address","messagePattern":"Invalid IP address","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/snmptrap/JobEntrySNMPTrap.java","lineNumber":422,"sourceCode":"      UdpAddress udpAddress = new UdpAddress( InetAddress.getByName( servername ), nrPort );\n      ResponseEvent response = null;\n      if ( targettype.equals( target_type_Code[0] ) ) {\n        // Community target\n        String community = environmentSubstitute( comString );\n\n        CommunityTarget target = new CommunityTarget();\n        PDUv1 pdu1 = new PDUv1();\n        transMap.listen();\n\n        target.setCommunity( new OctetString( community ) );\n        target.setVersion( SnmpConstants.version1 );\n        target.setAddress( udpAddress );\n        if ( target.getAddress().isValid() ) {\n          if ( log.isDebug() ) {\n            logDebug( \"Valid IP address\" );\n          }\n        } else {\n          throw new KettleException( \"Invalid IP address\" );\n        }\n        target.setRetries( retry );\n        target.setTimeout( timeOut );\n\n        // create the PDU\n        pdu1.setGenericTrap( 6 );\n        pdu1.setSpecificTrap( PDUv1.ENTERPRISE_SPECIFIC );\n        pdu1.setEnterprise( new OID( Oid ) );\n        pdu1.add( new VariableBinding( new OID( Oid ), new OctetString( messageString ) ) );\n\n        response = snmp.send( pdu1, target );\n\n      } else {\n        // User target\n        String userName = environmentSubstitute( user );\n        String passPhrase = environmentSubstitute( passphrase );\n        String engineID = environmentSubstitute( engineid );\n","sourceCodeStart":404,"sourceCodeEnd":440,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/snmptrap/JobEntrySNMPTrap.java#L404-L440","documentation":"In JobEntrySNMPTrap.execute, when targettype is SNMPv1/v2c, the UDP target address built from the configured serverName is validated with SnmpTarget.getAddress().isValid(); if invalid, KettleException 'Invalid IP address' is thrown. The configured host could not be resolved to a usable SNMP transport address.","triggerScenarios":"execute() with community-based trap target where the serverName field is an unresolvable hostname, an invalid IP string (e.g. '256.1.1.1', empty, or containing protocol prefix/whitespace), or a name requiring DNS that fails.","commonSituations":"Typo in host name; DNS not resolving in the job's environment (container without DNS); host entered as 'http://host' or 'host:port' instead of bare host; IPv6 string given where only IPv4 is supported by the target construction.","solutions":["Enter a bare, resolvable hostname or valid IP (no scheme/port) in the Server name field and test with ping/nslookup.","Use an explicit IP address to bypass DNS in environments without name resolution.","Check /etc/hosts or container DNS configuration on the machine running the job.","Log/print the targetserver value in a prior step to confirm what the entry actually receives (e.g. from a variable)."],"exampleFix":"// before: variable contains 'http://192.168.1.10' -> invalid\nsetTargetServer(\"http://192.168.1.10\");\n// after: bare host or IP\nsetTargetServer(\"192.168.1.10\");","handlingStrategy":"validation","validationCode":"String host = getTargetServer();\nif (host == null || host.trim().isEmpty() || host.contains(\"://\")) {\n  throw new IllegalArgumentException(\"Server name must be a bare hostname or IP: \" + host);\n}\nInetAddress.getByName(host.trim()); // throws UnknownHostException if unresolvable","typeGuard":null,"tryCatchPattern":"try {\n  result = jobEntry.execute(prevResult, nr);\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"Invalid IP address\")) {\n    logError(\"Check SNMP server name/port config: \" + getTargetServer());\n  }\n}","preventionTips":["Enter bare hostnames or IPs - no scheme, no embedded port.","Verify DNS resolution on the machine that runs the job.","Prefer literal IPs in containers/VMs without reliable DNS.","Test connectivity with ping/telnet before scheduling."],"tags":["snmp","network","ip-address","configuration"],"backgroundTag":"invalid-url-format","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"}