Skip to content

TypeError: The "iterable" argument must be an instance of Iterable. Received an instance of Object #1006

@lucmoulin

Description

@lucmoulin

Hello team,
I've the following configuration on Typescript:

const eannaContainer = await new GenericContainer(
    '<server name>/eanna/release:4.3.0')
    .withNetwork(network)
    .withNetworkAliases('eannahost')
    .withExposedPorts({
        container: 8080,
        host: 6080
    })
    .withCopyFilesToContainer(
        [{source: rootE2gFolderPath + '/config/eanna/logback-spring.xml', target: '/deployments/config/logback-spring.xml'}])
    .withEnvironment({
        ...eannaEnv,
        JAVA_MAX_MEM_RATIO: '100',
        JAVA_INIT_MEM_RATIO: '50'
    })
    .withStartupTimeout(300000) // wait 5 min
    .withWaitStrategy(Wait.forHttp('/actuator/health', 8080))
    .start();
But when I trigger it with our CI/CD pipeline, i get the following exception:
[21:33:27.404+02:00] - TypeError: The "iterable" argument must be an instance of Iterable. Received an instance of Object
[21:33:27.404+02:00] - at from (node:internal/streams/from:36:11)
[21:33:27.404+02:00] - at Function.Readable.from (node:internal/streams/readable:1729:10)
[21:33:27.404+02:00] - at DockerContainerClient.putArchive (/home/jenkins/agent/workspace/edossier2go-edossier/edossier2go-edossier-develop/build-deploy-test/angular-frontend/node_modules/.pnpm/[email protected]/node_modules/testcontainers/src/container-runtime/clients/container/docker-container-client.ts:78:37)
[21:33:27.404+02:00] - at processTicksAndRejections (node:internal/process/task_queues:105:5)

This bug has been introduced after the version 10.21.0 (it works for this version).

After analysis, the problem comes from the setup of the file to copy: withCopyFilesToContainer
On my environment I've defined the following configuration:

.withCopyFilesToContainer(
[{source: rootE2gFolderPath + '/config/eanna/logback-spring.xml', target: '/deployments/config/logback-spring.xml'}])

Could you please double check in the code this piece of code:

if (this.filesToCopy.length > 0 || this.directoriesToCopy.length > 0 || this.contentsToCopy.length > 0) {
const archive = this.createArchiveToCopyToContainer();
archive.finalize();
await client.container.putArchive(container, archive, "/");
}

Thanks a lot
Luc

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageInvestigation required

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions