Shutter - Screenshot Tool

Error while adding the file monitor. Unsupported operation

Reported by Iestyn Guest on 2012-05-23
104
This bug affects 20 people
Affects Status Importance Assigned to Milestone
Shutter
Medium
Mario Kemper (Romario)

Bug Description

Hi there,

I guess I'm missing some critical component needed by Shutter. I'm running Ubuntu 12.04 Precise 64-bit. The backstory is that this was a Kubuntu 12.04 box. I installed unity and removed everything KDE.

When I start Shutter from the command line I get no error messages. Only after I snap the first screenshot do I get the above error message. Also, after I snap the first screenshot, I'm unable to close the tab of the first image. The terminal windows then outputs this error:

*** unhandled exception in callback:
*** Can't call method "cancel" on an undefined value at /usr/bin/shutter line 5728.
*** ignoring at /usr/bin/shutter line 2902.

I'm no perl expert, but it looks like to close the currrent tab we need to get the current file name or file handle?. Perhaps the file name is not available due to the error about not being able to add the file monitor.

Short of re-installing the whole OS, any ideas on what I should check for? Perhaps a missing package?

Thanks,

Iestyn Guest.

Iestyn Guest (iguest) wrote :

Umm, well, the screenshots save automatically in /home/iguest/Pictures/ As it happens /home/ is located on an NFS share drive.

So, last night I formatted the disk and installed Ubuntu 12.04 fresh (not Kubuntu). Remounted my NFS share, and the error (Error while adding the file monitor. ) came right back again.

I suspected that either NFS is the problem, or something in my home directory... So, I created a new test user account. Ubuntu creates the users home directory on the NFS share ( /home is mapped to the NFS share) - All is well. Shutter works flawlessley in the new account over NFS. The problem must be something is my own home account. I've checked file and group permissions on all files and directories. Even unmounted .gvfs and deleted it. Rebooted - Same problem still. Not sure what else to check. Any ideas?

Iestyn Guest (iguest) wrote :

Hi there,

It appears I made a mistake while setting up my test cases last night (it was late).

NFS looks like the problem. If I comment out the line in /etc/fstab to mount the NFS share ( and reboot ), then create a new account on the local hard disk, Shutter works fine. If I use the Ubuntu guest account (Which is created in /tmp/) shutter work fine also. If I mount the NFS share (edit fstab & reboot) and then create a new user account that lives on that share, Shutter gives me the file monitor error.

Thanks for being patient.

Kind regards,

Iestyn

Iestyn Guest (iguest) wrote :

Hello,

Just a quick update - Although not ideal, I've found a work arround to this problem:

1. Deleted the local .shutter/ directory in my home.
2. Start Shutter.
3. Leave "Automatically save file" enabled.
4. Edit -> Preferences. Set Directory to /tmp/

This way the files aren't automatically saved to my NFS $HOME, but are saved local on the machine. If I need to do something with an image, I can use Nautilus or cp to copy it from /tmp to my $HOME.

For reference my fstab mount string looks like this:
192.168.1.151:/home /home nfs rw,intr,soft,noquota,noatime,rsize=8192,wsize=8192,tcp,nolock,async

Kind regards,

Iestyn

Thanks for your detailed explanations, Iestyn. I am afraid there is no quick fix available here, because GnomeVFS doesn't seem to support monitoring on NFS mounts. There is a migration task to track the GIO transition: https://bugs.launchpad.net/shutter/+bug/1006290

Hopefully GIO supports NFS mounts in this case.

Changed in shutter:
assignee: nobody → Mario Kemper (Romario) (mario-kemper)
importance: Undecided → Medium
milestone: none → road-to-gtk3
status: New → Confirmed
Iestyn Guest (iguest) wrote :

Thanks so much for looking into this.

There's some interesting reading on GIO here: http://en.wikipedia.org/wiki/GIO_(GNOME)

Also an interesting read is this posting from Alexander Larsson (Red hat) to the gtk-devel-list explaining the short comings of gnome-vfs. https://mail.gnome.org/archives/gtk-devel-list/2006-September/msg00072.html

Perhaps in the interim I'll try Samba instead of NFS - Who knows; perhaps it will work. My current workaround isn't all that bad anyhow.

Thanks, again.

Kind regards,

Iestyn Guest

Profpatsch (profpatsch) wrote :

Same issue here, on a complete different configuration:

When taking a screenshot and the program starts, the error popup appears for each tab that gets loaded in the main window. After that the tabs are non-closable and throw this error message on the console when the x on the tab is clicked:
*** unhandled exception in callback:
*** Can't call method "cancel" on an undefined value at /usr/bin/shutter line 5737, <DATA> line 19.
*** ignoring at /usr/bin/shutter line 2921, <DATA> line 19.

Config:
Shutter 0.89.1 Rev. 1228
Archlinux (installed from AUR, so basically directly compiled from the newest code)
i3 window manager with as slim a setup as possible (only window manager and basic gui-tools)
x86_64

Sparhawk (sparhawkthesecond) wrote :

I've only just got this error too. In my case, I have no networked drives mounted. However, I've got my directories split over an SSD and a spindle HDD. I've been trying to save to /tmp, which is on the SDD, as are most of the "main" files.

If relevant, this is my setup.
SSD
  /
  /home

HDD via fstab
  /home/sparhawk/HDD/

HDD via mount bind:
  /var/tmp
  /var/log
  /var/cache

HDD via symlinks
  /home/sparhawk/.cache
  /home/sparhawk/.mozilla/firefox/[random].default/Cache
  /home/sparhawk/.local/share/Trash

I am a long-time user of Shutter. Since sometime in January 2013 I have started getting this error popping up:

  Error while adding the file monitor. Unsupported operation

I get the error for local folders and also if I switch to '/tmp/' as suggested up. I get it after taking each new screen shot, and for each image in the current session when Shutter loads. I am not using NFS, just local folder on my local 12.04 no recent changes except the Ubuntu updates.

If you quit and restart Shutter process, you get the same errors when you start it again.

I use Shutter on a laptop with 12.04 and Shutter 0.89.1 with a local home directory. I am not using a network folder. Recently I started seeing the "Error while adding the file monitor" whenever you start Shutter (for each session image) and when you take a screen shot.

When I start Shutter from the command line this is what I get:
------
WARNING: Net::DBus::GLib is missing --> Ubuntu One support will be disabled!

WARNING: Gtk2::AppIndicator is missing --> there will be no icon showing up in the status bar when running Unity!

(shutter:2037): gnome-vfs-modules-WARNING **: Could not initialize inotify
------

Is it the inotify problem that leads to the errors when using Shutter?

misterich (misterich) wrote :
Download full text (11.0 KiB)

Ditto on this bug for me.

     richw@watson:~$ shutter --version
        0.90 Rev.1252

I have some NFS mounts -- however, when I set shutter to use the default ( ~ ) -- which is not mounted via NFS, I still get the error.

I also noticed that there are a few packages that probably should be added as dependencies for shutter as well:

    libimage-exiftool-perl
    libnet-dbus-glib-perl

These will twart the warnings for the following:

    WARNING: Net::DBus::GLib is missing --> Ubuntu One support will be disabled!
    WARNING: Image::ExifTool is missing --> writing Exif information will be disabled!

##MY ENVIRO
- Release: Ubuntu 12.04 (precise)
- GNOME: unknown (unknown)
- Xfce: 4.8
  - Note: I use Xubuntu
