Skip to content

[Bug] Spark application list page returns 500 (SparkAppStateEnum.of unboxes a null state) #4492

Description

@88fantasy

Search before asking

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

Java Version

Temurin 21.0.11 (console), built with Microsoft OpenJDK 11.0.28

Scala Version

2.12.x

StreamPark Version

3.0.0-SNAPSHOT (dev branch, commit 9ddda84c9)

Flink Version

N/A (Spark)

Deploy mode

N/A (any — the list endpoint itself fails)

What happened

The Spark application list page returns HTTP 500 for every user, so the page cannot render at all.

SparkAppStateEnum.of(Integer state) compares with appState.value == state, which unboxes state. SparkAppListQueryRequest declares a scalar state field, which is null whenever the list is not filtered by status — the normal case. BeanUtils.copyProperties then leaves SparkApplication.state null, and shouldTracking() -> getStateEnum() -> of(null) throws.

For contrast, FlinkAppListQueryRequest exposes only stateArray (Integer[]) and no scalar state, so the Flink list never reaches this path — although FlinkAppStateEnum.getState(Integer) is written the same way and would behave identically if a null ever reached it.

Error Exception

java.lang.NullPointerException
	at org.apache.streampark.console.core.enums.SparkAppStateEnum.of(SparkAppStateEnum.java:82)
	at org.apache.streampark.console.core.entity.SparkApplication.getStateEnum(...)
	at org.apache.streampark.console.core.entity.SparkApplication.shouldTracking(...)

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions