nathanmarz/storm · error · IllegalArgumentException

host is not set

Error message

host is not set

What it means

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.

Solutions

  1. Set the nimbus/host configuration value in storm.yaml (e.g. nimbus.host) on the machine running the client.
  2. Pass a non-null host string explicitly to the ThriftClient constructor.
  3. Check that the config key you read the host from actually exists (conf.get returns null for missing keys).
  4. For programmatic use, resolve host from Config.NIMBUS_HOST or environment before constructing the client.

Example fix

// before
String host = (String) conf.get("nimbus.host.custom"); // typo -> null
ThriftClient client = new ThriftClient(conf, loginConf, host, 6627, null, null);
// after
String host = (String) conf.get(Config.NIMBUS_HOST);
if (host == null) throw new IllegalArgumentException("nimbus host must be configured");
ThriftClient client = new ThriftClient(conf, loginConf, host, 6627, null, null);
Defensive patterns

Strategy: validation

Validate before calling

// Java
String host = (String) conf.get(Config.NIMBUS_HOST);
Objects.requireNonNull(host, "host is not set; configure " + Config.NIMBUS_HOST + " in storm.yaml");
ThriftClient client = new ThriftClient(conf, loginConf, host, port, timeout, asUser);

Type guard

boolean hasHost(Map<String, Object> conf) {
    Object h = conf.get(Config.NIMBUS_HOST);
    return h instanceof String && !((String) h).isEmpty();
}

Try / catch

try {
    client = new ThriftClient(conf, loginConf, host, port, timeout, asUser);
} catch (IllegalArgumentException e) {
    if ("host is not set".equals(e.getMessage())) {
        LOG.error("Nimbus host is not configured; set nimbus.host in storm.yaml");
    }
    throw e;
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of nathanmarz/storm@cdb116e942 (2026-09-12). Data as JSON: /api/errors/b2d63fc0b9a53dab. Report an issue: GitHub.

Appendix: source

Thrown at storm-core/src/jvm/backtype/storm/security/auth/ThriftClient.java:51

    private static final Logger LOG = LoggerFactory.getLogger(ThriftClient.class);
    private TTransport _transport;
    protected TProtocol _protocol;

    public ThriftClient(Map storm_conf, String host, int port) throws TTransportException {
        this(storm_conf, host, port, null);
    }

    public ThriftClient(Map storm_conf, String host, int port, Integer timeout) throws TTransportException {
        try {
            //locate login configuration 
            Configuration login_conf = AuthUtils.GetConfiguration(storm_conf);

            //construct a transport plugin
            ITransportPlugin  transportPlugin = AuthUtils.GetTransportPlugin(storm_conf, login_conf);

            //create a socket with server
            if(host==null) {
                throw new IllegalArgumentException("host is not set");
            }
            if(port<=0) {
                throw new IllegalArgumentException("invalid port: "+port);
            }            
            TSocket socket = new TSocket(host, port);
            if(timeout!=null) {
                socket.setTimeout(timeout);
            }
            final TTransport underlyingTransport = socket;

            //establish client-server transport via plugin
            _transport =  transportPlugin.connect(underlyingTransport, host); 
        } catch (IOException ex) {
            throw new RuntimeException(ex);
        }
        _protocol = null;
        if (_transport != null)
            _protocol = new  TBinaryProtocol(_transport);

View on GitHub (pinned to cdb116e942)