Snap under Ubuntu 18.04 LTS

I have just finished installing Snap under Ubuntu 18.04 LTS. When I ran it after rebooting, it wouldn’t start, though, due to a lack of write permissions in /home/michael/.snap/system. I know this is not very elegant, but I just 666ed all folders and subfolders recursively with sudo chmod -R 666, which allowed me to start Snap. Now, I wanted to coregister Sentinel-1 data using Radar->Coregistration, and the error message becomes

java.io.FileNotFoundException: /home/michael/.snap/graphs/internal/coregistration/CoregistrationGraph.xml (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.(FileInputStream.java:138)
[catch] at org.esa.snap.graphbuilder.rcp.dialogs.GraphBuilderDialog.loadGraph(GraphBuilderDialog.java:389)
at org.esa.snap.graphbuilder.rcp.actions.GraphAction.createOperatorDialog(GraphAction.java:69)
at org.esa.snap.graphbuilder.rcp.actions.OperatorAction.actionPerformed(OperatorAction.java:62)
at org.openide.awt.AlwaysEnabledAction$1.run(AlwaysEnabledAction.java:199)
at org.openide.util.actions.ActionInvoker$1.run(ActionInvoker.java:95)
at org.openide.util.actions.ActionInvoker.doPerformAction(ActionInvoker.java:116)
at org.openide.util.actions.ActionInvoker.invokeAction(ActionInvoker.java:99)
at org.openide.awt.AlwaysEnabledAction.actionPerformed(AlwaysEnabledAction.java:202)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:842)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:886)
at java.awt.Component.processMouseEvent(Component.java:6539)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6304)
at java.awt.Container.processEvent(Container.java:2239)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2297)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
at java.awt.Container.dispatchEventImpl(Container.java:2283)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
at java.awt.EventQueue$4.run(EventQueue.java:733)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Any hints out there how to make Snap run flawlessly under Ubuntu 18.04?

Did you use “sudo” to run the installer? The permission problems could be due to many of the installed files being owned by “root”. What do you get for
ls -ld ~/.snap?

The error:

java.io.FileNotFoundException: /home/michael/.snap/graphs/internal/coregistration/CoregistrationGraph.xml (No such file or directory)

Is likely due to using 666 permissions. Contrary to “internet wisdom” “666” not the correct permissions because directories and executables need execute permission, and because giving everybody read and write access to files is a gift to black-hat hackers. Fixing the 666 permissions is not simple because you now need a way to set execute permission on only directories and executables (making everything executable is a security risk).

Many thanks for your reply!

Here’s what I get:
~$ ls -ld ~/.snap
drwxrwxr-x 4 root root 4096 Sep 15 12:51 /home/michael/.snap

How can I solve the 666 issue?

The ~/.snap directory should be owned by the user, not root. It looks like you installed using “root” privileges, and compounded the problem by setting 666 permissions. There is no easy way to recover – the best you can do is try to uninstall SNAP and start over. If you have a backup from before you installed SNAP you could restore up to the SNAP installation and install SNAP again. The uninstaller probably won’t work. If you have not already done so, you should install a python version from the list of supported versions. Then you can try installing as a normal user and use a supported python version with the installer.