When I open files as administrator and try to open a text file as root to edit it, scratch does not open. Wingpanel turns opaque as though scratch is maximized, but nothing displays. Eventually I get a message to force quit scratch.

I've tried:

  • setting all of the scratch related gsettings to default.
  • opening scratch using gksu in the terminal

This is the output when I try to open it using the terminal:

jesse@sp3:~$ gksu -d scratch-text-editor /etc/environment 
Gtk-Message: Failed to load module "pantheon-filechooser-module"
No ask_pass set, using default!
xauth: /tmp/libgksu-Yd2FDF/.Xauthority
STARTUP_ID: gksu/scratch-text-editor '|etc|environment'/4375-0-sp3_TIME344270
cmd[0]: /usr/bin/sudo
cmd[1]: -H
cmd[2]: -S
cmd[3]: -p
cmd[5]: -u
cmd[6]: root
cmd[7]: --
cmd[8]: scratch-text-editor
cmd[9]: /etc/environment
brute force GNOME_SUDO_PASS ended...
Yeah, we're in...
[INFO 21:16:05.505659] Application.vala:153: Scratch version: 2.4.1
[INFO 21:16:05.505702] Application.vala:155: Kernel version: 4.13.4-041304- generic
[DEBUG 21:16:05.513498] Settings.vala:163: Loading settings from schema   'org.pantheon.scratch.saved-state'
[DEBUG 21:16:05.513978] Settings.vala:163: Loading settings from schema 'org.pantheon.scratch.settings'
[DEBUG 21:16:05.514871] Settings.vala:163: Loading settings from schema 'org.pantheon.scratch.services'
[WARNING 21:16:05.538065] [Gtk] Theme parsing error: apps.css:282:10: 'height' is not a valid property name
[WARNING 21:16:05.538155] [Gtk] Theme parsing error: apps.css:300:10: 'height' is not a valid property name
[WARNING 21:16:05.538256] [Gtk] Theme parsing error: apps.css:316:10: 'height' is not a valid property name
[WARNING 21:16:05.538303] [Gtk] Theme parsing error: apps.css:317:9: 'width' is not a valid property name
[WARNING 21:16:05.538390] [Gtk] Theme parsing error: apps.css:331:10: 'height' is not a valid property name
[WARNING 21:16:05.538426] [Gtk] Theme parsing error: apps.css:332:9: 'width' is not a valid property name
[DEBUG 21:16:05.553159] [Gtk] Connecting to session manager
[WARNING 21:16:05.559052] [libpeas] Failed to enable unknown plugin loader 'gjs'
[WARNING 21:16:05.563827] [libpeas] Failed to enable unknown plugin loader 'gjs'
[FATAL 21:16:05.709597] MainWindow.vala:523: Error opening directory '/root/.local/share/scratch-text-editor/unsaved': No such file or directory
[FATAL 21:16:05.709630] [Gtk] gtk_action_set_visible: assertion 'GTK_IS_ACTION (action)' failed
[DEBUG 21:16:05.711977] SplitView.vala:202: WelcomeScreen shown successfully
[DEBUG 21:16:05.715935] Settings.vala:163: Loading settings from schema 'org.pantheon.scratch.plugins.folder-manager'
[DEBUG 21:16:05.716338] MainWindow.vala:578: created 'unsaved' directory: /root/.local/share/scratch-text-editor/unsaved
[DEBUG 21:16:05.718868] SplitView.vala:210: WelcomeScreen hidden successfully
[DEBUG 21:16:05.720042] SplitView.vala:125: View added successfully
[DEBUG 21:16:05.723757] sql-schema.vala:204: schema_version is 10
[DEBUG 21:16:05.748192] Document.vala:747: Could not find mount location
[INFO 21:16:05.748287] Document.vala:167: Opening "systemd-logind"

It looks like the Opening "systemd-logind" is what is causing it to hang, but I have no idea how to keep it from trying to open it. There is nothing set to open by default in gsettings.

  • try without gksudo, just use sudo scratch-text-editor – Pretzel Jones Oct 1 '17 at 20:27
  • still no go.... – Jesse Godfroy Oct 2 '17 at 13:20
  • Are you running any 3rd party theming? elementary tends to not play well with non-stock themes. – Pretzel Jones Oct 2 '17 at 14:17
  • stock theme... scratch opens fine as a regular user, it just won't open as root. – Jesse Godfroy Oct 3 '17 at 11:48
  • 1
    I've updated the question with the terminal output. – Jesse Godfroy Oct 3 '17 at 11:52

I managed to solve this by opening dconf editor as root (gksu dconf-editor) and then navigating to org/pantheon/scratch/settings and setting "focused-document-view1" and "opened-files-view1" to default.

I didn't realize there could be different settings for user and root.

| improve this answer | |

OK it looks like it might be an issue with Pantheon itself. I suggest removing and then reinstalling Pantheon:

sudo apt remove pantheon
sudo apt install pantheon

Reference: https://askubuntu.com/questions/684169/gtk-message-failed-to-load-module-pantheon-filechooser-module

| improve this answer | |
  • unfortunately that didn't help... also when removing pantheon it removed elementary-desktop, so I had to apt install elementary-desktop as well. – Jesse Godfroy Oct 3 '17 at 12:50
  • crap, sorry I missed the * after panteon. Glad you got that worked out. That's weird you're still experiencing the issue though. – Pretzel Jones Oct 3 '17 at 12:59
  • I'm shooting in the dark now but you might need the gnome-themes-standard libraries. It appears to be having an issue with base gnome themes while running gksudo. Give this a shot: sudo apt install gtk2-engines-pixbuf gnome-themes-standard libcanberra-gtk3-module:i386 libcanberra-gtk3-module – Pretzel Jones Oct 3 '17 at 13:01
  • I've updated the question with new terminal output... it looks like it could be hanging while trying to open "systemd-logind" – Jesse Godfroy Oct 3 '17 at 13:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.