Bug 1466311 - Failed to restart sshd.socket: Transaction contains conflicting jobs 'restart' and 'stop' for sshd-keygen.service. Probably contradicting requirement dependencies configured.
Failed to restart sshd.socket: Transaction contains conflicting jobs 'restart...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: openssh (Show other bugs)
7.3
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Jakub Jelen
BaseOS QE Security Team
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-29 08:16 EDT by SHAURYA
Modified: 2017-07-31 12:16 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-07-31 12:16:23 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Ansible config files (3.15 KB, application/x-bzip)
2017-06-29 08:16 EDT, SHAURYA
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Github 2830 None None None 2017-06-29 08:16 EDT

  None (edit)
Description SHAURYA 2017-06-29 08:16:20 EDT
Created attachment 1292858 [details]
Ansible config files

Description of problem:

When trying to reboot sshd.socket we get an error:
Failed to restart sshd.socket: Transaction contains conflicting jobs 'restart' and 'stop' for sshd-keygen.service. Probably contradicting requirement dependencies configured.
See system logs and 'systemctl status sshd.socket' for details.
Socket does not reboot.
However, successive stop-start commands are executed without errors.

Version-Release number of selected component (if applicable):

systemd-219-30.el7_3.6.x86_64                               
systemd-libs-219-30.el7_3.6.x86_64                         
systemd-sysv-219-30.el7_3.6.x86_64                         


How reproducible:

Always

Steps to Reproduce:

systemctl restart sshd.socket
Failed to restart sshd.socket: Transaction contains conflicting jobs 'restart' and 'stop' for sshd-keygen.service. Probably contradicting requirement dependencies configured.
See system logs and 'systemctl status sshd.socket' for details.

Actual results:

Failed to restart sshd.socket: Transaction contains conflicting jobs 'restart' and 'stop' for sshd-keygen.service. Probably contradicting requirement dependencies configured.
See system logs and 'systemctl status sshd.socket' for details.

Expected results:

It should restart without any issues.

Additional info:

This issue was identified when ansible was used to restart the sshd.socket service. But this issue is manually encountered as well.
Comment 2 SHAURYA 2017-06-29 08:20:48 EDT
Also this default systemd config contributes to the issue.

egrep -i 'conflicts|wants|partof' /usr/lib/systemd/system/ssh*
/usr/lib/systemd/system/sshd-keygen.service:PartOf=sshd.service sshd.socket
/usr/lib/systemd/system/sshd.service:Wants=sshd-keygen.service
/usr/lib/systemd/system/sshd@.service:Wants=sshd-keygen.service
/usr/lib/systemd/system/sshd.socket:Conflicts=sshd.service
Comment 3 Michal Sekletar 2017-07-03 05:49:17 EDT
I was able to reproduce the issue on RHEL-7.3 GA with just simple ad-hoc command, i.e. no need for the entire role.

ansible -i <IP>, -m systemd -a 'name=sshd.socket state=restarted' all

Then I've tried with latest RHEL-7.3 z-stream and I could not reproduce the problem anymore.

This issue is fixed by,

https://errata.devel.redhat.com/advisory/28248
Comment 5 Jakub Jelen 2017-07-03 07:00:33 EDT
SHAURYA: The link to the build from Errata:

https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=552571

Michal, how is this supposed to be in OpenSSH when you fixed it in systemd? Can you clarify what that you meant?

Note You need to log in before you can comment on or make changes to this bug.