Skip to content
This repository has been archived by the owner on Jun 16, 2021. It is now read-only.

APIProject.Run fails with "inappropriate ioctl for device" error #429

Open
ghing opened this issue Jan 15, 2017 · 4 comments
Open

APIProject.Run fails with "inappropriate ioctl for device" error #429

ghing opened this issue Jan 15, 2017 · 4 comments

Comments

@ghing
Copy link

ghing commented Jan 15, 2017

I'm trying to run libcompose to start some Docker containers in some Go integration tests.

Here's the TestMain function that uses libcompose to set up and tear down the containers:

func TestMain(m *testing.M) {
        project, err := docker.NewProject(&ctx.Context{
                Context: project.Context{
                        ComposeFiles: []string{"docker-compose.yml"},
                        ProjectName:  "ts2kusersvc",
                },
        }, nil)

        if err != nil {
                log.Fatal(err)
        }

        err = project.Up(context.Background(), options.Up{})

        if err != nil {
                log.Fatal(err)
        }

        // Without this blog, the code runs successfully
        var code int
        code, err = project.Run(context.Background(), "ts2kusersvc",
                []string{"-h"},
                options.Run{},
        )
        // End problematic code block

        if err != nil {
                log.Fatal(err)
        }

        code = m.Run()

        // Tear down Docker containers
        err = project.Down(context.Background(), options.Down{})

        if  err != nil {
                log.Fatal(err)
        }

        os.Exit(code)
}

The call to Run() in the above code fails with an "inappropriate ioctl for device" error, which I believe trickles up from Container.Run when calling term.SetRawTerminal.

I'm able to successfully execute the equivalent to my call to APIProject.Run via docker-compose run ....

@james-nesbitt
Copy link

can you specify what version your docker daemon is running?

@ghing
Copy link
Author

ghing commented Feb 21, 2017

$ dockerd --version
Docker version 1.13.0, build 49bf474

@james-nesbitt
Copy link

james-nesbitt commented Mar 1, 2017

sorry for not being able to address this. I want to suggest an issue with a volume bind (are you mapping a local path) but I haven't had any time to put any real thoughts together.

In your docker-compose.yml, if you are using any volume binds, or custom volume plugins, can you specify:

  1. do all local volume paths exist (are any of them symlinks or cross partition links or networked drives)
  2. what volume plugins you are using
  3. if you are populating any system volumes from image volumes.

@vrischmann
Copy link

Hi,

so I think I just encountered the same bug here. I use libcompose to build our apps and when it's run inside Gitlab CI it fails with inappropriate ioctl for device. docker-compose run used to work, it was the setup we used before this tool.

I do bind 2 volumes to perform my tests. For example, I bind the src directory and pom.xml to my container when running a maven container for my tests.

Not sure where to go from there

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants