[Workaround] Plasma5 session fails to start !

UPDATE 3 : Finally, I’ve found a proper workaround for this issue(yes, I actually reported this one : https://bugs.kde.org/show_bug.cgi?id=343772). Unfortunately, no one else has been able to reproduce this bug and hence we can’t confirm this as a bug as yet. Nevertheless, Aleix Pol who happens to look after Multiscreen support for plasmashell suggested me to try removing the kscreen settings on startup, if the issue surfaced. Here’s the solution, rm -r ~/.local/share/kscreen and start the session. Should work πŸ™‚

This is basically, a note to myself. I’ve been facing a lot of troubles recently, with the my installation of plasma5(which I happen to run on Kubuntu 14.10 Tech Preview, which was released with known bugs). In addition, since I’m on the ppa:kubuntu/ci, every update/upgrade fetches me fixes(and at times breaks), I think(You can correct me if I’m wrong here).

So, my troubles started just two days before. Everything seemed to be going fine when I noticed that, after a customary upgrade/dist-upgrade, I had held broken pacakges. To make matters worse, it was Kwin, which had held unmet dependencies. This was potentailly calmitous. This meant that not only would I not have a window manager, but I’d also not be able to install any new packages unless the broken packages were fixed. Action had to be taken. My good friend, Tony Thomas, came along and helped me somehow install aptitude, and using the same we were able to arrive at a solution(suggested by aptitude). Tony felt that it’d be enough, as it had removed/fixed all broken packages. But I knew, things had gone wrong on the next boot. I noticed that there were no window decorations on any application/file that I opened. Obviously, Kwin was missing, I was naive enough to install β€œkwin”, not via aptitude but via apt-get, and boom ! The broken packages were back. All of Tony’s work had now gone in wain. With one command, I’d undone all the good work that he’d done. I’d had enough !

That installation had only 23GB allocated and was left with something around 8GB of free space. And incidentally, that is where I was doing all my SoK work as well. So, for a long while, I’d wanted to extend the partition space and this situation provided me with a nice excuse for doing the same. I got hold of the Kubuntu 14.10 (Tech Preview) ISO, did a fresh install with 120 GiG’s of space allotted this time(which I believe should be enough) and added the unstable ppa(i.e kubuntu/ci) and ran a full-upgrade. Finally, my installation was now ready to have the git packages.

Considering what had already happened, I was mindful to install β€œDoctors” like Gparted, aptitude, boot-repair(and OS-uninstaller) before proceeding any further. I was enjoying my new OS, untill suddenly this afternoon, when I had to shift labs, I noticed that I couldn’t login on a reboot. I then made sevral attempts to login, and never really succeeded. The splash screen(with sddm) would show up, and fail midway through leaving nothing but a blank screen. I’d been to something similar before and I didn’t like it even back then. I was however able to get back to my system via recovery mode. The only problem, as far as I am concerned, is that when you boot via recovery mode, your rendering backend is set to XRender and that, somehow, I’ve never really liked. I open up the compositor to see two options(verisons) of OpenGL(2.0 and 3.1) but they can’t be set when you boot up this way(in recovery mode). I was geting desperate, I notified my mentor about the same, but he was not around. I dropped into IRC channels, but I guess they were busy. I didn’t get a response, which is something you’d have gotten used to if you’ve been using IRC for a while. So now I tried a few random things and on one distinct occasion, I was able to get my desired settings on plasmashell. \o/ I thought I’d solved the riddle and had already begun celebrations, which were short lived as on a reboot(yet again :\) I encountered the same problem again. I spent some time looking for other(better and neater) workarounds, but failed miserably. After returning to my hostel room, I tried reproducing an error, which actually helps in starting the Xsession. I’m not entirely sure what happens here, I do have a few guesses, but the bottomline is that it works and that is priceless. It’s a dirty workaround, but one that works. I’m listing the steps that I carried out. It should come in handy in the future as well πŸ™‚

  1. Open up a TTY and kill the already running sddm service.

    $ sudo service sddm stop
  2. Clear all the cache and remove the kwinrc file in the config

    $ rm -rf ~/.cache
    $ rm ~/.config/kwinrc
    $ kbuildsycoca5
    $ sudo startx  --> (This will fail !)
  3. Now that we’ve tried runing an Xsession as root user. You’ll notice a lot of files in the home dir that have permissions set to root. Quicky change the permission of the ~/.Xauthority to your user. Repeat steps 2 and 3 and start a new Xsession with the command startx
  4. Now you’ll get an error dialog saying that bookmarks etc could not be stored and a possible reason being that your hard disk is full. The reason is however because the files in ~/.local/share/kfileplaces have root permissions. We have only logged in as a normal user(startx)
  5. Now, I’m not sure, but I **think** that the splash screen which would earlier disappear midway through now stays as you’re being displayed an error dialog.
  6. If you cater to that error dialog now, the screen again goes blank, so :

    $ killall plasmashell
    $ sudo plasmashell

    Once you’ve done that, you can close the error dialog and now set about changing the permissions for required files in your home directory, for eg : the ~/.local/share/kfileplaces/ and a few others. Again remove cache, run the kbuildsycoca5 and just to be sure, you can now restart plasmashell(killall plasmashell && plasmashell) and sure enough, you should be running plasmashell with OpenGL as the rendering backend.

The only drawback with this workaround, that I can see is that since we’re deleting cache over everytime, all your desktop settings(for eg: pager settings etc) will be wiped away and you’ll need to start from scratch everytime.

As a matter of fact, maybe this does work without having to clear the cache everytime. I haven’t tried it. I’ll keep you posted, in case πŸ™‚

UPDATE : Since, posted this, I’ve been able to login to plasma session and haven’t been facing the problem which made me write this blog post in the first place. What a pleasant surprise ! πŸ™‚ However, I do expect to have to workaround sooner rather than later :\

UPDATE 2 : Things have happened rather quickly. I thought this workaround had solved this problem. I was happily working on my plasma5, connected to an external display. When I disconnected it and restarted, I noticed the problem was back. Out of intuition, I connected to an external display again and this time, the screen didn’t go blank. Now the problem was clear, after consulting with my mentor, I decided to go ahead and file a bug :Β https://bugs.kde.org/show_bug.cgi?id=343339 . I feel it’s a grave one and it should be fixed soon. I’m sure it’s fix is known to the devs since this problem came into existence only recently, so it’s probably some code that was pushed in that has overlooked this case. Hope to have this fixed soon πŸ™‚

Advertisements

8 thoughts on “[Workaround] Plasma5 session fails to start !

  1. I can confirm that this works! I’m using Xrender by default because of the mb chip is old. I haven’t really done anything but after plasmashell has crashed, nothing loaded. I’ve searched for solutions and this works, configuration is lost though. 15.04 vivid vervet, plasma 5.2.2

  2. I wasn’t able to reproduce this bug, but I was desperate and happy at the same time since firefox was running in the previous session, so only firefox started but there were no panel at all. I looked for solutions, none of them worked. Your solution worked, and I too, reported this bug to:
    “https://bugs.kde.org/show_bug.cgi?id=342438”
    They’re saying that ‘startx’ should not be used. I think by deleting the cache and rebuilding the desktop files with kbuildsycoca5 solved it eventually. Thanks for it.

  3. Awesome! And after a full half-day searching a fix, “`rm -r ~/.local/share/kscreen/*“` let me back into my plasma 5.5.5 session πŸ™‚

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s