Open ntqp97 opened 1 day ago
Might be a permission issue; the user that runs in the container (and is doing the copy) is not allowed to write on that particular location in the container. Maybe you can also share the relevant logs of kubedock in this issue as well.
Description I am encountering an issue when running tests with Testcontainers while using kubedock. Specifically, an error occurs when trying to copy a file to a container during test setup.
Here is the full error trace (not using --pre-archive):
[FAILED] Unexpected error: <*fmt.wrapError | 0xc0001c41a0>: create container: can't copy /tmp/1006179066/apisix.yaml to container: Error response from daemon: {"message":"command terminated with exit code 2"} { msg: "create container: can't copy /tmp/1006179066/apisix.yaml to container: Error response from daemon: {\"message\":\"command terminated with exit code 2\"}", err: <*errors.joinError | 0xc0002902e8>{ errs: [ <*errors.joinError | 0xc0002902d0>{ errs: [ <*fmt.wrapError | 0xc0001c4180>{ msg: "can't copy /tmp/1006179066/apisix.yaml to container: Error response from daemon: {\"message\":\"command terminated with exit code 2\"}", err: <errdefs.errSystem>{ error: <*errors.withStack | 0xc000290228>{ error: <*errors.withMessage | 0xc0001c4160>{ cause: <*errors.fundamental | 0xc0002901e0>{msg: ..., stack: ...}, msg: "Error response from daemon", }, stack: [0x87914c, 0x8784dc, 0x877cd0, 0x85af73, 0x8f8cc3, 0x8f880c, 0x8f227c, 0x907be3, 0x90775b, 0x8fc5b6, 0x8fc598, 0x906708, 0xa7d2f4, 0xaa0f05, 0xa7ceeb, 0x47e661], }, }, }, ], }, ], }, } occurred
Here is the full error trace (Using --pre-archive):
[FAILED] Unexpected error: create container: can't copy /tmp/3234009317/apisix.yaml to container: Error response from daemon: {"message":"pods \"kubedock-n14q3c-apisix-1-bf308844134f\" not found"} { msg: "create container: can't copy /tmp/3234009317/apisix.yaml to container: Error response from daemon: {\"message\":\"pods \\\"kubedock-n14q3c-apisix-1-bf308844134f\\\" not found\"}", ... } occurred In [It] at: /src/testutils/containers/apisix/apisix_test.go:42
This issue arises during the initialization of a container, when attempting to copy the file /tmp/3234009317/apisix.yaml into the container.