Ubuntu 18.04 restarting everytime when idle for too long probably crashes

I have been experiencing this issue from 1 month and I thought it was some bug. But It started to reappear.

logs from dmseg

[  188.894288] aufs au_opts_verify:1609:dockerd[2612]: dirperm1 breaks the protection by the permission bits on the lower branch [  190.981028] systemd-journald[359]: File /var/log/journal/29e10902478d4243ba0e6fa5863ac289/user-1000.journal corrupted or uncleanly shut down, renaming and replacing. [  205.206572] Bluetooth: RFCOMM TTY layer initialized [  205.206578] Bluetooth: RFCOMM socket layer initialized [  205.206584] Bluetooth: RFCOMM ver 1.11 [  211.331190] rfkill: input handler disabled [  212.924709] pcieport 0000:00:1c.4: AER: Corrected error received: 0000:00:1c.4 [  212.924726] pcieport 0000:00:1c.4: PCIe Bus Error: severity=Corrected, type=Data Link Layer, (Transmitter ID) [  212.924734] pcieport 0000:00:1c.4:   device [8086:9d14] error status/mask=00001000/00002000 [  212.924740] pcieport 0000:00:1c.4:    [12] Timeout                [  745.649772] pcieport 0000:00:1c.4: AER: Multiple Corrected error received: 0000:00:1c.4 [  745.649833] pcieport 0000:00:1c.4: PCIe Bus Error: severity=Corrected, type=Data Link Layer, (Transmitter ID) [  745.649841] pcieport 0000:00:1c.4:   device [8086:9d14] error status/mask=00001000/00002000 [  745.649846] pcieport 0000:00:1c.4:    [12] Timeout                [  852.614344] rfkill: input handler enabled [  856.993369] rfkill: input handler disabled [ 1615.828215] audit: type=1400 audit(1568653194.068:99): apparmor="DENIED" operation="open" profile="snap.gnome-logs.gnome-logs" name="/proc/5176/mountinfo" pid=5176 comm="gmain" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000 [ 1615.828447] audit: type=1400 audit(1568653194.068:100): apparmor="DENIED" operation="open" profile="snap.gnome-logs.gnome-logs" name="/etc/fstab" pid=5176 comm="gnome-logs" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0 [ 1615.828484] audit: type=1400 audit(1568653194.068:101): apparmor="DENIED" operation="open" profile="snap.gnome-logs.gnome-logs" name="/proc/5176/mountinfo" pid=5176 comm="gnome-logs" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000 [ 1615.828513] audit: type=1400 audit(1568653194.068:102): apparmor="DENIED" operation="open" profile="snap.gnome-logs.gnome-logs" name="/proc/5176/mounts" pid=5176 comm="gnome-logs" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000 [ 1616.340450] audit: type=1400 audit(1568653194.580:103): apparmor="DENIED" operation="open" profile="snap.gnome-logs.gnome-logs" name="/proc/5176/mountinfo" pid=5176 comm="gnome-logs" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000 [ 1616.340457] audit: type=1400 audit(1568653194.580:104): apparmor="DENIED" operation="open" profile="snap.gnome-logs.gnome-logs" name="/proc/5176/mounts" pid=5176 comm="gnome-logs" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000 [ 1616.347915] audit: type=1400 audit(1568653194.588:105): apparmor="DENIED" operation="open" profile="snap.gnome-logs.gnome-logs" name="/home/akhil/.profile" pid=5176 comm="pool" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000 [ 1616.347922] audit: type=1400 audit(1568653194.588:106): apparmor="DENIED" operation="open" profile="snap.gnome-logs.gnome-logs" name="/home/akhil/.bash_logout" pid=5176 comm="pool" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000 [ 1616.347999] audit: type=1400 audit(1568653194.588:107): apparmor="DENIED" operation="open" profile="snap.gnome-logs.gnome-logs" name="/home/akhil/.profile" pid=5176 comm="pool" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000 [ 1616.348298] audit: type=1400 audit(1568653194.588:108): apparmor="DENIED" operation="open" profile="snap.gnome-logs.gnome-logs" name="/home/akhil/.python_history" pid=5176 comm="pool" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000 [ 1621.965762] kauditd_printk_skb: 48 callbacks suppressed [ 1621.965767] audit: type=1400 audit(1568653200.208:157): apparmor="DENIED" operation="open" profile="snap.gnome-logs.gnome-logs" name="/proc/5176/mountinfo" pid=5176 comm="gnome-logs" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000 [ 1621.965783] audit: type=1400 audit(1568653200.208:158): apparmor="DENIED" operation="open" profile="snap.gnome-logs.gnome-logs" name="/proc/5176/mounts" pid=5176 comm="gnome-logs" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000 

It is particularly showing,

PCIe Bus Error: severity=Corrected, type=Data Link Layer, (Transmitter ID) several times.

Contents of var/log/syslog

var/log/syslog

Ubuntu 18.04 restarting by itself after shutdown

I know there are already plenty questions here related to this one, but I can’t find an answer which solves my problem.

I’ve installed a fresh Ubuntu 18.04 on a Dell Optiplex 9020 SFF. And now I’m trying to make WOL – Wake On Lan – working. The first step I’ve done was to activate WOL in BIOS and deactivate Deep Sleep. And it seems to just work as expected.

I can shutdown PC and wake it up with a magic packet (and do it an unlimited number of times).

But if I choose to restart/reboot, the PC will do it normally and then if I try to shut it down (with the button on the top-right of the screen (or with a shutdown now, shutdown -H now) it will shutdown, wait 3 seconds, and then reboot by itself. The only way to shut it down is to long press the hardware power button. And then it reworks as expected (with WOL) until the next reboot/restart is issued.

I’ve tried several things in /etc/default/grub like adding acpi=force apm=power_off or noapic or reboot=a,w followed by an update-grub. I’ve also updated my BIOS to latest version (A25). But nothing works.

I think the problem is when I trigger a reboot, something change somewhere and make following shutdown working a bit differently and cause computer to reboot by itself.

I’ve maybe a clue after investigating journalctl. When I trigger a normal shutdown (without a reboot before):

sept. 07 00:57:28 barbie systemd[1]: Reached target Shutdown. sept. 07 00:57:28 barbie systemd[1]: Reached target Final Step. sept. 07 00:57:28 barbie systemd[1]: Starting Power-Off... sept. 07 00:57:28 barbie systemd[1]: Shutting down. sept. 07 00:57:28 barbie kernel: printk: systemd-shutdow: 40 output lines suppressed due to ratelimiting sept. 07 00:57:28 barbie systemd-shutdown[1]: Syncing filesystems and block devices. sept. 07 00:57:28 barbie systemd-shutdown[1]: Sending SIGTERM to remaining processes... sept. 07 00:57:28 barbie systemd-journald[431]: Journal stopped 

And when I trigger a shutdown (with a reboot before):

sept. 07 00:59:08 barbie systemd[1]: Reached target Shutdown. sept. 07 00:59:08 barbie systemd[1]: Reached target Final Step. sept. 07 00:59:08 barbie systemd[1]: Starting Power-Off... sept. 07 00:59:08 barbie systemd[1]: Shutting down. sept. 07 00:59:08 barbie kernel: printk: systemd-shutdow: 39 output lines suppressed due to ratelimiting sept. 07 00:59:08 barbie systemd-shutdown[1]: Syncing filesystems and block devices. sept. 07 00:59:08 barbie systemd-journald[426]: Journal stopped 

Note the missing line: systemd-shutdown[1]: Sending SIGTERM to remaining processes... Maybe it explains why the computer reboot by itself ?

That’s all I’ve done so far. Your clues/ideas are welcome. Thanks!

How to avoid restarting nginx to renew letsencrypt certificate?

I have installed a Nginx server to host my website, and added HTTPS with LetsEncrypt.

The problem is every time the certificate expire, my site become inaccessible and I need to manually restart the service using So every two months or so I am forced to manually do a:

sudo service nginx restart 

I tried automating that several time already but failed. My last attempt was using this:

sudo crontab -e   0 0,12 * * * letsencrypt renew >/dev/null 2>&1  1 0,12 * * * root /etc/init.d/nginx reload 

Is this the wrong way? How can I validate this job works without waiting my site to be inacessible again?

Mysql down after restarting server

I have an Ubuntu 16.04 server with ISPConfig 3.1.

For some reason, the server was working too much on a process with high load, so I restarted the PC. After that, Mysql stopped working and couldn’t be restarted anymore.

I got these messages after trying to restart the service:

Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details. 

systemctl status mysql.service:

● mysql.service - LSB: Start and stop the mysql database server daemon Loaded: loaded (/etc/init.d/mysql; bad; vendor preset: enabled) Active: failed (Result: exit-code) since jue 2019-08-22 18:58:05 -04; 41s ago Docs: man:systemd-sysv-generator(8) Process: 12020 ExecStop=/etc/init.d/mysql stop (code=exited, status=0/SUCCESS) Process: 12056 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE) 

journalctl -xe:

ago 22 18:58:32 servidor1 mysqld[12230]: /usr/sbin/mysqld[0x955d0c] ago 22 18:58:32 servidor1 mysqld[12230]: /usr/sbin/mysqld[0x93b08e] ago 22 18:58:32 servidor1 mysqld[12230]: /usr/sbin/mysqld[0x93cd7f] ago 22 18:58:32 servidor1 mysqld[12230]: /usr/sbin/mysqld[0xa1dd9d] ago 22 18:58:32 servidor1 mysqld[12230]: /usr/sbin/mysqld[0xa670b6] ago 22 18:58:32 servidor1 mysqld[12230]: /usr/sbin/mysqld[0x9ba375] ago 22 18:58:32 servidor1 mysqld[12230]: /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f8ba90256ba] ago 22 18:58:32 servidor1 mysqld[12230]: x86_64/clone.S:111(clone)[0x7f8ba84cc41d] ago 22 18:58:32 servidor1 mysqld[12230]: The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains ago 22 18:58:32 servidor1 mysqld[12230]: information that should help you find out what is causing the crash.   ago 22 18:58:52 servidor1 dovecot[904]: auth-worker(12400): Error: sql(dmiranda@comercialkod.cl,152.172.252.195): Password query failed: Not connected to database ago 22 18:58:52 servidor1 dovecot[904]: auth: Error: auth worker: Aborted PASSV request for dmiranda@comercialkod.cl: Lookup timed out ago 22 18:58:52 servidor1 dovecot[904]: auth-worker(12673): Error: mysql(localhost): Connect failed to database (dbispconfig): Can't connect to local MySQL server throug ago 22 18:58:53 servidor1 dovecot[904]: auth-worker(12673): Error: mysql(localhost): Connect failed to database (dbispconfig): Can't connect to local MySQL server throug ago 22 18:58:54 servidor1 dovecot[904]: imap-login: Aborted login (auth failed, 1 attempts in 62 secs): user=<dmiranda@comercialkod.cl>, method=PLAIN, rip=152.172.252.19 ago 22 18:58:58 servidor1 dovecot[904]: auth-worker(12673): Error: mysql(localhost): Connect failed to database (dbispconfig): Can't connect to local MySQL server throug ago 22 18:59:01 servidor1 CRON[12687]: pam_unix(cron:session): session opened for user root by (uid=0) ago 22 18:59:01 servidor1 CRON[12686]: pam_unix(cron:session): session opened for user root by (uid=0) ago 22 18:59:01 servidor1 CRON[12688]: (root) CMD (/usr/local/ispconfig/server/cron.sh 2>&1 | while read line; do echo `/bin/date` "$  line" >> /var/log/ispconfig/cron.log ago 22 18:59:01 servidor1 CRON[12689]: (root) CMD (/usr/local/ispconfig/server/server.sh 2>&1 | while read line; do echo `/bin/date` "$  line" >> /var/log/ispconfig/cron.l ago 22 18:59:01 servidor1 CRON[12686]: pam_unix(cron:session): session closed for user root ago 22 18:59:23 servidor1 dovecot[904]: auth-worker(12673): Error: mysql(localhost): Connect failed to database (dbispconfig): Can't connect to local MySQL server throug ago 22 18:59:25 servidor1 su[12004]: pam_unix(su:session): session closed for user root ago 22 18:59:25 servidor1 sudo[12003]: pam_unix(sudo:session): session closed for user root ago 22 18:59:27 servidor1 dovecot[904]: auth-worker(12673): Error: mysql(localhost): Connect failed to database (dbispconfig): Can't connect to local MySQL server throug ago 22 18:59:28 servidor1 dovecot[904]: auth-worker(12673): Error: mysql(localhost): Connect failed to database (dbispconfig): Can't connect to local MySQL server throug ago 22 18:59:33 servidor1 dovecot[904]: auth-worker(12673): Error: mysql(localhost): Connect failed to database (dbispconfig): Can't connect to local MySQL server throug ago 22 18:59:34 servidor1 sudo[12790]: surempresa : TTY=pts/20 ; PWD=/home/surempresa ; USER=root ; COMMAND=/bin/su ago 22 18:59:34 servidor1 sudo[12790]: pam_unix(sudo:session): session opened for user root by (uid=0) ago 22 18:59:34 servidor1 su[12809]: Successful su for root by root ago 22 18:59:34 servidor1 su[12809]: + /dev/pts/20 root:root ago 22 18:59:34 servidor1 su[12809]: pam_unix(su:session): session opened for user root by (uid=0) ago 22 18:59:34 servidor1 su[12809]: pam_systemd(su:session): Cannot create session: Already running in a session 

However, I managed to restart the service after I tried the solution from this post:

Can't start MySQL server (database corruption)

So I set:

[mysqld] innodb_force_recovery = 1 

But, it doesn’t work well since some database tables are now read only.

What should I do instead? Thank you.

Ubuntu restarting automatically when idle for some time

Recently I had to reinstall Ubuntu (18.04 LTS) on my desktop. Now I am facing two issues.

  1. It takes almost 3 minutes to boot the computer.
  2. When idle for some time, Ubuntu restarts automatically.

System Configuration:

Graphics : Intel® Haswell Desktop GNome: 3.28.2 OS Type: 64 bit Processor: Intel® Core™ i5-4440 CPU @ 3.10GHz × 4  Memory: 3.7 GiB 

Thanks in advance.

Constantly Restarting of SQL Instances in GCP

I have 4 instances of SQL in GCP, all of this are restarting constantly.

This is the log from one of this:

From today this problem is happening, and they go 5 times on this day, I can not find more information. Please, any ideas of what I have to do?

The Properties of this Instance:

Generation                  1st Generation Database version            MySQL 5.5 Backup window               1:00 AM — 5:00 AM (UTC-5) Binary log                  Disabled File system replication     Asynchronous Preferred location          Follow app "xxxxxxxxx" Tier                        D16 Pricing plan                Package Activation Policy           Always Labels                      d16 Storage usage               18GB Read/write operations avg   6/s Mysql queries avg           40/s Read/write InnoDB pages avg 5/s InnoDB data fsync           4/s InnoDB log fsync            4/s Active connections          20/s 

I suspect of Backup Operations, but how stop that? In Operations Logs appears this Jun 27, 2019, 3:02:46 AM Backup An unknown error occurred
Jun 26, 2019, 4:16:15 AM Backup An unknown error occurred
Jun 26, 2019, 3:16:14 AM Backup An unknown error occurred

Thanks in advance

xrandr once configured, it resets after new reboot, keep restarting INVERTED

There is an HP notebook Pavillion DV6 4gb ram, 15 inch monitor single, HDMI and VGA connections, processor AMD A6. Successfully installed this Ubuntu 19 release. But, after a reset, it keep running monitor display 180 degrees rotated. Then , I use xrandr with NORMAL option, and it works only in my session: xrandr –output LDVS –rotate normal After a reboot, in a new session, the monitor appears INVERTED again. By the other hand, after adjusting monitor screen intensity with keypad buttons, after a reboot the screen appears with TOTAL light adjustment, again. How can I permanently set my config options.? Thanks in advance.

Keeps restarting, stuck in Ultra Power Save Mode

I’m asking on behalf of a family member who has a Samsung Galaxy S5. The phone is unrooted and has been updated but not to Android Marshmallow. The OTA had not been released for Marshmallow for this phone by our carrier.

There were many previous issues months ago but permanently removing the SD card and a firmware update through Samsung Kies solved those. The phone has had no significant issues for the last 5 months.

Recently, the phone was put on Ultra Power Save mode to save battery life. Immediately it shut itself down and kept restarting into Ultra Power Save mode and has done this for 3 weeks.

When it starts there are a few seconds before it restarts again. The screen is grey (no color) and most apps are disabled or not shown. The settings menu has very limited functionality and there is no way to disable Ultra Power Save Mode.

Going into safe mode does not change anything (the phone just restarts again in a few seconds). I’ve gone into Recovery Mode and cleared the cache but that did not do anything. I have not done a factory reset as I would be losing a family member’s numerous wedding pictures if I did that.

The phone has not had any physical damage. It is out of warranty but locked to a 2 year contract. The only solution to stop it from restarting is to remove the battery.

Is there any way to get it out of Ultra Power Save Mode? Would a factory reset help at all? We really would prefer to do that as we would lose the many pictures. I read about bootloaders but I don’t understand that well enough (also note that I’ve permanently removed the SD card — if I would need that in order to use this feature). I read something about trying commands through Google Now but I can’t do that unless I am doing it wrong. I tried connecting the phone to a PC and starting Kies but Kies does not recognize the device (as the device is not on long enough). The PC itself only recognizes the device for the few seconds that it is on. I’ve tried charging it, removing the SIM card, and also leaving the phone off for days but nothing has worked. I use Ultra Power Save Mode often on my own phone but had not used it on this phone before.

Thank you for helping.