Skip to content

[Bug][Core] CLI enum arguments fail to parse under a Turkish or Azerbaijani locale #13080

Open

Description

@sharpca

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

The CLI converts enum-valued arguments with String#toUpperCase() / String#toLowerCase() without a locale before matching them against the enum constants, so the result depends on the JVM default locale. Under a Turkish or Azerbaijani locale, client upper-cases to CLİENT (dotted capital I) and sink to SİNK, which are not enum names.

Affected conversions:

Module Argument Under tr-TR
seatunnel-spark-starter-common --deploy-mode client IllegalArgumentException: No enum constant ...DeployMode.CLİENT
seatunnel-flink-starter-common --deploy-mode run-application IllegalArgumentException: No enum constant ...DeployMode.RUN_APPLİCATİON
seatunnel-flink-starter-common --target yarn-session / kubernetes-application IllegalArgumentException: No enum constant ...MasterType.YARN_SESSİON
seatunnel-starter seatunnel-connector.sh -pt sink reports "only support these options: [source, sink, transform]" although sink was passed
seatunnel-starter --metadata-export -pt sink reports "Plugin type must be one of: [source, sink, transform]"

DeployMode.from(String) has the same default-locale conversion and additionally throws a NullPointerException for a null argument.

What you expected to happen

CLI enum arguments are parsed identically under any JVM default locale.

SeaTunnel Version

dev, verified at commit fcb404cd947da03a712c4ae9ee9068744bd946a5.

SeaTunnel Config

Not configuration dependent; the failure happens while the command line arguments are parsed.

Running Command

JAVA_TOOL_OPTIONS="-Duser.language=tr -Duser.country=TR" ./bin/seatunnel.sh -m local -c config/v2.batch.config.template
# or, with the Spark starter:
JAVA_TOOL_OPTIONS="-Duser.language=tr -Duser.country=TR" ./bin/start-seatunnel-spark-3-connector-v2.sh --deploy-mode client

Error Exception

java.lang.IllegalArgumentException: No enum constant org.apache.seatunnel.common.config.DeployMode.CLİENT

Zeta or Flink or Spark Version

Not engine specific: the conversion happens in the starters that are shared by all engines.

Java or Scala Version

