Closed stanstrup closed 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
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?
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?
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.
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.
OK, time to compare the output of export
when running from cron vs. not.
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"
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.
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.
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:
Docker-compose:
Bash script that runs R script:
R script:
Errors:
EDIT: Posted also in SO: https://stackoverflow.com/questions/56753750/using-wine-process-within-docker-without-attaching-to-a-shell