Failed to create directory in the default staging directory inside Docker

Hello,

When running the following cwl definition on a local machine:

#!/usr/bin/env cwl-runner

cwlVersion: v1.0
class: CommandLineTool

hints:
 DockerRequirement:
   dockerPull: umccr/bcl2fastq

requirements:
  EnvVarRequirement:
    envDef:
      DEPLOY_ENV: $(inputs.denv)

inputs:
  denv: string

  input_folder:
    type: Directory
    inputBinding:
      position: 1
      prefix: -R

  output_folder:
    type: Directory
    inputBinding:
      position: 3
      prefix: -o

  samplesheet_bcl2fastq:
    type: [File, Directory]
    inputBinding:
      prefix: --sample-sheet

arguments: ["--ignore-missing-bcls", "--ignore-missing-filter", "--ignore-missing-positions"]

outputs:

  samplesheets_fastq:
    type: Directory
    outputBinding:
      glob: $(inputs.output_folder)

baseCommand: []

I am getting the following error:

020-02-13 00:02:12 [12fa880] INFO: creating directory "/var/lib/cwl/stg9cbc2941-3f59-4c21-a692-a17c897a1e1e/output/Stats"
2020-02-13 00:02:12 [12fa880] ERROR: bcl2fastq::common::Exception: 2020-Feb-13 00:02:12: Read-only file system (30): /TeamCityBuildAgent/work/556afd631a5b66d8/src/cxx/lib/common/FileSystem.cpp(40): Throw in function void bcl2fastq::common::createDirectories(std::vector<boost::filesystem::path>)
Dynamic exception type: boost::exception_detail::clone_impl<bcl2fastq::common::IoError>
std::exception::what: Failed to create directory /var/lib/cwl/stg9cbc2941-3f59-4c21-a692-a17c897a1e1e/output/Stats

INFO [job bcl2fastq-test.cwl] Max memory used: 0MiB
ERROR [job bcl2fastq-test.cwl] Job error:
("Error collecting output for parameter 'samplesheets_fastq':\nbcl2fastq-test.cwl:42:7: 'CommentedMap' object has no attribute 'startswith'", {})

The cwltool version is 1.0.20190915164430.

I was of the opinion /var/lib/cwl is the default staging directory inside Docker. Not sure why is it throwing Read-only file system (30).
Am I missing anything here?

Any help will be greatly appreciated.
Thanks.


Sehrish.

For others running into the same issue, I was missing InitialWorkDirRequirement. Probably removed it while trying different things.

Adding it to the tool definition has resolved the issue.

1 Like