question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when upload file to container

See original GitHub issue

Good afternoon.

<dependency>
	<groupId>io.fabric8</groupId>
	<artifactId>kubernetes-client</artifactId>
	<version>5.8.0</version>
</dependency>

Good afternoon, trying to upload a file to a container like this:

io.fabric8.kubernetes.client.Config config = new ConfigBuilder()
                .withMasterUrl(String.format("https://%s:%s/", namespace.getHost(), namespace.getPort()))
                .withTrustCerts(true)
                .withOauthToken(namespace.getToken())
                .build();
        try (KubernetesClient k8s = new DefaultKubernetesClient(config)) {
            File fileToUpload = new File(srcFile);
            k8s.pods().inNamespace(namespace.getName())     // <- Namespace of Pod
                    .withName(pod)                 // <- Name of Pod
                    .inContainer(container)        //
                    .dir(targetFile)               // <- Path of directory inside Pod
                    .upload(fileToUpload.toPath());       // <- Local Path of directory
        }

Please tell me what could be the cause of the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: io/fabric8/kubernetes/model/annotation/Group
	at io.fabric8.kubernetes.api.model.HasMetadata.getGroup(HasMetadata.java:89)
	at io.fabric8.kubernetes.client.dsl.base.ResourceDefinitionContext.fromResourceType(ResourceDefinitionContext.java:51)
	at io.fabric8.kubernetes.client.ResourceHandlerImpl.<init>(ResourceHandlerImpl.java:43)
	at io.fabric8.kubernetes.client.Handlers.register(Handlers.java:42)
	at io.fabric8.kubernetes.client.BaseKubernetesClient.<clinit>(BaseKubernetesClient.java:129)
	at ru.diasoft.micro.iaas.service.ContainerProviderImpl.main(ContainerProviderImpl.java:151)
Caused by: java.lang.ClassNotFoundException: io.fabric8.kubernetes.model.annotation.Group
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	... 6 more

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
vmasyagincommented, Sep 27, 2021

Yes, I also have the following dependencies connected:

<dependency>
	<groupId>io.kubernetes</groupId>
	<artifactId>client-java</artifactId>
	<version>13.0.0</version>
</dependency>
<dependency>
	<groupId>io.fabric8</groupId>
	<artifactId>openshift-client</artifactId>
	<version>5.8.0</version>
</dependency>
0reactions
stale[bot]commented, Jan 16, 2022

This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upload fails in docker container. on Project:Support desk
Upload fails in docker container. ... Now I get this error just above the upload form: Could not create directory "mwstore://local-backend/local-public/3/3d". I ...
Read more >
Azure blob storage upload fail - Microsoft Q&A
Uploading files to blob endpoint Azure storage account via Storage Explorer and command line is failing with error "Response Status: 403 ...
Read more >
Upload file to blob storage - Error with upload - Stack Overflow
I test it in my asp.net core and it works well. I think you may not get the files you have upload. Please...
Read more >
Upload into Container Field - Data API - Error 20402
In our first test where we identified the problem is was on a web portal with dropzone.js where multiple files at once will...
Read more >
Upload to container: '$web' in storage account: '' with blob ...
Upload to container: '$web' in storage account: '' with blob prefix: '' failed with error: 'AzCopy.exe exited with non-zero exit code while uploading...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found