windmill-labs/windmill · error · Error

result.substring(__ERR_PREFIX.length)

Error message

result.substring(__ERR_PREFIX.length)

What it means

Ruby dependencies whose resolved source is a GIT repository are rejected. Windmill's ruby proxy only supports GEM-type remotes, so a dependency spec pointing at git (gem 'x', git: '...') throws this error during install.

Source

Thrown at backend/windmill-jseval/src/lib.rs:622

                    .get_resource_value_interpolated::<serde_json::Value>(&path, None)
                    .await
                {
                    Ok(value) => {
                        serde_json::to_string(&value).unwrap_or_else(|_| "null".to_string())
                    }
                    Err(e) => format!("{}{}", ERR_PREFIX, e),
                }
            }
        }))),
    )?;

    let wrapper_code = r#"
        const __ERR_PREFIX = '\x00__WINDMILL_ERR__\x00';

        async function variable(path) {
            const result = await __fetchVariable(path);
            if (typeof result === 'string' && result.startsWith(__ERR_PREFIX)) {
                throw new Error(result.substring(__ERR_PREFIX.length));
            }
            return result;
        }

        async function resource(path) {
            const result = await __fetchResource(path);
            if (typeof result === 'string' && result.startsWith(__ERR_PREFIX)) {
                throw new Error(result.substring(__ERR_PREFIX.length));
            }
            return JSON.parse(result);
        }
    "#;

    ctx.eval::<(), _>(wrapper_code)
        .catch(ctx)
        .map_err(quickjs_error_to_anyhow)?;

    Ok(())

View on GitHub (pinned to e474e8803c)

Solutions

  1. Publish the gem to a gem server (internal Gemfury/Artifactory/Gem in a Box) and depend on it as a normal gem source
  2. Configure that gem server in Windmill instance settings and reference it via a plain source URL
  3. Use a released version of the gem from rubygems.org instead of the git checkout
  4. If the fix is only on a branch, vendor the change into a locally published gem version

Example fix

// before
gem 'my_gem', git: 'https://github.com/acme/my_gem.git'
// after
gem 'my_gem', '1.2.3', source: 'https://gems.example.com'
Defensive patterns

Strategy: validation

Validate before calling

function validateNoGitSources(gemfile) {
  if (/^\s*gem\s+['"][^'"]+['"],?\s*(git:|github:)/m.test(gemfile)) {
    throw new Error('git-sourced gems are not supported; publish to a gem server and reference it');
  }
}

Try / catch

try {
  await runRubyJob(gemfile);
} catch (e) {
  if (/GIT is not supported/.test(e.message)) {
    throw new Error('Replace git: gem sources with a published gem version from a supported gem server');
  }
  throw e;
}

Prevention

When it happens

Trigger: A Gemfile declares a gem with a git: source (or :github:) and the lockfile resolves FinalSource::GIT; also when a gem's source URL scheme parses to a git remote.

Common situations: Copying Gemfiles that use git-sourced gems or unreleased branches; depending on a fork only available on GitHub; enterprise setups where internal gems live in git repos.

Related errors


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