{"record":{"id":"b2d63fc0b9a53dab","repo":"nathanmarz/storm","slug":"host-is-not-set","errorCode":null,"errorMessage":"host is not set","messagePattern":"host is not set","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"storm-core/src/jvm/backtype/storm/security/auth/ThriftClient.java","lineNumber":51,"sourceCode":"    private static final Logger LOG = LoggerFactory.getLogger(ThriftClient.class);\n    private TTransport _transport;\n    protected TProtocol _protocol;\n\n    public ThriftClient(Map storm_conf, String host, int port) throws TTransportException {\n        this(storm_conf, host, port, null);\n    }\n\n    public ThriftClient(Map storm_conf, String host, int port, Integer timeout) throws TTransportException {\n        try {\n            //locate login configuration \n            Configuration login_conf = AuthUtils.GetConfiguration(storm_conf);\n\n            //construct a transport plugin\n            ITransportPlugin  transportPlugin = AuthUtils.GetTransportPlugin(storm_conf, login_conf);\n\n            //create a socket with server\n            if(host==null) {\n                throw new IllegalArgumentException(\"host is not set\");\n            }\n            if(port<=0) {\n                throw new IllegalArgumentException(\"invalid port: \"+port);\n            }            \n            TSocket socket = new TSocket(host, port);\n            if(timeout!=null) {\n                socket.setTimeout(timeout);\n            }\n            final TTransport underlyingTransport = socket;\n\n            //establish client-server transport via plugin\n            _transport =  transportPlugin.connect(underlyingTransport, host); \n        } catch (IOException ex) {\n            throw new RuntimeException(ex);\n        }\n        _protocol = null;\n        if (_transport != null)\n            _protocol = new  TBinaryProtocol(_transport);","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/nathanmarz/storm/blob/cdb116e942666973bc4eaa0df098d5bab82739e7/storm-core/src/jvm/backtype/storm/security/auth/ThriftClient.java#L33-L69","documentation":"The ThriftClient constructor validates its arguments before opening a socket: if the `host` parameter is null it throws IllegalArgumentException(\"host is not set\"). Storm's SASL thrift client cannot connect without a target hostname, so it fails fast in the constructor rather than deep inside Thrift's transport layer.","triggerScenarios":"Constructing new ThriftClient(storm_conf, login_conf, null, port, timeout, asUser) — e.g. host read from config/SupervisorToNimbus settings that were never set, or a null returned from a lookup (nimbus host missing from cluster config on a client/UI/worker).","commonSituations":"storm.yaml missing nimbus host config on a client machine; UI or drpc client launched with unset host variable; programmatic clients passing a config value that is absent so conf.get() returns null.","solutions":["Set the nimbus/host configuration value in storm.yaml (e.g. nimbus.host) on the machine running the client.","Pass a non-null host string explicitly to the ThriftClient constructor.","Check that the config key you read the host from actually exists (conf.get returns null for missing keys).","For programmatic use, resolve host from Config.NIMBUS_HOST or environment before constructing the client."],"exampleFix":"// before\nString host = (String) conf.get(\"nimbus.host.custom\"); // typo -> null\nThriftClient client = new ThriftClient(conf, loginConf, host, 6627, null, null);\n// after\nString host = (String) conf.get(Config.NIMBUS_HOST);\nif (host == null) throw new IllegalArgumentException(\"nimbus host must be configured\");\nThriftClient client = new ThriftClient(conf, loginConf, host, 6627, null, null);","handlingStrategy":"validation","validationCode":"// Java\nString host = (String) conf.get(Config.NIMBUS_HOST);\nObjects.requireNonNull(host, \"host is not set; configure \" + Config.NIMBUS_HOST + \" in storm.yaml\");\nThriftClient client = new ThriftClient(conf, loginConf, host, port, timeout, asUser);","typeGuard":"boolean hasHost(Map<String, Object> conf) {\n    Object h = conf.get(Config.NIMBUS_HOST);\n    return h instanceof String && !((String) h).isEmpty();\n}","tryCatchPattern":"try {\n    client = new ThriftClient(conf, loginConf, host, port, timeout, asUser);\n} catch (IllegalArgumentException e) {\n    if (\"host is not set\".equals(e.getMessage())) {\n        LOG.error(\"Nimbus host is not configured; set nimbus.host in storm.yaml\");\n    }\n    throw e;\n}","preventionTips":["Verify nimbus.host exists in storm.yaml on client machines.","Use Config.NIMBUS_HOST constant instead of hand-typed config keys.","Null-check config lookups before passing them into the constructor."],"tags":["thrift","client","invalid-argument"],"backgroundTag":"missing-required-argument","analyzedSha":"cdb116e942666973bc4eaa0df098d5bab82739e7","analyzedAt":"2026-09-12T14:30:00.714Z","contentChangedAt":"2026-09-12T14:30:00.714Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}