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

Unable to transfer file to pod if /tmp of pod is read-only #5527

Closed
homerskywalker opened this issue Oct 16, 2023 · 1 comment · Fixed by #5676
Closed

Unable to transfer file to pod if /tmp of pod is read-only #5527

homerskywalker opened this issue Oct 16, 2023 · 1 comment · Fixed by #5676
Assignees
Labels
Milestone

Comments

@homerskywalker
Copy link

Since changes from 86e740f have been implemented, we have an error when transferring a file to a pod that has /tmp read-only.

Before these changes (fix #4910), it was transferring the file to a directory that is allowed to write, but with the new way to transfer files, it seems it must have write access to /tmp.

To answer the obvious question you will ask as to is it possible to have /tmp writable in our pod, the answer is no, it is impossible.

What we suspect: upload function in PodUpload.java (https://github.com/fabric8io/kubernetes-client/blob/v6.8.1/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/uploadable/PodUpload.java#L135)

Version with the issue: 6.8.1

Question:
Is there a way (or an option) to have the file being copied directly in the intended directory and not have it copied to /tmp first?
(We need to upgrade version of kubernetes-client, and this is a blocker)

Error message:

Caused by: io.fabric8.kubernetes.client.KubernetesClientException: sh: /tmp/fabric8-a8874cdd-eb99-4f4c-a022-20150120503f.tar: Read-only file system

    at io.fabric8.kubernetes.client.dsl.internal.ExecWebSocketListener.onMessage(ExecWebSocketListener.java:319)
    at io.fabric8.kubernetes.client.okhttp.OkHttpWebSocketImpl$1.onMessage(OkHttpWebSocketImpl.java:110)
    at okhttp3.internal.ws.RealWebSocket.onReadMessage(RealWebSocket.kt:338)
    at okhttp3.internal.ws.WebSocketReader.readMessageFrame(WebSocketReader.kt:247)
    at okhttp3.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.kt:106)
    at okhttp3.internal.ws.RealWebSocket.loopReader(RealWebSocket.kt:293)
    at okhttp3.internal.ws.RealWebSocket$connect$1.onResponse(RealWebSocket.kt:195)
    at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)
    Suppressed: java.lang.Throwable: waiting here
            at io.fabric8.kubernetes.client.utils.Utils.waitUntilReady(Utils.java:174)
            at io.fabric8.kubernetes.client.dsl.internal.uploadable.PodUpload.upload(PodUpload.java:101)
            at io.fabric8.kubernetes.client.dsl.internal.uploadable.PodUpload.uploadTar(PodUpload.java:141)
            at io.fabric8.kubernetes.client.dsl.internal.uploadable.PodUpload.upload(PodUpload.java:55)
            at io.fabric8.kubernetes.client.dsl.internal.core.v1.PodOperationsImpl.lambda$upload$4(PodOperationsImpl.java:427)
            at io.fabric8.kubernetes.client.utils.internal.OptionalDependencyWrapper.wrapRunWithOptionalDependency(OptionalDependencyWrapper.java:39)
            at io.fabric8.kubernetes.client.dsl.internal.core.v1.PodOperationsImpl.upload(PodOperationsImpl.java:425)

Thank you

@manusa manusa added the bug label Oct 17, 2023
@manusa
Copy link
Member

manusa commented Oct 17, 2023

I don't think there is one at the moment.

We need to either use the target directory as the temporary directory or make the temp directory configurable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants