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

[Hotfix] Fix NoSuchFileException when deploy on k8s #2949

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

xleoken
Copy link
Member

@xleoken xleoken commented Jun 20, 2024

Why are the changes needed?

Hotfix.

2024-06-20 03:37:44,219 ERROR [main] [org.apache.amoro.server.AmoroServiceContainer] [] - AMS encountered an unknown exception, will exist
java.lang.RuntimeException: java.nio.file.NoSuchFileException: ~/.kube/config
	at org.apache.amoro.server.manager.KubernetesOptimizerContainer.getKubeConfigContent(KubernetesOptimizerContainer.java:187) ~[amoro-ams-server-0.7-SNAPSHOT.jar:0.7-SNAPSHOT]
	at org.apache.amoro.server.manager.KubernetesOptimizerContainer.init(KubernetesOptimizerContainer.java:72) ~[amoro-ams-server-0.7-SNAPSHOT.jar:0.7-SNAPSHOT]
	at org.apache.amoro.server.resource.ResourceContainers$ContainerWrapper.loadResourceContainer(ResourceContainers.java:98) ~[amoro-ams-server-0.7-SNAPSHOT.jar:0.7-SNAPSHOT]
	at org.apache.amoro.server.resource.ResourceContainers$ContainerWrapper.<init>(ResourceContainers.java:78) ~[amoro-ams-server-0.7-SNAPSHOT.jar:0.7-SNAPSHOT]
	at org.apache.amoro.server.resource.ResourceContainers.lambda$init$0(ResourceContainers.java:45) ~[amoro-ams-server-0.7-SNAPSHOT.jar:0.7-SNAPSHOT]
	at java.util.ArrayList.forEach(ArrayList.java:1259) ~[?:1.8.0_412]
	at org.apache.amoro.server.resource.ResourceContainers.init(ResourceContainers.java:44) ~[amoro-ams-server-0.7-SNAPSHOT.jar:0.7-SNAPSHOT]
	at org.apache.amoro.server.AmoroServiceContainer$ConfigurationHelper.initContainerConfig(AmoroServiceContainer.java:453) ~[amoro-ams-server-0.7-SNAPSHOT.jar:0.7-SNAPSHOT]
	at org.apache.amoro.server.AmoroServiceContainer$ConfigurationHelper.init(AmoroServiceContainer.java:384) ~[amoro-ams-server-0.7-SNAPSHOT.jar:0.7-SNAPSHOT]
	at org.apache.amoro.server.AmoroServiceContainer.initConfig(AmoroServiceContainer.java:193) ~[amoro-ams-server-0.7-SNAPSHOT.jar:0.7-SNAPSHOT]
	at org.apache.amoro.server.AmoroServiceContainer.<init>(AmoroServiceContainer.java:98) ~[amoro-ams-server-0.7-SNAPSHOT.jar:0.7-SNAPSHOT]
	at org.apache.amoro.server.AmoroServiceContainer.main(AmoroServiceContainer.java:104) [amoro-ams-server-0.7-SNAPSHOT.jar:0.7-SNAPSHOT]
Caused by: java.nio.file.NoSuchFileException: ~/.kube/config
	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86) ~[?:1.8.0_412]
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[?:1.8.0_412]
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[?:1.8.0_412]
	at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214) ~[?:1.8.0_412]
	at java.nio.file.Files.newByteChannel(Files.java:361) ~[?:1.8.0_412]
	at java.nio.file.Files.newByteChannel(Files.java:407) ~[?:1.8.0_412]
	at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384) ~[?:1.8.0_412]
	at java.nio.file.Files.newInputStream(Files.java:152) ~[?:1.8.0_412]
	at org.apache.amoro.server.manager.KubernetesOptimizerContainer.getKubeConfigContent(KubernetesOptimizerContainer.java:185) ~[amoro-ams-server-0.7-SNAPSHOT.jar:0.7-SNAPSHOT]
	... 11 more

Brief change log

How was this patch tested?

  • Add some test cases that check the changes thoroughly including negative and positive cases if possible

  • Add screenshots for manual tests if appropriate

  • Run test locally before making a pull request

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

@github-actions github-actions bot added type:docs Improvements or additions to documentation type:build labels Jun 20, 2024
Copy link
Contributor

@tcodehuber tcodehuber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tcodehuber tcodehuber changed the title [hotfix] Fix NoSuchFileException when deploy on k8s [Hotfix] Fix NoSuchFileException when deploy on k8s Jun 20, 2024
@tcodehuber tcodehuber merged commit 93f1fbc into apache:master Jun 20, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:build type:docs Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants