ProteoWizard / container

Options for running ProteoWizard applications via containers (e.g. Docker)
Apache License 2.0
9 stars 8 forks source link

using msconvert in a client cronjob #5

Closed stanstrup closed 5 years ago

stanstrup commented 5 years ago

Hello,

I am trying to write a script that automatically converts all files in a folder and is run regularly using cron. I am running into the problem that it seems wine is not working correctly when there is no interactive session. When I connect to the docker container and run the script manually it works just fine.

Any idea for some trick? I know this is probably a general wine problem but I thought you might have some idea.

Dockerfile:

FROM chambm/pwiz-skyline-i-agree-to-the-vendor-licenses AS converter

##### System libs setup #######################################################
# Install needed linux tools
RUN echo "deb http://cran.rstudio.com/bin/linux/ubuntu xenial-cran35/" | sudo tee -a /etc/apt/sources.list && \
    gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9 && \
    gpg -a --export E084DAB9 | sudo apt-key add - \
    && \
    apt-get update && \
    apt-get install  -y \
    \
    r-base \
    cron \
    \
    && rm -rf /var/lib/apt

###############################################################################

RUN mkdir /converter_scripts
COPY ./setup/converter_std.R /converter_scripts/converter_std.R
COPY ./setup/converter_std.sh /converter_scripts/converter_std.sh

##### R packages ##########################################################

RUN echo 'options(repos=structure(c(CRAN="http://cran.r-project.org")))' > .Rprofile
RUN R -e "install.packages('BiocManager');BiocManager::install('remotes')"
RUN R -e "BiocManager::install('bnosac/cronR')"
RUN R -e "library(cronR);cmd <- cron_rscript('/converter_scripts/converter_std.sh', cmd = '/bin/bash', rscript_log = '/var/log/converter_std.log');cron_add(cmd, frequency = '*/1 * * * *', id = 'Auto converter', description = 'Convert all new files every 1 minute')"

Docker-compose:

  ms_converter:
    build:
      context: .
      dockerfile: ./setup/Dockerfile_converter
      target: converter
    volumes:
        - type: bind
          source: C:\Users\tmh331\Desktop\gits\QC4Metabolomics_test\data
          target: /data   
    restart: always
    environment:
      TZ: Europe/Copenhagen
      msconvert_args: --filter "scanEvent 1" --mzML --zlib --64
    command: 'cron -f'

Bash script that runs R script:

#!/bin/bash

[ "${FLOCKER}" != "$0" ] && exec env FLOCKER="$0" flock -n "$0" "$0" "$@" || :

/usr/bin/Rscript '/converter_scripts/converter_std.R'

R script:

files <- list.files("/data", recursive = TRUE, include.dirs = TRUE, pattern = ".raw", full.names = TRUE)

# sudo -E -u root wine /wineprefix64/drive_c/pwiz/msconvert
# Xvfb $DISPLAY -nolisten tcp & wine /wineprefix64/drive_c/pwiz/msconvert
cmd <- paste0('wine64_anyuser /wineprefix64/drive_c/pwiz/msconvert "',files,'" ', Sys.getenv("msconvert_args"), ' --outdir "',dirname(files),'"')

sapply(cmd, system)

Errors:

wine: created the configuration directory '/root/.wine'
0012:err:ole:marshal_object couldn't get IPSFactory buffer for interface {00000131-0000-0000-c000-000000000046}
0012:err:ole:marshal_object couldn't get IPSFactory buffer for interface {6d5140c1-7436-11ce-8034-00aa006009fa}
0012:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hres=0x80004002
0012:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, 80004002
0012:err:ole:get_local_server_stream Failed: 80004002
000b:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
000b:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
0014:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0014:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
0014:err:ole:apartment_createwindowifneeded CreateWindow failed with error 0
0014:err:ole:apartment_createwindowifneeded CreateWindow failed with error 0
0014:err:ole:marshal_object couldn't get IPSFactory buffer for interface {00000131-0000-0000-c000-000000000046}
0014:err:ole:apartment_createwindowifneeded CreateWindow failed with error 14007
0014:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hres=0x800736b7
0014:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, 800736b7
0014:err:ole:get_local_server_stream Failed: 800736b7
0010:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0010:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
0016:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0016:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
0018:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0018:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
Could not load wine-gecko. HTML rendering will be disabled.
0028:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0028:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
002a:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
002a:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
Could not load wine-gecko. HTML rendering will be disabled.
wine: configuration in '/root/.wine' has been updated.
0009:fixme:vcruntime:__telemetry_main_invoke_trigger (0x7fe65000000)
0009:fixme:msvcp:_Locinfo__Locinfo_ctor_cat_cstr (0x23e4b0 1 C) semi-stub
0009:fixme:msvcp:_Locinfo__Locinfo_ctor_cat_cstr (0x23e520 1 C) semi-stub
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"configSections" in state 2
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"section" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"section" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"section" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"section" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"section" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"dependentAssembly" in state 0
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"assemblyIdentity" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"codeBase" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"UserLogConfig" in state 2
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"DataServiceConfig" in state 2
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"DataProviderAssemblies" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"Add" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"DataProviders" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"Add" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"Configuration" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"add" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"CommonSettings" in state 2
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"Locator" in state 2
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"sectionExtension" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"containers" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"container" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"constructor" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"constructor" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"constructor" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"constructor" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"constructor" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"constructor" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"property" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"constructor" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"constructor" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"param" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"constructor" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"property" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"SecurityConfig" in state 2
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"Authenticators" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"add" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"Authorizers" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"add" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"SecurityRepositories" in state 6
0009:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"add" in state 6
0009:fixme:mscoree:parse_supported_runtime sku=L".NETFramework,Version=v4.0" not implemented
0009:err:mscoree:CLRRuntimeInfo_GetRuntimeHost Wine Mono is not installed
0009:fixme:msvcrt:__clean_type_info_names_internal (0x1ad4d28) stub
0009:fixme:vcruntime:__telemetry_main_return_trigger (0x7fe65000000)
002e:fixme:vcruntime:__telemetry_main_invoke_trigger (0x7fe65000000)
002e:fixme:msvcp:_Locinfo__Locinfo_ctor_cat_cstr (0x23e4b0 1 C) semi-stub
002e:fixme:msvcp:_Locinfo__Locinfo_ctor_cat_cstr (0x23e520 1 C) semi-stub
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"configSections" in state 2
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"section" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"section" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"section" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"section" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"section" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"dependentAssembly" in state 0
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"assemblyIdentity" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"codeBase" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"UserLogConfig" in state 2
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"DataServiceConfig" in state 2
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"DataProviderAssemblies" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"Add" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"DataProviders" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"Add" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"Configuration" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"add" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"CommonSettings" in state 2
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"Locator" in state 2
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"sectionExtension" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"containers" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"container" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"constructor" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"constructor" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"constructor" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"constructor" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"constructor" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"constructor" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"property" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"constructor" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"constructor" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"param" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"constructor" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"property" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"register" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"lifetime" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"SecurityConfig" in state 2
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"Authenticators" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"add" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"Authorizers" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"add" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"SecurityRepositories" in state 6
002e:fixme:mscoree:ConfigFileHandler_startElement Unknown element L"add" in state 6
002e:fixme:mscoree:parse_supported_runtime sku=L".NETFramework,Version=v4.0" not implemented
002e:err:mscoree:CLRRuntimeInfo_GetRuntimeHost Wine Mono is not installed
002e:fixme:msvcrt:__clean_type_info_names_internal (0x1ad4d28) stub
002e:fixme:vcruntime:__telemetry_main_return_trigger (0x7fe65000000)
             wine64_anyuser /wineprefix64/drive_c/pwiz/msconvert "/data/test-pro/test-pro_neg_3C-6h.raw"  --outdir
 "/data/test-pro"

              255
wine64_anyuser /wineprefix64/drive_c/pwiz/msconvert "/data/test-pro/test-pro_pos_test-sample-metstd.raw"  --outdir
 "/data/test-pro"

              255

EDIT: Posted also in SO: https://stackoverflow.com/questions/56753750/using-wine-process-within-docker-without-attaching-to-a-shell

stanstrup commented 5 years ago

If I do just xvfb-run -a wine64_anyuser /wineprefix64/drive_c/pwiz/msconvert [...] from R I get fewer errors:

wine: created the configuration directory '/root/.wine'
0014:err:ole:marshal_object couldn't get IPSFactory buffer for interface {00000131-0000-0000-c000-000000000046}
0014:err:ole:marshal_object couldn't get IPSFactory buffer for interface {6d5140c1-7436-11ce-8034-00aa006009fa}
0014:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hres=0x80004002
0014:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, 80004002
0014:err:ole:get_local_server_stream Failed: 80004002
0012:err:ole:marshal_object couldn't get IPSFactory buffer for interface {00000131-0000-0000-c000-000000000046}
0012:err:ole:marshal_object couldn't get IPSFactory buffer for interface {6d5140c1-7436-11ce-8034-00aa006009fa}
0012:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hres=0x80004002
0012:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, 80004002
0012:err:ole:get_local_server_stream Failed: 80004002
chambm commented 5 years ago

The latter errors are normal and are why I recommend running with -eWINEDEBUG=-all normally. Only when you aren't getting the desired output should you run with WINEDEBUG set to give you some output.

The former errors I'm not sure about. Do you get the same errors when you run with the same WINEDEBUG setting but without docker-compose/Rscript in the way?

stanstrup commented 5 years ago

Thanks. I am not sure I understand what you are saying. I haven't changed the debug settings from your image that has: WINEDEBUG=-all,err+all You say the errors are normal. What do you mean by that? msconvert doesn't run and I just get those errors.

I get the same as the first errors if I run with sudo inside a shell, so I am assuming some if it has to do with user permissions and/or environments. If I run with sudo I also have to give full path to msconvert, otherwise it doesn't find it. So perhaps there could be more things it is not finding?

chambm commented 5 years ago

Yeah I should probably change the container's default WINEDEBUG. The Docker hub readme has -e WINEDEBUG=-all in its example command line.

What happens if you call it from inside a shell without sudo? It does seem likely to be environment-related.

stanstrup commented 5 years ago

If I connect to a shell inside the docker container and run it without sudo it works just fine. I can also do the call through R if I do it manually from a shell. It only fails with sudo or when I try to make cron trigger the call.

chambm commented 5 years ago

OK, time to compare the output of export when running from cron vs. not.

stanstrup commented 5 years ago

Oki. Thanks for looking at this.

From shell without sudo:

declare -x CONTAINER_GITHUB="https://github.com/ProteoWizard/container"
declare -x HOME="/root"
declare -x HOSTNAME="27b1b4416878"
declare -x LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:
ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01
;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31
:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif
=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;
35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*
.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;
35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.o
pus=00;36:*.spx=00;36:*.xspf=00;36:"
declare -x OLDPWD
declare -x PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
declare -x PWD="/data"
declare -x SHLVL="1"
declare -x TERM="xterm"
declare -x TZ="Europe/Copenhagen"
declare -x WINEDEBUG="-all,err+all"
declare -x WINEDISTRO="devel"
declare -x WINEPATH="C:\\pwiz;C:\\pwiz\\skyline"
declare -x WINEPREFIX="/wineprefix64"
declare -x WINEVERSION="3.12.0~xenial"
declare -x msconvert_args="--filter \"scanEvent 1\" --mzML --zlib --64"

With sudo su (cannot du sudo export):

