Bug 38673 - Shutdown of Windows VM fails - winexe vs. Samba-libs
Shutdown of Windows VM fails - winexe vs. Samba-libs
Status: RESOLVED FIXED
Product: UCS Test
Classification: Unclassified
Component: Samba
unspecified
Other Linux
: P5 normal (vote)
: ---
Assigned To: Philipp Hahn
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-06-09 10:19 CEST by Philipp Hahn
Modified: 2018-11-01 19:53 CET (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2015-06-09 10:19:10 CEST
Running command phase (6/6) on VM [slave095]
  . utils.sh; shutdown_windows_host 10.210.108.142 'True'         fail: return code 1

$ ec2-terminate-old-jenkins  -j UCS-4.0/UCS-4.0-2/Autotest\ MultiEnv/SambaVersion=s4,Systemrolle=slave
O UCS-4.0/UCS-4.0-2/Autotest MultiEnv/SambaVersion=s4,Systemrolle=slave[23] Test-jenkins-win2k12095       
O UCS-4.0/UCS-4.0-2/Autotest MultiEnv/SambaVersion=s4,Systemrolle=slave[24] Test-jenkins-win2k12095       
O UCS-4.0/UCS-4.0-2/Autotest MultiEnv/SambaVersion=s4,Systemrolle=slave[25] Test-jenkins-win2k12095       
O UCS-4.0/UCS-4.0-2/Autotest MultiEnv/SambaVersion=s4,Systemrolle=slave[26] Test-jenkins-win2k12095       
O UCS-4.0/UCS-4.0-2/Autotest MultiEnv/SambaVersion=s4,Systemrolle=slave[27] Test-jenkins-win2k12095       
O UCS-4.0/UCS-4.0-2/Autotest MultiEnv/SambaVersion=s4,Systemrolle=slave[28] Test-jenkins-win2k12095       
O UCS-4.0/UCS-4.0-2/Autotest MultiEnv/SambaVersion=s4,Systemrolle=slave[29] Test-jenkins-win2k12095
Comment 1 Stefan Gohmann univentionstaff 2015-06-13 10:06:48 CEST
Maybe we need to rebuild winexe due to the Samba upgrade:

Execute: . utils.sh; promote_ad_w2k12 10.210.102.196 autotest223.local
Traceback (most recent call last):
  File "<string>", line 4, in <module>
  File "/usr/lib/pymodules/python2.7/univention/winexe.py", line 434, in promote_ad
    self.set_local_user_password(self.domain_admin, self.domain_password)
  File "/usr/lib/pymodules/python2.7/univention/winexe.py", line 445, in set_local_user_password
    self.winexec("cmd /C net user %s" % (user + " " + password), domain_mode=False)
  File "/usr/lib/pymodules/python2.7/univention/winexe.py", line 231, in winexec
    return self.__run_command(cmd, dont_fail=dont_fail)
  File "/usr/lib/pymodules/python2.7/univention/winexe.py", line 154, in __run_command
    raise WinExeFailed("command '%s' failed with: %s %s" % (" ".join(cmd), stdout, stderr))
univention.winexe.WinExeFailed: command 'winexe --interactive=0 -U testadmin%Univention@99 //10.210.102.196 cmd /C net user administrator Univention@99' failed with: winexe: /usr/lib/x86_64-linux-gnu/samba/libcli-ldap.so.0: version `SAMBA_4.2.0RC2_DEBIAN' not found (required by winexe)
winexe: /usr/lib/x86_64-linux-gnu/samba/libsamba-debug.so.0: version `SAMBA_4.2.0RC2_DEBIAN' not found (required by winexe)
winexe: /usr/lib/x86_64-linux-gnu/samba/liberrors.so.0: version `SAMBA_4.2.0RC2_DEBIAN' not found (required by winexe)
winexe: /usr/lib/x86_64-linux-gnu/samba/libdcerpc-samba.so.0: version `SAMBA_4.2.0RC2_DEBIAN' not found (required by winexe)
 None
*** Failed 1: . utils.sh; promote_ad_w2k12 10.210.102.196 autotest223.local
Comment 2 Stefan Gohmann univentionstaff 2015-06-13 19:53:39 CEST
I've copied the winexe source package to the errata4.0-2 scope. The build fails with the following messages:

Waf: Entering directory `/build/winexe-1.1.0/winexe-winexe-waf/source/build'
[ 1/16] c: winexesvc_launch.c -> build/winexesvc_launch.c.1.o
../winexesvc_launch.c: In function 'winexesvcStart':
../winexesvc_launch.c:113:45: warning: 'specificError' may be used uninitialized in this function [-Wuninitialized]
[ 2/16] c: winexesvc_loop.c -> build/winexesvc_loop.c.1.o
[ 3/16] cprogram: build/winexesvc_launch.c.1.o build/winexesvc_loop.c.1.o -> build/winexesvc32.exe
/usr/bin/i686-w64-mingw32-ld: unrecognized option '-z'
/usr/bin/i686-w64-mingw32-ld: use the --help option for usage information
collect2: ld returned 1 exit status
Waf: Leaving directory `/build/winexe-1.1.0/winexe-winexe-waf/source/build'
Build failed
 -> task in 'winexesvc32.exe' failed (exit status 1): 
        {task 150924396: cprogram winexesvc_launch.c.1.o,winexesvc_loop.c.1.o -> winexesvc32.exe}
['/usr/bin/i586-mingw32msvc-gcc', '-Wl,-z,relro', '-s', 'winexesvc_launch.c.1.o', 'winexesvc_loop.c.1.o', '-o', '/build/winexe-1.1.0/winexe-winexe-waf/source/build/winexesvc32.exe', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-luserenv']
make[1]: *** [override_dh_auto_build] Error 1
make[1]: Leaving directory `/build/winexe-1.1.0'
make: *** [build] Error 2
Comment 3 Stefan Gohmann univentionstaff 2015-06-13 20:28:52 CEST
(In reply to Stefan Gohmann from comment #2)
> I've copied the winexe source package to the errata4.0-2 scope. The build
> fails with the following messages:

The amd64 build was successful. Strange.
Comment 4 Arvid Requate univentionstaff 2015-06-15 13:44:10 CEST
Yes, strange, I guess it's some waf issue, in amd64 I just tried with waf build -vv, and the linker flag "-z" is not passed to the command:

[ 3/16] cprogram: build/winexesvc_launch.c.1.o build/winexesvc_loop.c.1.o -> build/winexesvc32.exe
06:48:05 runner ['/usr/bin/i586-mingw32msvc-gcc', '-s', 'winexesvc_launch.c.1.o', 'winexesvc_loop.c.1.o', '-o', '/root/winexe-1.1.0/winexe-winexe-waf/source/build/winexesvc32.exe', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-luserenv']

I'll check again with i686.
Comment 5 Philipp Hahn univentionstaff 2015-06-15 16:10:07 CEST
Joining the Windows server fails:
> . utils.sh; join_windows_memberserver 10.210.157.43 autotest0.. fail: return code 1
> . utils.sh; set_windows_gateway 10.210.157.43 autotest095.loc.. fail: return code 1
> . utils.sh; install_gpmc_windows 10.210.157.43 autotest095.lo.. fail: return code 1

The shutdown fails with this error message (but this might be relate to the fact, that the original Master is no longer running and I did run the command for my own host)

# python
>>> import univention.winexe
>>> win=univention.winexe.WinExe('dummydomain', 'administrator', 'Univention@99', 'testadmin', 'Univention@99', 445, '10.210.157.43')
>>> win.shutdown_remote_win_host(True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/pymodules/python2.7/univention/winexe.py", line 453, in shutdown_remote_win_host
    self.winexec("shutdown", domain_mode=domain_mode)
  File "/usr/lib/pymodules/python2.7/univention/winexe.py", line 216, in winexec
    self.__copy_script(script=script[0], domain_mode=domain_mode, runas_user=runas_user, runas_password=runas_password)
  File "/usr/lib/pymodules/python2.7/univention/winexe.py", line 171, in __copy_script
    raise WinExeFailed("certutil not found on client %s! (%s %s)" % (self.client, stderr, stdout))
univention.winexe.WinExeFailed: certutil not found on client 10.210.157.43! (None ERROR: Cannot connect to svcctl pipe. NT_STATUS_LOGON_FAILURE.)

The VM is not reachable via rdesktop.
Comment 6 Philipp Hahn univentionstaff 2015-07-21 08:21:33 CEST
Jenkins: S4-Slave fails again: <http://jenkins.knut.univention.de:8080/job/UCS-4.0/job/UCS-4.0-2/job/Autotest%20MultiEnv/SambaVersion=s4,Systemrolle=slave/69/console>

> . utils.sh; join_windows_memberserver 10.210.49.47 autotest09.. fail: return code 1
> . utils.sh; set_windows_gateway 10.210.49.47 autotest095.loca.. fail: return code 1
> . utils.sh; install_gpmc_windows 10.210.49.47 autotest095.loc.. fail: return code 1

We releases an Samab4 errata yesterday, maybe winexec needs to be updated again?

# . utils.sh;join_windows_memberserver 10.210.49.47 autotest095.local 10.210.253.189
Traceback (most recent call last):
  File "<string>", line 2, in <module>
ImportError: No module named winexe

# . utils.sh; install_ucs_windows_tools

# . utils.sh;join_windows_memberserver 10.210.49.47 autotest095.local 10.210.253.189
Traceback (most recent call last):
  File "<string>", line 4, in <module>
  File "/usr/lib/pymodules/python2.7/univention/winexe.py", line 289, in domain_join
    self.winexec("firewall-turn-off", domain_mode=False)
  File "/usr/lib/pymodules/python2.7/univention/winexe.py", line 216, in winexec
    self.__copy_script(script=script[0], domain_mode=domain_mode, runas_user=runas_user, runas_password=runas_password)
  File "/usr/lib/pymodules/python2.7/univention/winexe.py", line 171, in __copy_script
    raise WinExeFailed("certutil not found on client %s! (%s %s)" % (self.client, stderr, stdout))
univention.winexe.WinExeFailed: certutil not found on client 10.210.49.47! (None winexe: /usr/lib/x86_64-linux-gnu/samba/libcli-ldap.so.0: version `SAMBA_4.2.2_DEBIAN' not found (required by winexe)
winexe: /usr/lib/x86_64-linux-gnu/samba/libsamba-debug.so.0: version `SAMBA_4.2.2_DEBIAN' not found (required by winexe)
winexe: /usr/lib/x86_64-linux-gnu/samba/liberrors.so.0: version `SAMBA_4.2.2_DEBIAN' not found (required by winexe)
winexe: /usr/lib/x86_64-linux-gnu/samba/libdcerpc-samba.so.0: version `SAMBA_4.2.2_DEBIAN' not found (required by winexe))
Comment 7 Philipp Hahn univentionstaff 2015-07-21 08:48:53 CEST
r62275 | Bug #38673 test: Return error code
 Changed "install_ucs_windows_tools" (and others) to return an error on failed install
Comment 8 Philipp Hahn univentionstaff 2015-07-24 12:56:37 CEST
<http://jenkins.knut.univention.de:8080/job/UCS-4.0/job/UCS-4.0-2/job/Autotest MultiEnv/SambaVersion=s4,Systemrolle=slave/71/consoleFull>

  . utils.sh; join_windows_memberserver 10.210.203.71 autotest095.local 10.210.180.108
fail: return code 1
  . utils.sh; set_windows_gateway 10.210.203.71 autotest095.local 10.210.180.108
fail: return code 1
  . utils.sh; install_gpmc_windows 10.210.203.71 autotest095.local
fail: return code 1
  . utils.sh; shutdown_windows_host 10.210.203.71 'True'
fail: return code 1


(In reply to Stefan Gohmann from comment #2)
> I've copied the winexe source package to the errata4.0-2 scope. The build
> fails with the following messages:
...
> /usr/bin/i686-w64-mingw32-ld: unrecognized option '-z'

"dpkg-buildflags" is the culprit, which detects hardening support in "binutils", which are missing in binutils-mingw-w64-*.

r62396 | Bug #38673 winexe: Fix winexe build
 export DEB_BUILD_MAINT_OPTIONS=hardening=-all

Package: winexe
Version: 1.1.0-12.20.201507241230
Branch: ucs_4.0-0
Scope: errata4.0-2

TODO: Needs to be announced as unmaintained after QA!

OK: # . utils.sh && shutdown_windows_host 10.210.203.71 False
Comment 9 Arvid Requate univentionstaff 2015-09-30 15:43:12 CEST
Ok:
* Returning of error codes from ucs-ec2-tools/examples/jenkins/utils/utils.sh
* winexe built in ucs-4.0-3 & errata4.0-3

Please also merge the winexe packaging fix to ucs-4.1-0
Comment 10 Philipp Hahn univentionstaff 2015-09-30 16:29:30 CEST
(In reply to Arvid Requate from comment #9)
> Ok:
> * Returning of error codes from ucs-ec2-tools/examples/jenkins/utils/utils.sh
> * winexe built in ucs-4.0-3 & errata4.0-3
> 
> Please also merge the winexe packaging fix to ucs-4.1-0

r64115 | Bug #38673 winexe: Fix winexe build

Package: winexe
Version: 1.1.0-12.27.201509251024
Branch: ucs_4.1-0