Bug 1112109 - [Build 20181015] openQA test fails trying to write to serial device /dev/ttyS0 as root with "Input/output error" - agetty failed in background
[Build 20181015] openQA test fails trying to write to serial device /dev/ttyS...
Status: VERIFIED WORKSFORME
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Other
Current
Other Other
: P5 - None : Major (vote)
: ---
Assigned To: E-mail List
E-mail List
https://openqa.opensuse.org/tests/775...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-10-17 07:28 UTC by Oliver Kurz
Modified: 2019-04-05 09:44 UTC (History)
3 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: Yes
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Kurz 2018-10-17 07:28:44 UTC
## Observation

openQA test in scenario opensuse-Tumbleweed-DVD-x86_64-gnuhealth@64bit fails in
[gnuhealth_install](https://openqa.opensuse.org/tests/775786/modules/gnuhealth_install/steps/5)
on the command `whoami > /dev/ttyS0` as root .

in https://openqa.opensuse.org/tests/775786/file/gnuhealth_install-journal.log it says

```
Oct 17 02:12:09 susetest agetty[1849]: /dev/ttyS0: not a tty
```

and then later

```
Oct 17 02:12:19 susetest systemd[1]: serial-getty@ttyS0.service: Service RestartSec=100ms expired, scheduling restart.
Oct 17 02:12:19 susetest systemd[1]: serial-getty@ttyS0.service: Scheduled restart job, restart counter is at 1.
Oct 17 02:12:19 susetest Stopped Serial Getty on ttyS0.
Oct 17 02:12:19 susetest systemd[1]: Started Serial Getty on ttyS0.
```

so a lot of stuff going on regarding ttyS0 and also it is not exactly new: https://openqa.opensuse.org/tests/763584#step/gnuhealth_install/5 from 18 days ago


## Reproducible

Fails since (at least) Build [20181015](https://openqa.opensuse.org/tests/775239)


## Expected result

Last good: [20180815](https://openqa.opensuse.org/tests/734371/)
we can consider ourselves lucky that there was a bug a bit later in the test 2 months ago because we have the journal file showing that there is no problem (or I could not find one): https://openqa.opensuse.org/tests/734371/file/gnuhealth_install-journal.log , there is just

```
Aug 16 18:26:39 susetest systemd[1]: Started Serial Getty on ttyS0.
```

no further message.


## Further details

Always latest result in this scenario: [latest](https://openqa.opensuse.org/tests/latest?distri=opensuse&machine=64bit&version=Tumbleweed&arch=x86_64&flavor=DVD&test=gnuhealth)
Comment 1 Rodion Iafarov 2018-10-18 13:18:56 UTC
So, I found easy way to reproduce the error.
Start writing to ttyS0 in infinite loop: while true; do echo bb > /dev/ttyS0 ; done
run systemctl stop serial-getty@ttyS0
"Input/output error" is shown for all attempts to write to tty in the loop. Once command stopped and started again, it works fine again.

Why serial-getty could not start on time is still not clear.
Comment 2 Rodion Iafarov 2018-10-18 15:23:54 UTC
I've cross checked and this issue is not there in SLE 12 SP3 GM build.

Irregardless of the reason why serial-getty service gets restarted, for SLE 12 SP3, "Input/output error" doesn't occur.
Comment 3 Rodion Iafarov 2018-10-18 15:29:43 UTC
Ok, so I guess that's potential fix we need: 
https://github.com/rear/rear/pull/1649/files

In the journal we have:

Oct 10 20:20:51 susetest systemd[1]: Started Hold until boot process finishes up.
Oct 10 20:20:51 susetest systemd[1]: Started Serial Getty on ttyS0.
Oct 10 20:20:51 susetest systemd[1]: Started Serial Getty on hvc0.
Oct 10 20:20:51 susetest systemd[1]: Started Getty on tty1.
Oct 10 20:20:51 susetest agetty[1819]: /dev/ttyS0: not a tty
Comment 4 Rodion Iafarov 2018-10-22 08:25:13 UTC
Same issue happens on SLE 15 SP1.
Comment 5 Dr. Werner Fink 2019-03-12 08:57:11 UTC
(In reply to Oliver Kurz from comment #0)
> ## Observation

> ```
> Oct 17 02:12:09 susetest agetty[1849]: /dev/ttyS0: not a tty
> ```

(In reply to Rodion Iafarov from comment #3)
> Ok, so I guess that's potential fix we need: 
> https://github.com/rear/rear/pull/1649/files
> 
> In the journal we have:
> 
> Oct 10 20:20:51 susetest systemd[1]: Started Hold until boot process
> finishes up.
> Oct 10 20:20:51 susetest systemd[1]: Started Serial Getty on ttyS0.
> Oct 10 20:20:51 susetest systemd[1]: Started Serial Getty on hvc0.
> Oct 10 20:20:51 susetest systemd[1]: Started Getty on tty1.
> Oct 10 20:20:51 susetest agetty[1819]: /dev/ttyS0: not a tty

Beside the fix in the commit for the DefaultInstance ... does you test system have a usable ttyS0 around? No only the file /dev/ttyS0 but is it readable with
e.g. cat < /dev/ttyS0 ... for this ttyS0 should be connected ... let us see the out put of

   find /sys/devices/ -name ttyS0
   sudo dmesg -T | grep ttyS0

Also I miss the hardware above in the description ... `Other' is a bit useless
Comment 7 Dr. Werner Fink 2019-04-02 13:04:56 UTC
can we get an answer, if not please close this bug
Comment 8 Rodion Iafarov 2019-04-05 09:37:46 UTC
(In reply to Dr. Werner Fink from comment #7)
> can we get an answer, if not please close this bug

Issue doesn't appear in the latest build, so resolving. Thanks!
Comment 9 Rodion Iafarov 2019-04-05 09:44:49 UTC
Build20190404