Not version specific, reproduced on JDK 17.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. SEZ9 commented on Nov 1, 2026

    @SEZ9
    Collaborator

    Thanks for the detailed report and the reproduction steps. Since you're willing to submit a PR, please go ahead. It would be good for the fix to cover all the conversions listed in your table (the Spark and Flink --deploy-mode / --target handling in seatunnel-spark-starter-common and seatunnel-flink-starter-common, and the -pt handling in seatunnel-starter) so the case conversion no longer depends on the JVM default locale, and to also handle the null argument case in DeployMode.from(String) that you mentioned. A unit test that runs these conversions under a Turkish default locale would help prevent a regression.

  2. sharpca commented on Nov 1, 2026

    @sharpca
    Author

    Thanks @SEZ9. I opened #13081, which covers every conversion listed in the report: the Spark and Flink --deploy-mode / --target handling in seatunnel-spark-starter-common and seatunnel-flink-starter-common, the -pt handling in seatunnel-starter (connector check and metadata export), and the null argument of DeployMode.from(String). The PR adds tests that run these conversions under a Turkish default locale, and I confirmed the new tests fail against the unpatched sources.

  3. sharpca commented on Nov 1, 2026

    @sharpca
    Author

    Thanks. #13081 covers every conversion in the table.

    • Spark --deploy-mode — SparkDeployModeConverter matches the value with Locale.ROOT
    • Flink --deploy-mode — FlinkDeployModeConverter uses Locale.ROOT
    • Flink --target — FlinkMasterTargetConverter (--master / --target) uses Locale.ROOT
    • -pt / --plugin-type in seatunnel-starter — both ConnectorCheckCommandArgs and MetadataExportCommandArgs use Locale.ROOT
    • DeployMode.from(String) — now returns Optional.empty() for a null argument instead of throwing, and lower-cases with Locale.ROOT

    The dash-to-underscore mapping is kept, so run-application and yarn-session still resolve to RUN_APPLICATION and YARN_SESSION under any locale.

    Turkish locale tests — DeployModeTest, SparkCommandArgsConverterTest, FlinkCommandArgsConverterTest and ConnectorCheckCommandArgsTest each parse the arguments with new Locale("tr", "TR") as the default locale and restore the previous default afterwards. DeployModeTest also asserts from(null) returns empty.

    One note: the workflows on #13081 are still waiting for a maintainer to approve them (action_required), so no test has run in CI yet. Everything above was verified locally on JDK 17.

  4. SEZ9 commented on Nov 2, 2026

    @SEZ9
    Collaborator

    Thanks @sharpca for the detailed breakdown. From your description, the PR addresses each item in the report — the Spark/Flink --deploy-mode and --target conversions, -pt / --plugin-type handling, and the null argument in DeployMode.from(String) — along with Turkish-locale tests that fail against the unpatched sources. That sounds like the right direction, and I'll take a closer look at the changes themselves on the PR.

    Since the workflows there haven't run yet and everything so far has been verified locally on JDK 17, could you ping here once CI has run so we can confirm the results? We can continue the detailed review on the PR and close this issue once it lands.

  5. sharpca commented on Nov 2, 2026

    @sharpca
    Author

    Thanks — since your read found nothing to change, nothing moved here: the PR head is still 3dc5920e.

    On the ping you asked for: I still cannot send it. Check-runs on that head are 0 and the workflow run remains action_required, so CI has not executed — it is waiting for a maintainer to approve the run, which a fork contributor cannot do. I will post the results in this thread as soon as it executes, and we can pick up the review on the PR at that point.

    Everything reported so far for this PR is local JDK 17 verification plus spotless:check; the git diff --check cleanliness is confirmed on the committed blobs, not in Actions.

  6. DanielLeens commented on Nov 3, 2026

    @DanielLeens
    Contributor

    Hi @sharpca, thanks for the follow-up.

    On the CI status: action_required on the Build check does not mean the run is waiting for maintainer approval. For apache/seatunnel the build for a PR runs in the contributor's fork, and the PR's Build check only reports that fork run. On #13081 the check reports "Workflow run detection failed", and sharpca/seatunnel has no workflow runs at all, so there is no gate a maintainer can approve here. The only action_required run on the apache side is Label-when-reviewed, a review-labeling workflow that does not build or test anything.

    To get CI running:

    1. Open the Actions tab of your fork and enable GitHub Actions if it shows the enable button.
    2. Select the Build workflow, click Run workflow and pick the PR branch (or push an empty commit).
    3. The PR's Build check adopts the fork run within about 15 minutes.

    One gap I found while checking the CLI paths on dev, which #13081 does not touch yet: --checkpoint-history-status is parsed in ClientExecuteCommand with CheckpointStatus.valueOf(clientCommandArgs.getCheckpointHistoryStatus().toUpperCase()). CheckpointStatus has IN_PROGRESS and FAILED, so under tr-TR an input such as failed becomes FAİLED and the command reports "Unsupported checkpoint history status". This is the same class of CLI enum argument as the issue title, so it would be good to fix it in #13081 with Locale.ROOT and add a matching Turkish-locale assertion. If you prefer to keep #13081 as-is, please say so and it can be tracked separately.

    Other default-locale conversions I saw in seatunnel-core (for example the Flink checkpoint mode and time characteristic switches in AbstractFlinkRuntimeEnvironment) read job config values rather than CLI arguments, so they are outside this issue and do not need to block #13081.

    Once the fork build has run, the detailed review continues on #13081 itself.

  7. SEZ9 commented on Nov 4, 2026

    @SEZ9
    Collaborator

    Thanks @sharpca. Two points remain before the detailed review can continue on the PR:

    1. CI — as noted above, the PR's Build check reports the workflow run from your fork, and the fork currently has no workflow runs, so there is nothing for a maintainer to approve. Please enable Actions in your fork and run the Build workflow against the PR branch so a run for head 3dc5920e is picked up, then post here once it has executed.

    2. --checkpoint-history-status — this is still parsed with a default-locale toUpperCase() in ClientExecuteCommand. Please let us know whether you want to fix it in the PR with Locale.ROOT plus a Turkish-locale assertion, or have it tracked separately.

    The coverage summary you posted reads well; it will be checked against the diff during review on the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcoreSeaTunnel core module

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions