14

I can't open a new tab or new file in Scratch. Nothing happens when I click on the + icon and the following image occurs when I close all documents and select "New File".

Screenshot demonstrating the issue

Running scratch from the command line and selecting a new file gives me the following on terminal:

[_LOG_LEVEL_INFO 09:56:27.534393] Application.vala:157: Kernel version: 3.19.0-25-generic
[_LOG_LEVEL_DEBUG 09:56:27.535770] Settings.vala:158: Loading settings from schema 'org.pantheon.scratch.saved-state'
[_LOG_LEVEL_FATAL 09:56:27.612347] [Gtk] gtk_header_bar_pack: assertion 'gtk_widget_get_parent (widget) == NULL' failed
[_LOG_LEVEL_FATAL 09:56:27.612392] Scratch will not function properly.
[_LOG_LEVEL_FATAL 09:56:27.706954] file /build/scratch-text-editor-JxlBhk/scratch-text-editor-2.2.0~r1522/src/MainWindow‌​.vala: line 421: uncaught error: Arquivo ou diretório não encontrado (g-io-error-quark, 1)
[_LOG_LEVEL_FATAL 09:56:27.707004] Scratch will not function properly.
[_LOG_LEVEL_FATAL 09:56:27.707044] [Gtk] gtk_action_set_visible: assertion 'GTK_IS_ACTION (action)' failed
[_LOG_LEVEL_FATAL 09:56:27.707070] Scratch will not function properly. 
[_LOG_LEVEL_FATAL 09:56:27.707235] file /build/scratch-text-editor- JxlBhk/scratch-text-editor-2.2.0~r1522/src/MainWindow‌​.vala: line 421: uncaught error: Arquivo ou diretório não encontrado (g-io-error-quark, 1)
[_LOG_LEVEL_FATAL 09:56:27.707270] Scratch will not function properly.
[_LOG_LEVEL_DEBUG 09:56:27.709947] SplitView.vala:180: WelcomeScreen shown succefully
[_LOG_LEVEL_DEBUG 09:56:27.713487] Settings.vala:158: Loading settings from schema 'org.pantheon.scratch.plugins.folder-manager'
[_LOG_LEVEL_DEBUG 09:56:27.713872] MainWindow.vala:472: create 'unsaved' directory: /home/bpantoja/.local/share/scratch-text-editor/unsaved
[_LOG_LEVEL_FATAL 09:56:27.713949] file /build/scratch-text-editor-JxlBhk/scratch-text-editor-2.2.0~r1522/src/MainWindow‌​.vala: line 473: uncaught error: Erro ao criar o diretório: Permissão negada (g-io-error-quark, 14)
[_LOG_LEVEL_FATAL 09:56:27.713983] Scratch will not function properly.
[_LOG_LEVEL_DEBUG 09:56:29.189314] SplitView.vala:188: WelcomeScreen hidden succefully
[_LOG_LEVEL_DEBUG 09:56:29.191560] SplitView.vala:126: View added succefully
[_LOG_LEVEL_FATAL 09:56:29.191781] file /build/scratch-text-editor-JxlBhk/scratch-text-editor-2.2.0~r1522/src/Widgets/Do‌​cumentView.vala: line 103: uncaught error: Erro ao abrir arquivo "/home/bpantoja/.local/share/scratch-text-editor/unsaved/Ficheiro de texto de 2015-08-12 09:56:29": Arquivo ou diretório não encontrado (g-io-error-quark, 1)
[_LOG_LEVEL_FATAL 09:56:29.191834] Scratch will not function properly.
[_LOG_LEVEL_FATAL 09:56:30.724841] file /build/scratch-text-editor-JxlBhk/scratch-text-editor-2.2.0~r1522/src/Widgets/Do‌​cumentView.vala: line 103: uncaught error: Erro ao abrir arquivo "/home/bpantoja/.local/share/scratch-text-editor/unsaved/Ficheiro de texto de 2015-08-12 09:56:30": Arquivo ou diretório não encontrado (g-io-error-quark, 1)
[_LOG_LEVEL_FATAL 09:56:30.724916] Scratch will not function properly.
3
  • Could you check if source tree extension is enabled? Enabling it removes tab navigation for me Aug 11, 2015 at 13:08
  • How are you opening Scratch, via its icon or using the terminal command?
    – Gabriel
    Aug 11, 2015 at 13:23
  • 2
    It seems like you've changed the theme, and it's possible that's over-riding the hit-area for the +. Could you try reverting to default and try then? Also, repeat for the graphics driver, disable and retry?
    – Lewis Goddard
    Aug 11, 2015 at 15:47

1 Answer 1

19

This is due to a permissions bug that occurs when the first time you've run Scratch is as a privileged user. You end up with a directory in ~/.local/share/scratch-text-editor that you don't own.

To fix this issue:

  1. Make sure you don't have any unsaved files in Scratch when run as root (with the sudo command). This fix will delete those files.

  2. Open Terminal and use root permissions to remove the directory.

    sudo rm -rf ~/.local/share/scratch-text-editor

  3. Open Scratch as your own user (do not use the sudo command)

After this, you should no longer encounter the issue. In general, you should not run graphical applications using the sudo command since you can encounter these types of issues.

5
  • 1
    @BrunoMiranda Can you set your system language to English and then paste the output with a service like Pastebin? It sounds like there are still permissions issues, but I don't understand Portuguese very well :) Aug 12, 2015 at 16:42
  • 1
    @BrunoMiranda please add these details to your question instead of here in the comments.
    – RolandiXor
    Aug 13, 2015 at 3:44
  • @BrunoMiranda Ah sorry it looks like probably the whole directory is owned by root. I've updated my directions to delete the whole directory and not just the "unsaved' folder Aug 13, 2015 at 18:09
  • 1
    Hi Daniel, Sorry about the mistakes creating the question and the output in portuguese. Deleting the hole directory solved the issue. Thank you very much. Aug 14, 2015 at 19:26
  • Hey, this does not work. any help Feb 25, 2020 at 7:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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