Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] ClassNotFoundException occurred when specifying flink.yarn.ship-files for flink engine #6344

Closed
3 of 4 tasks
wForget opened this issue Apr 29, 2024 · 0 comments
Closed
3 of 4 tasks
Assignees
Labels
kind:bug This is a clearly a bug priority:major
Milestone

Comments

@wForget
Copy link
Member

wForget commented Apr 29, 2024

Code of Conduct

Search before asking

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

Describe the bug

ClassNotFoundException occurred when specifying flink.yarn.ship-files for flink engine.

Error detail:

2024-04-28 17:00:08,573 ERROR org.apache.flink.runtime.entrypoint.ClusterEntrypoint        [] - Could not create application program.
java.lang.RuntimeException: Could not look up the main(String[]) method from the class org.apache.kyuubi.engine.flink.FlinkSQLEngine: org/apache/flink/table/gateway/service/context/DefaultContext
	at org.apache.flink.client.program.PackagedProgram.hasMainMethod(PackagedProgram.java:315) ~[flink-dist-1.18.0.jar:1.18.0]
	at org.apache.flink.client.program.PackagedProgram.<init>(PackagedProgram.java:161) ~[flink-dist-1.18.0.jar:1.18.0]
	at org.apache.flink.client.program.PackagedProgram.<init>(PackagedProgram.java:65) ~[flink-dist-1.18.0.jar:1.18.0]
	at org.apache.flink.client.program.PackagedProgram$Builder.build(PackagedProgram.java:691) ~[flink-dist-1.18.0.jar:1.18.0]
	at org.apache.flink.client.program.DefaultPackagedProgramRetriever.getPackagedProgram(DefaultPackagedProgramRetriever.java:213) ~[flink-dist-1.18.0.jar:1.18.0]
	at org.apache.flink.yarn.entrypoint.YarnApplicationClusterEntryPoint.getPackagedProgram(YarnApplicationClusterEntryPoint.java:126) ~[flink-dist-1.18.0.jar:1.18.0]
	at org.apache.flink.yarn.entrypoint.YarnApplicationClusterEntryPoint.main(YarnApplicationClusterEntryPoint.java:96) [flink-dist-1.18.0.jar:1.18.0]
Caused by: java.lang.NoClassDefFoundError: org/apache/flink/table/gateway/service/context/DefaultContext
	at java.lang.Class.getDeclaredMethods0(Native Method) ~[?:1.8.0_382]
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) ~[?:1.8.0_382]
	at java.lang.Class.privateGetMethodRecursive(Class.java:3048) ~[?:1.8.0_382]
	at java.lang.Class.getMethod0(Class.java:3018) ~[?:1.8.0_382]
	at java.lang.Class.getMethod(Class.java:1784) ~[?:1.8.0_382]
	at org.apache.flink.client.program.PackagedProgram.hasMainMethod(PackagedProgram.java:307) ~[flink-dist-1.18.0.jar:1.18.0]
	... 6 more
Caused by: java.lang.ClassNotFoundException: org.apache.flink.table.gateway.service.context.DefaultContext
	at java.net.URLClassLoader.findClass(URLClassLoader.java:387) ~[?:1.8.0_382]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[?:1.8.0_382]
	at org.apache.flink.util.FlinkUserCodeClassLoader.loadClassWithoutExceptionHandling(FlinkUserCodeClassLoader.java:67) ~[flink-dist-1.18.0.jar:1.18.0]
	at org.apache.flink.util.ChildFirstClassLoader.loadClassWithoutExceptionHandling(ChildFirstClassLoader.java:65) ~[flink-dist-1.18.0.jar:1.18.0]
	at org.apache.flink.util.FlinkUserCodeClassLoader.loadClass(FlinkUserCodeClassLoader.java:51) ~[flink-dist-1.18.0.jar:1.18.0]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_382]
	at java.lang.Class.getDeclaredMethods0(Native Method) ~[?:1.8.0_382]
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) ~[?:1.8.0_382]
	at java.lang.Class.privateGetMethodRecursive(Class.java:3048) ~[?:1.8.0_382]
	at java.lang.Class.getMethod0(Class.java:3018) ~[?:1.8.0_382]
	at java.lang.Class.getMethod(Class.java:1784) ~[?:1.8.0_382]
	at org.apache.flink.client.program.PackagedProgram.hasMainMethod(PackagedProgram.java:307) ~[flink-dist-1.18.0.jar:1.18.0]
	... 6 more

Affects Version(s)

master

Kyuubi Server Log Output

No response

Kyuubi Engine Log Output

No response

Kyuubi Server Configurations

No response

Kyuubi Engine Configurations

flink.yarn.ship-files=customJars

Additional context

No response

Are you willing to submit PR?

  • Yes. I would be willing to submit a PR with guidance from the Kyuubi community to fix.
  • No. I cannot submit a PR at this time.
@wForget wForget added kind:bug This is a clearly a bug priority:major labels Apr 29, 2024
@wForget wForget self-assigned this Apr 29, 2024
@wForget wForget modified the milestones: v1.10.0, v1.9.1 May 14, 2024
wForget added a commit that referenced this issue May 14, 2024
# 🔍 Description
## Issue References 🔗

This pull request fixes #6344

`FlinkProcessBuilder` specifies `yarn.ship-files`, `yarn.application.name` and `yarn.tags` configurations of kyuubi platform. Sometimes we also need to customize these configurations, so we should prioritize these user configurations.

## Describe Your Solution 🔧

FlinkProcessBuilder prioritizes user configurations.

## Types of changes 🔖

- [x] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Test Plan 🧪

#### Behavior Without This Pull Request ⚰️

#### Behavior With This Pull Request 🎉

#### Related Unit Tests

added new unit test

---

# Checklist 📝

- [X] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)

**Be nice. Be informative.**

Closes #6342 from wForget/hotfix2.

Closes #6344

feca972 [wforget] address comment
17df084 [wforget] fix test and add flink constant
ece91cc [wforget] FlinkProcessBuilder prioritizes user configurations

Authored-by: wforget <643348094@qq.com>
Signed-off-by: wforget <643348094@qq.com>
(cherry picked from commit c8e6457)
Signed-off-by: wforget <643348094@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug This is a clearly a bug priority:major
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant