Menu

#31 STDIN ERROR EPOLL_CTL_ADD failed (Operation not permitted) redirecting

none
closed-fixed
nobody
medium
2015-01-26
2013-07-18
Mark
No

I encountered a problem using winexe with BackupPC.
I used log level 11 and I got the following output in a bash shell
I execute the shell under bash... no problem
I execute the shell under BackupPC and it stalls (have to kill manually the process)
the point it stalls one can find hereafter

---> shell
IN: async_open(\pipe\ahexec, 2)
IN: async_open_recv
CTRL: Sending command: get version
CTRL: Sending command: run cmd.exe /c c:\backuppc\pre-exec.cmd
CTRL: Recieved command: std_io_err 0FB40002
IN: async_open(\pipe\ahexec_stdin0FB40002, 2)
IN: async_open(\pipe\ahexec_stdout0FB40002, 2)
IN: async_open(\pipe\ahexec_stderr0FB40002, 2)
IN: async_open_recv
IN: async_open_recv
IN: async_open_recv
---> Backuppc (2013-07-18 17:46:43 Output from DumpPreUserCmd:)
IN: async_open(\pipe\ahexec, 2)
IN: async_open_recv
CTRL: Sending command: get version
CTRL: Sending command: run cmd /c c:\backuppc\pre-exec.cmd
CTRL: Recieved command: std_io_err 0E680002
IN: async_open(\pipe\ahexec_stdin0E680002, 2)
IN: async_open(\pipe\ahexec_stdout0E680002, 2)
IN: async_open(\pipe\ahexec_stderr0E680002, 2)
IN: async_open_recv
tevent: EPOLL_CTL_ADD failed (Operation not permitted) - falling back to select()
Aborting...

I ran under the same user (backuppc) and also under root (shell)... always the same

Mark

