Failed to get machine PTY: No such file or directory

NS v7-b2.

I reboot the computer after completed the NS Samba Active Directory. I then change the administrator password first. Second I try to create a username with a password, I submit, it show but it fails with this message:

Here are the part of the log file /var/log/messages.

Sep 3 19:50:05 server httpd: [NOTICE] Nethgui\Authorization\User: user root authenticated
Sep 3 19:50:08 server admin-todos: Failed to get machine PTY: No such file or directory
Sep 3 19:50:34 server httpd: [NOTICE] NethServer\Tool\ChangePassword: root is changing password to SomeoneElse (administrator@bales.lan). Members of the adm group have no restriction (score = 1.00)
Sep 3 19:50:35 server esmith::event[2021]: Event: password-modify administrator@bales.lan /tmp/ng-1BEUb2
Sep 3 19:50:35 server esmith::event[2021]: Action: /etc/e-smith/events/password-modify/S25password-set SUCCESS [0.008231]
Sep 3 19:50:35 server esmith::event[2021]: spawn /usr/bin/systemd-run -M nsdc -q -t /usr/bin/samba-tool user setpassword administrator
Sep 3 19:50:35 server esmith::event[2021]: New Password:
Sep 3 19:50:36 server esmith::event[2021]: Changed password OK
Sep 3 19:50:36 server esmith::event[2021]: Action: /etc/e-smith/events/password-modify/S30nethserver-dc-password-set SUCCESS [1.247571]
Sep 3 19:50:37 server esmith::event[2021]: Enabled user ‘administrator’
Sep 3 19:50:37 server esmith::event[2021]: Action: /etc/e-smith/events/password-modify/S40nethserver-dc-user-unlock SUCCESS [0.855494]
Sep 3 19:50:37 server esmith::event[2021]: Action: /etc/e-smith/events/password-modify/S90password-cleanup SUCCESS [0.017182]
Sep 3 19:50:37 server esmith::event[2021]: Event: password-modify SUCCESS
Sep 3 19:51:04 server esmith::event[2102]: Event: user-create jbales Jeff Bales /usr/libexec/openssh/sftp-server
Sep 3 19:51:04 server esmith::event[2102]: Failed to get machine PTY: No such file or directory
Sep 3 19:51:04 server esmith::event[2102]:
Sep 3 19:51:04 server esmith::event[2102]: Action: /etc/e-smith/events/user-create/S40nethserver-dc-user-create SUCCESS [0.047743]
Sep 3 19:51:04 server esmith::event[2102]: Action: /etc/e-smith/events/user-create/S90nethserver-sssd-clear-cache SUCCESS [0.091111]
Sep 3 19:51:04 server esmith::event[2102]: Event: user-create SUCCESS
Sep 3 19:51:05 server esmith::event[2116]: Event: password-policy-update jbales no
Sep 3 19:51:05 server esmith::event[2116]: Action: /etc/e-smith/events/password-policy-update/S10nethserver-sssd-clear-cache SUCCESS [0.087067]
Sep 3 19:51:05 server esmith::event[2116]: Failed to get machine PTY: No such file or directory
Sep 3 19:51:05 server esmith::event[2116]: Action: /etc/e-smith/events/password-policy-update/S30nethserver-dc-password-policy SUCCESS [0.296604]
Sep 3 19:51:05 server esmith::event[2116]: Event: password-policy-update SUCCESS
Sep 3 19:51:05 server esmith::event[2126]: Event: password-modify jbales@bales.lan /tmp/ng-ElKky9
Sep 3 19:51:05 server esmith::event[2126]: Action: /etc/e-smith/events/password-modify/S25password-set SUCCESS [0.005999]
Sep 3 19:51:05 server esmith::event[2126]: spawn /usr/bin/systemd-run -M nsdc -q -t /usr/bin/samba-tool user setpassword jbales
Sep 3 19:51:06 server esmith::event[2126]: New Password:
Sep 3 19:51:06 server esmith::event[2126]: ERROR: Failed to set password for user ‘jbales’: Unable to find user “jbales”
Sep 3 19:51:06 server esmith::event[2126]: Action: /etc/e-smith/events/password-modify/S30nethserver-dc-password-set FAILED: 2 [1.084124]
Sep 3 19:51:07 server esmith::event[2126]: ERROR: Failed to enable user ‘jbales’: Unable to find account where ‘(&(objectClass=user)(sAMAccountName=jbales))’
Sep 3 19:51:07 server esmith::event[2126]: Action: /etc/e-smith/events/password-modify/S40nethserver-dc-user-unlock FAILED: 2 [0.890029]
Sep 3 19:51:07 server esmith::event[2126]: Action: /etc/e-smith/events/password-modify/S90password-cleanup SUCCESS [0.012927]
Sep 3 19:51:07 server esmith::event[2126]: Event: password-modify FAILED
Sep 3 19:51:58 server sshd[2172]: Accepted password for root from 192.168.2.60 port 48416 ssh2
Sep 3 19:51:58 server systemd: Created slice user-0.slice.
Sep 3 19:51:58 server systemd: Starting user-0.slice.
Sep 3 19:51:58 server systemd-logind: New session 1 of user root.
Sep 3 19:51:58 server systemd: Started Session 1 of user root.
Sep 3 19:51:58 server systemd: Starting Session 1 of user roo


I did restore of the virtual NethServer v7-b2, change the admin password and try to create a new user without the password. The user did not show nor any error message but here are the part of the log file /var/log/messages.

ep 3 19:58:39 server chronyd[889]: Selected source 192.241.206.171
Sep 3 19:58:57 server httpd: [NOTICE] NethServer\Tool\ChangePassword: root is changing password to SomeoneElse (administrator@bales.lan). Members of the adm group have no restriction (score = 1.00)
Sep 3 19:58:57 server esmith::event[2016]: Event: password-modify administrator@bales.lan /tmp/ng-F91t5k
Sep 3 19:58:57 server esmith::event[2016]: Action: /etc/e-smith/events/password-modify/S25password-set SUCCESS [0.007466]
Sep 3 19:58:57 server esmith::event[2016]: spawn /usr/bin/systemd-run -M nsdc -q -t /usr/bin/samba-tool user setpassword administrator
Sep 3 19:58:58 server esmith::event[2016]: New Password:
Sep 3 19:58:58 server esmith::event[2016]: Changed password OK
Sep 3 19:58:58 server esmith::event[2016]: Action: /etc/e-smith/events/password-modify/S30nethserver-dc-password-set SUCCESS [1.230118]
Sep 3 19:58:59 server esmith::event[2016]: Enabled user ‘administrator’
Sep 3 19:58:59 server esmith::event[2016]: Action: /etc/e-smith/events/password-modify/S40nethserver-dc-user-unlock SUCCESS [0.852282]
Sep 3 19:58:59 server esmith::event[2016]: Action: /etc/e-smith/events/password-modify/S90password-cleanup SUCCESS [0.015781]
Sep 3 19:58:59 server esmith::event[2016]: Event: password-modify SUCCESS
Sep 3 19:59:19 server esmith::event[2091]: Event: user-create jbales Jeff Bales /usr/libexec/openssh/sftp-server
Sep 3 19:59:19 server esmith::event[2091]: Failed to get machine PTY: No such file or directory
Sep 3 19:59:19 server esmith::event[2091]:
Sep 3 19:59:19 server esmith::event[2091]: Action: /etc/e-smith/events/user-create/S40nethserver-dc-user-create SUCCESS [0.042857]
Sep 3 19:59:19 server esmith::event[2091]: Action: /etc/e-smith/events/user-create/S90nethserver-sssd-clear-cache SUCCESS [0.092912]
Sep 3 19:59:19 server esmith::event[2091]: Event: user-create SUCCESS
Sep 3 19:59:20 server esmith::event[2105]: Event: password-policy-update jbales no
Sep 3 19:59:20 server esmith::event[2105]: Action: /etc/e-smith/events/password-policy-update/S10nethserver-sssd-clear-cache SUCCESS [0.0858]
Sep 3 19:59:20 server esmith::event[2105]: Failed to get machine PTY: No such file or directory
Sep 3 19:59:20 server esmith::event[2105]: Action: /etc/e-smith/events/password-policy-update/S30nethserver-dc-password-policy SUCCESS [0.224251]
Sep 3 19:59:20 server esmith::event[2105]: Event: password-policy-update SUCCESS
Sep 3 19:59:42 server sshd[2121]: Accepted password for root from 192.168.2.60 port 48458 ssh2
Sep 3 19:59:42 server systemd: Created slice user-0.slice.
Sep 3 19:59:42 server systemd: Starting user-0.slice.
Sep 3 19:59:42 server systemd-logind: New session 1 of user root.
Sep 3 19:59:42 server systemd: Started Session 1 of user root.
Sep 3 19:59:42 server systemd: Starting Session 1 of user root.
Sep 3 20:00:19 server yum[2141]: Installed: nano-2.3.1-10.el7.x86_64
Sep 3 20:01:01 server systemd: Started Session 2 of user root.
Sep 3 20:01:01 server systemd: Starting Session 2 of user root.

3 Likes

It seems to work after did this:

systemctl restart nsdc

4 Likes

I changed the topic title and category to bug because this message is always present when the server manager fails to communicate with the nsdc container, where Samba Active Directory runs.

Typical symptoms are failures on create/modify/delete accounts. @giacomo reported it once during installation. The suspect is systemd-run.

/cc @quality_team @fasttech @flatspin

Did you encounter the bug on bare metal machines?

Hypothesis: the problem is linked to VM snapshots and clocks. Reboots are not enough: full power off is required.

What do you think?

Sound good. I shut the virtual down once but it still has the problem. I’m trying on bare metal machine (not virtual). I let you know how it goes.

I shutdown the bare metal machine (not virtual) for 30s and it has the same problem. I did a ‘systemctl restart nsdc’ and after that it works.

1 Like

What happens if you reboot the whole server? Does the bug return?

BTW I was just wondering what systemd version is present on both the main system and the container. This might be a useful information. For anyone who hit this bug please report them with the following commands:

 rpm -q systemd
 rpm --dbpath=/var/lib/machines/nsdc/var/lib/rpm -q systemd

The bug returns on rebooted the server and shutting down.

[root@server ~]# rpm -q systemd
systemd-219-19.el7_2.12.x86_64
[root@server ~]# rpm --dbpath=/var/lib/machines/nsdc/var/lib/rpm -q systemd
systemd-219-19.el7_2.12.x86_64
[root@server ~]#
  1. Please annotate also the output of

    timedatectl

  2. Also attach the svg file produced by

    systemd-analyze plot > jeff.svg

  3. Could you check your hardware clock from BIOS at boot?

Thanks a lot!

  1. [root@server ~]# timedatectl
    Local time: Tue 2016-09-06 09:12:19 PDT
    Universal time: Tue 2016-09-06 16:12:19 UTC
    RTC time: Tue 2016-09-06 09:12:19
    Time zone: America/Los_Angeles (PDT, -0700)
    NTP enabled: yes
    NTP synchronized: yes
    RTC in local TZ: yes
    DST active: yes
    Last DST change: DST began at
    Sun 2016-03-13 01:59:59 PST
    Sun 2016-03-13 03:00:00 PDT
    Next DST change: DST ends (the clock jumps one hour backwards) at
    Sun 2016-11-06 01:59:59 PDT
    Sun 2016-11-06 01:00:00 PST

Warning: The system is configured to read the RTC time in the local time zone.
This mode can not be fully supported. It will create various problems
with time zone changes and daylight saving time adjustments. The RTC
time is never updated, it relies on external facilities to maintain it.
If at all possible, use RTC in UTC by calling
’timedatectl set-local-rtc 0’.

  1. https://drive.google.com/file/d/0BzXWUMaIvtgcQXpDekJrckh0YXc/view?usp=sharing

  2. BIOS hardware clock at boot: 16:17 9-6-2016.

I used to dual-boot for Windows 10 and Mint, and changed the time to local not UTC. All my virtuals were using local time (I think). My real machine was using a second hard drive in this machine and I might have been using local time. I accidentally erase my main drive when I did the real machine and since then put all back. I have not changed the time to local yet. Do you think that is the problem?

Update:

I tried it again and it fails again. Error message.

1 Like

It failed again using the UTC and not local.

1 Like

Could you attach also the related systemd journals? I hope a redirect to file works:

journalctl > host.journal
journalctl -M nsdc > nsdc.journal
systemd-analyze plot > nsdc.svg

I put all the files together in a google link directory.

https://drive.google.com/folderview?id=0BzXWUMaIvtgcWHVTbUhNb1Q5NWM&usp=sharing

1 Like

I finally managed to reproduce it! It’s simpler than I have expected :smile:

  • no root ssh sessions: bug is present
  • active root ssh session: bug is not present

I guess it is related to PTY devices allocation and login sessions…

/cc @JeffBales @fasttech @GG_jr

Now we can find a fix for it!

8 Likes

1 Like

5 Likes

The bug has now its fix! Those who hit it (@fasttech, @JeffBales, @flatspin, @GG_jr, …) and the whole @quality_team: do you want to test it?

To reproduce the bug after installing nethserver-dc:

  • Close any ssh session

To install the fix:

 yum --enablerepo=nethserver-testing update nethserver-dc-1.0.2-1.13.gd587784.ns7

To properly cover the code changes, re-test the following use cases:

  • user creation/modification/deletion
  • group creation/modification/deletion
  • user password policy change
  • domain password policy change
  • admin-todo reminder on Dashboard for Administrator’s password
2 Likes

Come on guys, let’s test it and get back to us! Free bee offered :beers:

1 Like

:bee:?? for free?? what an offer! :smile:

Tests are in progress.

user creation/mofdification/deletion so far no errors

group creation/mofdification/deletion so far no errors

user password policy change no errors, but no changes noticeable.
If I change policy I still have to give 1 upper char, 1 number, 1 special char, 1 lower char and 7 in sum.
what’s the difference between strong and non strong. I thought that non strong is tha only 7 char must be set, no matter if upper lower special or what ever. Do I have to reboot ?

admin-todo remember on dash board worked I think. I set the password and than it disappeared

last: how to change domain password policy? :blush:

so far so good.

2 Likes

Ahahah :grinning: touchè! Thanks for answering my call friend!