windmill-labs/windmill · error · ArgumentError

Invalid argument or block

Error message

Invalid argument or block

What it means

Raised while prepare writes inline.rb for Ruby jobs — the GemfileProxy that emulates bundler/inline rejects argument shapes it does not support (e.g. source called without a string, or a block form the proxy does not forward). It fires during job preparation, before any gem is installed, so the failure is about the script's Gemfile DSL usage.

Source

Thrown at backend/windmill-worker/src/ruby_executor.rs:149

        // Create inline.rb for dependency management (bundler/inline compatibility)
        File::create(format!("{}/inline.rb", &mini_wm_path))
            .await?
            .write_all(&wrap(
        r#"
class GemfileProxy
  def initialize
    @gem_calls = []
  end

  def source(arg = nil, &block)
    if arg.is_a?(String) && block_given?
        # Handle the case where the argument is a string and a block is given
        gemfile(&block)
    elsif arg.is_a?(String)
        # Handle the case where the argument is a string and no block is given
        # Do nothing in this case
    else
        raise ArgumentError, "Invalid argument or block"
    end
  end

  def group(*args, **kwargs)
    # Handle group calls if needed
  end

  def ruby(*args, **kwargs)
    warn "Custom Ruby runtime specifications (engine, engine_version, patchlevel) are not supported in this environment. Using system ruby"
  end

  def gem(name, version = nil, require: nil, **kwargs)
      @gem_calls << { name: name, version: version, require: require, kwargs: kwargs }

      case require
      when false
        # Skip requiring
      when nil, true

View on GitHub (pinned to e474e8803c)

Solutions

  1. Use plain string sources in the gemfile block, e.g. source 'https://rubygems.org'
  2. Avoid bundler DSL forms the inline proxy does not forward (conditional sources, options blocks)
  3. Declare gems with explicit versions and rely on Windmill's dependency management
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at backend/windmill-worker/src/ruby_executor.rs:149 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/8583d0cd838962bd. Report an issue: GitHub.