Discussion

  • Thomas Hood

    Thomas Hood - 2013-07-19

    Which version of winexe are you using? Have you tried the development version (pre 1.1) from the winexe-waf repository?

     
  • Thomas Hood

    Thomas Hood - 2013-08-24

    Try running "cat </dev/null | winexe..." instead of "winexe...".

     
  • Thomas Hood

    Thomas Hood - 2013-08-24
    • status: open --> incomplete
     
  • Thomas Hood

    Thomas Hood - 2013-09-03

    This is most probably the "doesn't work with stdin redirected" bug which has since been fixed.

     
  • Thomas Hood

    Thomas Hood - 2013-09-03
    • status: incomplete --> closed-fixed
     
  • Kris Lou

    Kris Lou - 2013-09-23

    Hi - I have the same problem (and same application use) as the original ticket. What build is this fixed in? I'm using 1.00-2.3.i686 from http://download.opensuse.org/repositories/home:/ahajda:/winexe/CentOS_CentOS-6/
    on CentOS6 (obviously).

     
  • Oblio

    Oblio - 2013-10-23

    I'm also running v1.00 and getting this error. Please reopen.

     
  • Kris Lou

    Kris Lou - 2013-10-23

    This is a workaround for the BackupPC implementation. Basically, Winexe runs, the target machine is turned off, but then Winexe persists.

    Finally, i found that winexe doesnt timeout when he connected to a machine, but then it was turned off, leaving a active winexe that never dies… i made a simple script that i add in the cron to kill this zombie sessions…
    cron:
    /10 * * * /etc/backuppc/bin/clean-winexe.sh

    /etc/backuppc/bin/clean-winexe.sh :
    #!/bin/bash

    # some winexe never die when the remote host shutdown after the connect
    # so try to detect and kill them
    # please note that the time is cpu time, so 6min of CPU is a long time
    ps xua | awk ‘ /backuppc/ && /winexe/ && ! /awk/ && ! /SCREEN/ {
    time=$10
    gsub(/.*:0?/,”",time)
    if( time >= 6 ) { system (“kill ” $2) }
    }’

    Source: http://www.goodjobsucking.com/?p=62&cpage=2#comment-3900

    (Edit: messed up the block quote)

     

    Last edit: Kris Lou 2013-10-23
  • ahajda

    ahajda - 2013-10-23

    I think it should be fixed in winexe. The problem is that it is samba code. I will look for some workaround which will not affect samba.

     
  • ahajda

    ahajda - 2013-10-23
    • status: closed-fixed --> open
     
  • Thomas Hood

    Thomas Hood - 2013-10-24

    Kris, Oblio: you are running winexe 1.00. Please build winexe from the "current" (a.k.a. "winexe-waf") git repository and report whether or not the bug has been fixed there.

     
  • Thomas Hood

    Thomas Hood - 2013-10-28
    • status: open --> incomplete
     
  • Kris Lou

    Kris Lou - 2013-10-28

    I'll build and test, but it'll take me a bit of time to get my dev environment up. For obvious reasons, I prefer repository-provided packages in my production server ... Is there a timeline for 1.1 to hit a yum repo?

     
  • Shaun

    Shaun - 2013-11-06

    I have compiled the source code with dynamic libraries (git co as of yesterday) and still have the same thing happening to me. For me, this happens in any script (i.e. I must manually hit the enter key in order to continue). Running cat </dev/null | ./winexe ... just seems to freeze it, while doing it without that gives the stopping error per op.

    edit: this is running on x86_64 Arch Linux.

    edit 2: also see this stackexchange post for some more debugging output: http://unix.stackexchange.com/questions/82825/using-winexe-to-run-wmic-commands-on-a-windows-machine/91467

     

    Last edit: Shaun 2013-11-06
  • Thomas Hood

    Thomas Hood - 2013-11-10

    Shaun: Please build winexe from the "current" (a.k.a. "winexe-waf") git repository and report whether or not the bug has been fixed there.

     
  • ahajda

    ahajda - 2013-11-19

    I have just uploaded patch which should fix the issue. If not please reopen it.

     
  • ahajda

    ahajda - 2013-11-19
    • status: incomplete --> closed-fixed
     
  • Shaun

    Shaun - 2014-01-15

    I apologize about the long delay. I no longer work at my previous employer where I was trying to get this to work. However, I am still interested in seeing it fully work.

    I did a git clone on a new personal laptop running Arch Linux x86-64. Made sure base-devel and mingw-w64-toolchain (which includes w32) were installed. Then

    cd source/
    ./waf configure build

    It compiled rather quickly on this new machine. I then ran

    ./winexe -d 9 -U Administrator%Password01 //192.168.10.122 "Powershell (Get-WmiObject -Class Win32_Product | Select-Object -Property Name)"

    and observed the same behavior.
    (i.e. command line is paused, and once I hit any key I get
    CTRL: Received: return_code 00000000
    ERROR: smb_raw_read_recv - NT_STATUS_PIPE_DISCONNECTED
    ERROR: smb_raw_read_recv - NT_STATUS_PIPE_DISCONNECTED
    ERROR: smb_raw_read_recv - NT_STATUS_PIPE_DISCONNECTED
    ERROR: smb_raw_read_recv - NT_STATUS_PIPE_DISCONNECTED
    )

    Version does show 1.1:

    ./winexe -V
    winexe version 1.1

     
  • Thomas Hood

    Thomas Hood - 2014-01-15
    • status: closed-fixed --> open
     
  • ahajda

    ahajda - 2014-01-15

    Hi Shaun
    This bug report is about poll/select bug, indicated by the following winexe message:
    tevent: EPOLL_CTL_ADD failed (Operation not permitted) - falling back to select()

    Your issue is totaly different, powershell is a console application and do not works correctly with simple stdin/out/error pipes provided by winexe.
    Some workaround for this is to use additional windows redirection:
    ./winexe ... 'echo . | powershell ...'
    as advised on numerous web pages, for example:
    http://stackoverflow.com/questions/19129770/escape-special-chars-in-powershell-commands

     
  • ahajda

    ahajda - 2014-01-15
    • status: open --> closed-fixed
     
  • Shaun

    Shaun - 2014-01-15

    Thanks ahajda. I hadn't realized where the bug was. Non-powershell commands do indeed work fine for me, even on version 1.0.

     

Log in to post a comment.