declare -x HOME="/root"
declare -x HOSTNAME="27b1b4416878"
declare -x LOGNAME="root"
declare -x LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:
ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01
;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31
:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif
=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;
35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*
.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;
35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.o
pus=00;36:*.spx=00;36:*.xspf=00;36:"
declare -x MAIL="/var/mail/root"
declare -x OLDPWD
declare -x PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
declare -x PWD="/data"
declare -x SHELL="/bin/bash"
declare -x SHLVL="1"
declare -x SUDO_COMMAND="/bin/su"
declare -x SUDO_GID="0"
declare -x SUDO_UID="0"
declare -x SUDO_USER="root"
declare -x TERM="xterm"
declare -x TZ="Europe/Copenhagen"
declare -x USER="root"
declare -x USERNAME="root"

Making cron through R invoke export:

export EDITOR='vi'
export FLOCKER='/converter_scripts/converter_std.sh'
export HOME='/root'
export LD_LIBRARY_PATH='/usr/lib/R/lib:/usr/lib/x86_64-linux-gnu:/usr/lib/jvm/default-java/jre/lib/amd64/server'
export LN_S='ln -s'
export LOGNAME='root'
export MAKE='make'
export PAGER='/usr/bin/pager'
export PATH='/usr/bin:/bin'
export PWD='/root'
export R_ARCH=''
export R_BROWSER='xdg-open'
export R_BZIPCMD='/bin/bzip2'
export R_DOC_DIR='/usr/share/R/doc'
export R_GZIPCMD='/bin/gzip -n'
export R_HOME='/usr/lib/R'
export R_INCLUDE_DIR='/usr/share/R/include'
export R_LIBS_SITE='/usr/local/lib/R/site-library:/usr/lib/R/site-library:/usr/lib/R/library'
export R_LIBS_USER='~/R/x86_64-pc-linux-gnu-library/3.6'
export R_PAPERSIZE='letter'
export R_PAPERSIZE_USER='a4'
export R_PDFVIEWER='/usr/bin/xdg-open'
export R_PLATFORM='x86_64-pc-linux-gnu'
export R_PRINTCMD='/usr/bin/lpr'
export R_RD4PDF='times,inconsolata,hyper'
export R_SESSION_TMPDIR='/tmp/Rtmphvd5OJ'
export R_SHARE_DIR='/usr/share/R/share'
export R_STRIP_SHARED_LIB='strip --strip-unneeded'
export R_STRIP_STATIC_LIB='strip --strip-debug'
export R_SYSTEM_ABI='linux,gcc,gxx,gfortran,gfortran'
export R_TEXI2DVICMD='/usr/bin/texi2dvi'
export R_UNZIPCMD='/usr/bin/unzip'
export R_ZIPCMD='/usr/bin/zip'
export SED='/bin/sed'
export SHELL='/bin/sh'
export SHLVL='1'
export TAR='/bin/tar'
export _R_CHECK_COMPILATION_FLAGS_KNOWN_='-Wformat -Werror=format-security -Wdate-time'

cron directly invoke export with no flock or R involved:

declare -x HOME="/root"
declare -x LOGNAME="root"
declare -x OLDPWD
declare -x PATH="/usr/bin:/bin"
declare -x PWD="/root"
declare -x SHELL="/bin/sh"
declare -x SHLVL="1"
chambm commented 5 years ago

You need to find a way to preserve (or just set again):

declare -x WINEPATH="C:\\pwiz;C:\\pwiz\\skyline"
declare -x WINEPREFIX="/wineprefix64"

That's why you're getting those errors.

stanstrup commented 5 years ago

Thanks! Found a way.

The trick is to save the env vars before launching cron (link). Then source them before launching the process that needs them.

So docker should run a script with:

#!/bin/bash
printenv | sed 's/^\([a-zA-Z0-9_]*\)=\(.*\)$/export \1="\2"/g' > $HOME/env.sh

echo 'Starting cron'
cron -f

Then the script cron launches could be:

#!/bin/bash
[ "${FLOCKER}" != "$0" ] && exec env FLOCKER="$0" flock -n "$0" "$0" "$@" || :

# import env that was saved before starting cron
. $HOME/env.sh

# Start R script
/usr/bin/Rscript '/converter_scripts/converter_std.R'

Thanks again for helping debug this.