How do I fix the ubuntu login loop?

I have tried the solutions from “Ubuntu gets stuck in a login loop“, but it won’t let me login. The correct password makes the screen go black and brings up the login screen again. I am running Ubuntu 18.04. This problem comes and goes, so a permanent fix world be nice.

My .xsession-errors says:

cannot connect to brltty at :0
upstart: update-notifier-cds main process (12218) terminated with status 1
upstart: indicator-power main process (2710) killed by TERM signal
upstart: indicator-datetime main process (2718) killed by TERM signal
upstart: indicator-printers main process (2723) killed by TERM signal
upstart: indicator-session main process (2725) killed by TERM signal
upstart: indicator-application main process (2736) killed by TERM signal
upstart: indicator-application pre-stop process (12481) terminated with status 255
upstart: gnome-session (Unity) pre-stop process (12482) terminated with status 127
upstart: bamfdaemon main process (2575) killed by TERM signal
upstart: unity-settings-daemon main process (2646) terminated with status 1
upstart: unity-panel-service main process (2656) terminated with status 1
upstart: indicator-bluetooth main process (2709) killed by TERM signal
upstart: Disconnected from notified D-Bus bus
upstart: hud main process (2644) terminated with status 1
upstart: at-spi2-registryd main process (2650) killed by HUP signal
upstart: gnome-session (Unity) main process (2653) killed by HUP signal
upstart: unity7 main process (2678) terminated with status 1
upstart: indicator-keyboard main process (2720) killed by HUP signal
upstart: indicator-sound main process (2721) killed by HUP signal
upstart: gpg-agent post-stop process (12485) killed by TERM signal