Container exit code 1

1,496 views
Skip to first unread message

Matteo Carrara

unread,
Jun 4, 2015, 10:02:08 AM6/4/15
to basespace-...@googlegroups.com
Hello,
I am building a rather simple app which takes two appResults files as input. The whole app works from a single shell script tasked to check the input, log and call the subscripts and functions needed for the procedures of the pipeline.
At the moment I fully debugged the full pipeline and I am sure it works smoothly from start to end when called within the container on an interactive shell with test data mount on a separate folder.

However, once I try to call the script from basespace I constantly encounter a container's "exit code 1".
More specifically, the VM I use for development correctly pings the docker service, receives the full appSession, downloads all the needed files (yes, I opted for a download method. I'd like to first debug this and then introduce a new variable to the configuration) and starts the container. 1 second after the container has been downloaded, the run is aborted with an error referring to the container exiting with code 1 of which I cannot find any direct reference.

Since the pipeline works fine within the container, called with the same parameters set in the callback.js file and also since the pipeline fails to write anything on the stdout before the error, I began to think the problem might be located before the script itself, but without references to error codes and their meaning I am a bit at a loss and I would like to know if there is a way to solve this.

I attach my callback.js, an launch specification example and the useful parts of the app output related to the error:

app output:
2015-06-04 13:20:50.606 [INFO ] - mcUrl: https://mission.basespace.illumina.com
2015-06-04 13:20:50.606 [INFO ] - filesPath: /
2015-06-04 13:20:50.625 [INFO ] - Verifying docker service: http://localhost:4243
2015-06-04 13:20:50.709 [INFO ] - Successfully pinged docker service.

2015-06-04 13:21:47.273 [INFO ] - Processing AppSession 'ChIP-Seq peak-calling pipeline 06/04/2015 3:21:34' (Id: 26016167)
2015-06-04 13:21:50.932 [INFO ] - Downloading input data.
2015-06-04 13:21:50.935 [INFO ] - No samples to download
2015-06-04 13:21:50.938 [INFO ] - Downloading AppResults...
2015-06-04 13:21:51.469 [INFO ] - Downloading AppResult 'k27acmsto' (Id: 20708690; 89 files)
[...] #Files being correctly downloaded
2015-06-04 13:53:34.735 [INFO ] - Finished downloading AppResult 'mstoigg' (Id: 20708691)
2015-06-04 13:53:37.126 [INFO ] - Preparing to download image 'docker.illumina.com/carrara/chipseq_pipeline'.
2015-06-04 13:53:41.464 [INFO ] - Starting container.
2015-06-04 13:53:43.044 [INFO ] - Container exited and reported exit code: 1
2015-06-04 13:53:44.817 [INFO ] - Uploading logs to AppSession
2015-06-04 13:53:45.399 [INFO ] - Container log written to https://aws-api.basespace.illumina.com/v1pre3/files/asn26016167_1935283416/content
2015-06-04 13:53:45.402 [INFO ] - Not attempting to upload results because the AppSession status is not 'running'
2015-06-04 13:53:46.227 [INFO ] - Done processing AppSession 'ChIP-Seq peak-calling pipeline 06/04/2015 3:21:34' (Id: 26016167)


callback.js
function launchSpec(dataProvider){
    var treat = dataProvider.GetProperty("Input.treat").Name;
    var treatid = dataProvider.GetProperty("Input.treat").Id;
    var control = dataProvider.GetProperty("Input.control").Name;
    var controlid = dataProvider.GetProperty("Input.control").Id;
    var outproject = dataProvider.GetProperty("Input.project").Id;
    var genome = dataProvider.GetProperty("Input.genome");
    var readsize = dataProvider.GetProperty("Input.readsize");
    var tool = dataProvider.GetProperty("Input.tool");
    var macs_min_mfold = dataProvider.GetProperty("Input.macs_min_mfold");
    var macs_max_mfold = dataProvider.GetProperty("Input.macs_max_mfold");
    var macs_pval = dataProvider.GetProperty("Input.macs_pval");
    var sicer_wsize = dataProvider.GetProperty("Input.sicer_wsize");
    var sicer_gsize = dataProvider.GetProperty("Input.sicer_gsize");
    var sicer_fdr = dataProvider.GetProperty("Input.sicer_fdr");
    var retval = { 
       commandLine: ["source", "/bin/chipseq_pipeline.sh", treat, treatid, control, controlid, outproject, genome, readsize, tool, macs_min_mfold, macs_max_mfold, macs_pval, sicer_wsize, sicer_gsize, sicer_fdr],
        containerImageId: "docker.illumina.com/carrara/chipseq_pipeline"
    };
    return retval;     
}


Launch specifications
{
  "CommandLine": [
    "/bin/chipseq_pipeline.sh",
    "k27acmsto.alignments.bam",
    "1470529116",
    "mstoigg.alignments.bam",
    "1470529182",
    "16680668",
    "0",
    "50",
    "0",
    "10",
    "30",
    "1e-5",
    "200",
    "200",
    "0.1"
  ],
  "ContainerImageId": "docker.illumina.com/carrara/chipseq_pipeline",
  "HostBuild": "undefined",
  "Properties": {}
}


Thank you in advance for all the help you can provide.
Best regards,
Matteo


Ryan Wentzel

unread,
Jun 18, 2015, 8:27:31 PM6/18/15
to basespace-...@googlegroups.com
Hi Matteo,

The container exit code reported by SpaceDock is obtained from the Docker daemon. You can use the docker logs command (see https://docs.docker.com/v1.5/reference/commandline/cli/#logs) on the stopped container to double check whether there was any log output. Also, you could commit the stopped container using docker commit (see https://docs.docker.com/v1.5/reference/commandline/cli/#commit) and then use docker run to start a shell session in the new image/container. For example,

docker run <image_id> /bin/bash

You could then inspect the container's file system to see if there are any clues as to why the pipeline is failing.

Ryan Wentzel

unread,
Jun 18, 2015, 8:29:51 PM6/18/15
to basespace-...@googlegroups.com
I forgot to mention that you should run the new container in interactive mode:

docker run -it <image_id> /bin/bash

Anthony Colombo

unread,
Jun 19, 2015, 8:11:40 PM6/19/15
to basespace-...@googlegroups.com
what is likely happening is that the docker application is not running how you wish it.

You should run the docker container,  create an array of all the inputs exactly how you posted them previously, and see if your script runs under the "source" command.  Likely you will hit an error.
I find it much easier to extract the data from the JSON within my shell script.


On Thursday, June 4, 2015 at 7:02:08 AM UTC-7, Matteo Carrara wrote:
Reply all
Reply to author
Forward
0 new messages