- Kernel: 3.2.0-36-generic (#57-Ubuntu SMP Tue Jan 8 21:44:52 UTC 2013)

## STARTING SHUTTER FROM COMMAND LINE
    richw@watson:~$ rm -rf .shutter/
    richw@watson:~$ shutter

        ERROR: settingsfile /home/richw/.shutter/settings.xml does not exist

        INFO: new plugin information detected - /usr/share/shutter/resources/system/plugins/perl/spbardistortion/spbardistortion
        ... blah blah info plugin...
        INFO: new upload-plugin information detected - /usr/share/shutter/resources/system/upload_plugins/upload/TwitPic

        (shutter:17724): gnome-vfs-modules-WARNING **: Could not initialize inotify

USER ACTION: take a screenshot

<Error message 'Error while adding the file monitor. Unsupported operation' pops up>
USER ACTION: click cancel

<Image appears in the main window>
USER ACTION: click the 'x' to close the image tab in the main window

        *** unhandled exception in callback:
        *** Can't call method "cancel" on an undefined value at /usr/bin/shutter line 5655, <DATA> line 19.
        *** ignoring at /usr/bin/shutter line 2893, <DATA> line 19.

## STARTING SHUTTER FROM COMMAND LINE WITH DEBUG
    richw@watson:~$ rm -rf .shutter/
    richw@watson:~$ shutter --debug

        INFO: gathering system information...
        Linux watson 3.2.0-36-generic #57-Ubuntu SMP Tue Jan 8 21:44:52 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
        Ubuntu 12.04.1 LTS \n \l

        Glib 1.241
        Gtk2 1.223
        Glib built for 2.30.1, running with 2.32.3
        Gtk2 built for 2.24.6, running with 2.24.10

        ERROR: settingsfile /home/richw/.shutter/settings.xml does not exist

        INFO: new plugin information detected - /usr/share/shutter/resources/system/plugins/perl/spbardistortion/spbardistortion
        Barrel Distortion - /usr/share/shutter/resources/system/plugins/perl/spbardistortion/spbardistortion
         ... blah blah info plugin...

        Current window manager: Xfwm4
        Current window manager: Xfwm4

        type_changed was emitted by widget Gtk2::ComboBox=HASH(0xaf8b58)
        qvalue_changed was emitted by widget Gtk2::HScale=HASH(0x3530508)

        (shutter:21906): gnome-vfs-modules-WARNING **: Could not initialize inotify

        progname_toggled was emitted by widget Gtk2::CheckButton=HASH(0xae27e0)
        im_colors_changed was emitted by widget Gtk2::ComboBox=HASH(0xae27b0)
        im_colors_toggled was emitted by widget Gtk2::CheckButton=HASH(0x348365...

misterich (misterich) wrote :

Actually, my workaround (comment #11) really didn't end up working for me. It seems that the session is needed for successful editing :-(

I do apologize, but I had to create up a VERY clunky shell script to get done what I need to get done. ***please, please please post if you would like further data or if you have a fix.*** Shutter is a really neat tool without comparison on Linux!

####MY CLUNKY SHELL SCRIPT
$HOME/bin/fake-shutter.sh

                   #!/bin/sh
                   # Fake shutter. See https://bugs.launchpad.net/shutter/+bug/1003185
                   #
                   destination='/data/screenshots';
                   timestamp=`date +%Y-%m-%d_%H-%M-%S.%N`;
                   windowName='';
                   windowId='';

                   #1. Get the window ID and name of the window to select
                   windowId=`xdotool selectwindow`;
                   windowName=`xdotool getwindowname $windowId | sed -e 's/[ \t]/_/g' | sed -e 's/[\/\!\~\`\*\&\\\$\|\^\#\@]//g'`;

                   #2. Set the filename
                   filename=$destination/$timestamp.$windowName.png

                   #3. Raise the window and get a screenshot
                   `xdotool windowactivate --sync $windowId`;
                   `import -frame -window $windowId $filename`;

                   #4. Open Inkscape in background to make edits
                   inkscape -g -f $filename &

                   exit

I've done more investigation and it mostly points to the libgnomevfs or inotify getting into a bad state. Please try a full reboot and note here if the problem (temporarily) goes away. New reports are coming in of the same error (see #1043118 and #1098772).

The key error from Shutter is on start-up:

  gnome-vfs-modules-WARNING **: Could not initialize inotify

The the pop-up error when add a screenshot, and the inability to close/delete existing screenshots are the follow-on symtoms.

I tried upgrading Shutter to latest stable release (0.90~ppa4~precise1) but same problem. I tried downgrading the libgnomevfs packages from the current 1:2.24.4-1ubuntu2.1 release back to 1:2.24.4-1ubuntu2, then logging out and logging in, but that didn't help either, so I reverted to latest stable.

I tried increasing the number of files that can be watched with inotify from the default 65535 to 100000, in case between Dropbox and Shutter it was running out (though I only have 5000 Dropbox files and 12 Shutter files).

  /proc/sys/fs/inotify/max_user_watches

But that didn't help either. In fact Dropbox stopped working too, says 'Can't access DropBox folder'. Again this is a local filesystem folder. I assume gnomevfs and/or inotify flaked for Dropbox too.

At that stage a full reboot appears to clear the problem, and Shutter and Dropbox sprang to life again. inotify is a kernel service so I guess it is possible that the kernel, inotify, or gnomevfs has some sort of resource leak, and one of them is the root cause of our Shutter problems. Anyone more knowledgeable on inotify think that is a valid theory?

Shutter and Dropbox are pretty mission-critical for me so this Ubuntu 12.04 LTS regression is obsessing me :)

misterich (misterich) wrote :

RE #11, #12:
- I installed `gnome`, `gnome-shell` ...and the rebooted. The problem went away.
    sudo apt-get install gnome gnome-shell
- Note that I have never installed Gnome until now as I use XFCE.

**Do others experiencing this problem have Gnome installed (even if it isn't the current window manager?)**

RE #13:
- I concur -- the issue is with `gnome-vfs-modules`
- I will utilize a bit more tomorrow (30 Jan 2013) and see if the problem returns.

Sparhawk (sparhawkthesecond) wrote :

I'm on KDE. I never saw this problem in the past when I was using Unity and Gnome Shell.

misterich (misterich) wrote :

RE #15 (Sparhawk):
I'm thinking that there might be some sort of dependency that is unknown here. You run KDE and I run XFCE. Neither of which are Gnome. After a full day of having `gnome` and `gnome-shell` installed, I don't see the problem.

> Note that I am **not** running Gnome as my window manager, they are merely installed. I still run XFCE as my WM.

A couple of things for the group:
1. Does anyone else duplicate the issue who has `gnome` and `gnome-shell` installed (note, this doesn't have to be the WM in use)?
2. If you did not have `gnome` and `gnome-shell` installed -- after you install them, does the problem go away?

On 01/31/2013 12:03 PM, misterich wrote:
> RE #15 (Sparhawk):
> I'm thinking that there might be some sort of dependency that is unknown here. You run KDE and I run XFCE. Neither of which are Gnome. After a full day of having `gnome` and `gnome-shell` installed, I don't see the problem.
>
>> Note that I am **not** running Gnome as my window manager, they are
> merely installed. I still run XFCE as my WM.
>
> A couple of things for the group:
> 1. Does anyone else duplicate the issue who has `gnome` and `gnome-shell` installed (note, this doesn't have to be the WM in use)?
> 2. If you did not have `gnome` and `gnome-shell` installed -- after you install them, does the problem go away?
>

The workaround I'm using is to set the local storage directory to /tmp
(Shutter -> Preferences -> Main Tab -> Directory: tmp and file name is
Default: $name_%NNN)

The default directory was my $HOME which is an NFS share. Never had the
problem with 10.04 Lucid (Same NFS Share, same server setup) Upgraded to
12.04 Precise and the problem appeared. For what it's worth I have two
machines at the house now, and both behave the same way.

Kind regards,

Iestyn

I think the NFS/AFS issue is a bit of red herring or actually a different problem.

The error we all experiencing at their core are all inotify errors, inotify is a kernel service, so it affects lots of software, like Shutter, like Dropbox, gnome-vfs, etc. NFS/AFS never supported inotify anyway, so that seems peripheral (IMHO).

The problem doesn't happen after a reboot, and hits people who use inotify a lot, so it smells like a resource leak. And given this is a kernel service, probably a leak in the kernel. For me it seems to have started about 3 months back, so probably someone on the kernel team made a boo boo.

This bug-fix here #1101666 looks like worth trying, it is specifically a kernel fix for a leak in inotify (of file descriptors).

  https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1101666

It has just be pushed as a kernal update (3.2.0-37.58), so you don't need to go to too much trouble to try it. I suggest we all update, reboot, and then wait and see if this problem ever returns.

If after this update you still get the NFS/AFS issues, then I think that is a separate bug.

Sparhawk (sparhawkthesecond) wrote :

I was attempting to replicate the bug so that I could see whether installing gnome and gnome-shell would fix it for me. I cannot replicate it any more. This might be the fix: this morning I installed the new kernel from the Ubuntu repos.
$ uname -r
3.5.0-23-generic

@Aaron: I didn't read the whole page that you linked, but the latest comment suggests that that bug may have been fixed with this same kernel
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1101666/comments/55

Thanks @Sparhawk, I believe the same patch that is in 3.5.0-23 is also in 3.2.0-37.58. The checked the release notes for 3.2.0-37.58 and it specifically mentions the patch from #1101666.

https://launchpad.net/ubuntu/+source/linux/3.2.0-37.58

So if you are on 12.04 like me, it should be enough to update to 3.2.0-37.58.

#1101666: "This bug is awaiting verification that the kernel for Precise in -proposed solves the problem (3.2.0-37.58)."
(and it is now in -updates as of 1 Feb 2013)

Iestyn Guest (iguest) wrote :

Hello,

It's been quite some time since I looked at this bug. For what it's worth, I still have the problem. I'm still running Ubuntu Precise on a desktop with Nvidia drivers= 310.14. Kernel= 3.5.0-28-generic #48~precise1-Ubuntu SMP x86_64. I'm running Unity, but have all of Gnome and Gnome-Shell installed. I'm using Shutter version=0.90, Rev=1252. I still have my $HOME mounted on an NFS share. Also installed libimage-exiftool-perl and libnet-dbus-glib-perl as per MisterRich comment above. Still have the exact same error message (Error while adding file monitor) from Shutter.

Again just to point out, Ubuntu 10.04 didn't have this problem and I my $HOME was mounted on an NFS share back then too.

Not a critical bug. I'll go back to using /tmp to store the screenshots. Perhaps it will resolve itself on some future upgrade.

Kind regards.

Iestyn

Hey,

another "me too".

I'm on Ubuntu 13.04 with Unity. My /home is on a btrfs subvol, mounted like that:

a@ask-home:~$ mount | grep /home
/dev/mapper/ssd-Data on /home type btrfs (rw,noatime,ssd,discard,subvol=home)

Interestingly, on my Ubuntu 13.04 system at work, I don't have that problem and there /home is also on btrfs:

a@ewzw032:~$ mount | grep " "/home' '
/dev/mapper/system-Root on /home type btrfs (rw,subvol=@home)

Increasing /proc/sys/fs/inotify/max_user_watches didn't help - at work, it's set to 16k; at home, it was set to 8k and I now increased it VERY much:

a@ask-home:~$ echo 216384|sudo tee /proc/sys/fs/inotify/max_user_watches

Problem still exists.

I do not have gnome-vfs erros in the output on the terminal were I started shutter and also not in ~/.xsession-errors. WHen taking a screenshot, I get:

INFO: DBus connection to org.freedesktop.compiz failed --> skipping compiz related tasks

org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.compiz was not provided by any .service files

Well?

Hi

Ah, found something. It's somehow related to btrfs.

At home, I've got these subvolumes:

a@ask-home:~$ sudo btrfs subv list /.btrfs/ssd-Data/
ID 256 gen 44598 top level 5 path home
ID 257 gen 44599 top level 5 path home/a
ID 258 gen 37865 top level 5 path Cloud
ID 276 gen 37848 top level 5 path Media
ID 277 gen 44596 top level 5 path Cloud/Dropbox
ID 283 gen 44470 top level 5 path VirtualBox
ID 320 gen 44599 top level 5 path home/b

My $HOME is /home/a, which is the btrfs subvolume with the ID 257. When I'm in ~, even "df" has issues:

a@ask-home:~$ LC_ALL=C df ~
Filesystem 1K-blocks Used Available Use% Mounted on
- 53493760 38565788 14559080 73% /home/a

Pay attention to what's shown in the "Filesystem" column - a dash "-".

When I'm in /home, df works fine. I made a test directory "/home/test", writable by everyone. I can then successfully set the Shutter save path to /home/test and all's well.

So, don't know where the issue is, but it's somehow related to Shutter, gnome and btrfs, I'd guess.

Alexander

marker 加拿大 (marker) wrote :

I had the same problem, "Error while adding the file monitor" shows up as a dialog when shutter boots up, when running shutter 0.89 rev.1219 on ubuntu 13.04 running from a usb drive.

The 2013-06-20 comment on the duplicate issue, says to comment out calls to fct_add_file_monitor:
    https://bugs.launchpad.net/bugs/1003185

I ended up having to do a similar thing, I commented out
    $sd->dlg_error_message( Gnome2::VFS->result_to_string($result), $d->get("Error while adding the file monitor.") );

Mario, can't we just change the error message to print to STDERR as a warning? ie:
   print "Warning! Unable to adding the file monitor."; instead of dlg_error_message()?

That way, people like https://bugs.launchpad.net/ubuntu/+source/shutter/+bug/1043118/comments/7
  can still do a command line screenshot without getting a dialog every time?

Hendy Irawan (ceefour) wrote :

I have only ext4 & NTFS partitions yet I also get this error.

Hendy Irawan (ceefour) wrote :

I'm using Linux Mint 15 64-bit

Here's command line errors: ironically no errors are printed during the dialog error messages.

> shutter

WARNING: Net::DBus::GLib is missing --> Ubuntu One support will be disabled!

WARNING: Image::ExifTool is missing --> writing Exif information will be disabled!

WARNING: Gtk2::AppIndicator is missing --> there will be no icon showing up in the status bar when running Unity!

Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 9: reading configurations from ~/.fonts.conf is deprecated.

(shutter:21301): gnome-vfs-modules-WARNING **: Could not initialize inotify

WARNING: DBus connection to org.freedesktop.compiz failed --> setting keyboard shortcuts may not work when using compiz

org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.compiz was not provided by any .service files

Hendy Irawan (ceefour) wrote :

My kernel is :

Linux amanah.dev 3.11.0-8-generic #15-Ubuntu SMP Fri Sep 20 04:11:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers