I am using rules to implement an "email subscription" feature where users can opt in to having new content of a particular content type emailed out to them (so they can read on a Blackberry which can't access the site). This works well but in my original setup, raises an error whenever the user uploads a user picture (avatar). This happens to all users, all of the time when uploading user pictures, irrespective of whether they opt in or out of the email subscription:
The specified file temporary://filename.jpg could not be copied, because no file by that name exists. Please check that you supplied the correct filename
In fact the picture upload has worked, but this error tends to confuse users, who then think their picture upload has failed.
At first sight this looks like an issue with the temporary directory but this is set correctly to /tmp on my system (Ubuntu Linux).
I've found a workaround.
I have one rule triggered "after updating an existing user account" to grant a "send me emails" role if the user has ticked a taxonomy field on their profile to opt in, and a similar one to do the reverse. I need the rules because non-privileged users can't directly alter their own roles.
These rules are the problem. But if I instead choose to fire them "before saving a user account", keeping everything else the same, they still work and the users no longer see the error.
The actual emailing is done by a "send mail to all users of a role" rule triggered on e.g. "after saving new content" - no problems there.