#12548·seatunnel

[Improve][CLI] Treat unresolved ${ENV} placeholders as warnings during generation/check, errors only at /run

Author: det101Created Sep 29, 2026Updated Sep 29, 2026

Search before asking

  • I had searched in the feature and found no similar feature requirement.

Description

SeaTunnel CLI encourages credential placeholders such as ${MYSQL_USER} / ${MYSQL_PASSWORD} in generated HOCON (skills, golden examples, and security guidance all recommend this).

However, validate_hocon() currently treats any ${VAR} that is not present in the current process environment as a hard ERROR, which makes the whole result INVALID.

That creates a contradiction:

  1. Generation path tells the model to emit ${ENV} placeholders (good for security).
  2. Local validation immediately fails if the user has not exported those variables in the CLI shell yet.
  3. The agent validator/fix loop then retries uselessly, and /check reports FAIL even when the config structure is fine.

Observed /check output:

[1] Local validation: FAIL
    INVALID
ERROR: Unresolved environment variables: MYSQL_PASSWORD, MYSQL_USER. Set them before running: export MYSQL_PASSWORD=<value>

Proposal — severity by lifecycle stage:

Stage Unset ${ENV} (non-engine-template vars) Severity
Config generation / LLM validator loop Placeholder is intentional WARNING (do not mark INVALID)
/check (local structure check) Config OK, not runnable yet WARNING (list missing var names)
/run (or strict pre-execution gate) Job is about to connect ERROR (block execution)

Implementation sketch:

  • Keep engine template exemptions (${now}, ${uuid}, …) as today.
  • Downgrade “unset env placeholder” from errors → warnings in default validate_hocon.
  • Add a strict path used by /run (e.g. validate_hocon(..., strict_env=True)) that still fails hard when required vars are missing.
  • Optionally tighten the LLM validator system prompt so ${ENV} placeholders are not treated as FAIL by themselves.
  • Do not store secret values in config.json; logs may show variable names only.

Usage Scenario

  • User generates a MySQL → Console/JDBC job with placeholders, without exporting DB credentials in the current shell.
  • Expected: config is accepted as valid (with a clear warning to export ... before /run).
  • Today: local validation INVALID, generation fix loop / /check fail for the wrong reason.

Related Issues

  • Related diagnostics: #12544 / PR #12545 (--debug pipeline tracing) — helps surface this failure, but does not change severity policy.
  • This issue is specifically about validation severity for unresolved env placeholders.

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct