{"record":{"id":"8583d0cd838962bd","repo":"windmill-labs/windmill","slug":"invalid-argument-or-block","errorCode":null,"errorMessage":"Invalid argument or block","messagePattern":"Invalid argument or block","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"backend/windmill-worker/src/ruby_executor.rs","lineNumber":149,"sourceCode":"        // Create inline.rb for dependency management (bundler/inline compatibility)\n        File::create(format!(\"{}/inline.rb\", &mini_wm_path))\n            .await?\n            .write_all(&wrap(\n        r#\"\nclass GemfileProxy\n  def initialize\n    @gem_calls = []\n  end\n\n  def source(arg = nil, &block)\n    if arg.is_a?(String) && block_given?\n        # Handle the case where the argument is a string and a block is given\n        gemfile(&block)\n    elsif arg.is_a?(String)\n        # Handle the case where the argument is a string and no block is given\n        # Do nothing in this case\n    else\n        raise ArgumentError, \"Invalid argument or block\"\n    end\n  end\n\n  def group(*args, **kwargs)\n    # Handle group calls if needed\n  end\n\n  def ruby(*args, **kwargs)\n    warn \"Custom Ruby runtime specifications (engine, engine_version, patchlevel) are not supported in this environment. Using system ruby\"\n  end\n\n  def gem(name, version = nil, require: nil, **kwargs)\n      @gem_calls << { name: name, version: version, require: require, kwargs: kwargs }\n\n      case require\n      when false\n        # Skip requiring\n      when nil, true","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/windmill-worker/src/ruby_executor.rs#L131-L167","documentation":"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.","triggerScenarios":"Thrown at backend/windmill-worker/src/ruby_executor.rs:149 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use plain string sources in the gemfile block, e.g. source 'https://rubygems.org'","Avoid bundler DSL forms the inline proxy does not forward (conditional sources, options blocks)","Declare gems with explicit versions and rely on Windmill's dependency management"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}