Bug 1233237

Summary: [abrt] blueman: Functions.py:285:get_lockfile:OSError: [Errno 17] File exists: '/home/ssabchev/.cache'
Product: [Fedora] Fedora Reporter: ssabchew <ssabcew>
Component: bluemanAssignee: leigh scott <leigh123linux>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: fedora, fedora, leigh123linux
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/69f853cc11a8d329cb2791ae213b8573599eb937
Whiteboard: abrt_hash:0997be9f398f003956085a1cd72e1961d04a2c59
Fixed In Version: blueman-2.0-9.fc22 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-06-21 23:03:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
File: backtrace
none
File: environ none

Description ssabchew 2015-06-18 13:56:09 UTC
Version-Release number of selected component:
blueman-2.0-6.fc21

Additional info:
reporter:       libreport-2.3.0
cmdline:        python /usr/bin/blueman-applet
executable:     /usr/bin/blueman-applet
kernel:         4.0.4-202.fc21.x86_64
runlevel:       N 5
type:           Python
uid:            1000

Truncated backtrace:
Functions.py:285:get_lockfile:OSError: [Errno 17] File exists: '/home/ssabchev/.cache'

Traceback (most recent call last):
  File "/usr/bin/blueman-applet", line 120, in <module>
    BluemanApplet()
  File "/usr/bin/blueman-applet", line 55, in __init__
    check_single_instance("blueman-applet")
  File "/usr/lib/python2.7/site-packages/blueman/Functions.py", line 311, in check_single_instance
    lockfile = get_lockfile(name)
  File "/usr/lib/python2.7/site-packages/blueman/Functions.py", line 285, in get_lockfile
    os.mkdir(cachedir)
OSError: [Errno 17] File exists: '/home/ssabchev/.cache'

Local variables in innermost frame:
cachedir: '/home/ssabchev/.cache'
name: u'blueman-applet'

Comment 1 ssabchew 2015-06-18 13:56:12 UTC
Created attachment 1040506 [details]
File: backtrace

Comment 2 ssabchew 2015-06-18 13:56:14 UTC
Created attachment 1040507 [details]
File: environ

Comment 3 Christopher Schramm 2015-06-19 05:54:52 UTC
Is this reproducible?

The relevant code is:

cachedir = GLib.get_user_cache_dir()
if not os.path.exists(cachedir):
    os.mkdir(cachedir)

Assuming that os.path.exists works as expected and that the directory really existed when os.mkdir got called, this means it got created between the execution of those two line...

Comment 4 ssabchew 2015-06-21 20:54:54 UTC
Yes.

Comment 5 ssabchew 2015-06-21 20:56:08 UTC
Also directory is there, and GLib.get_user_cache_dir show this:

In [38]: GLib.get_user_cache_dir()
Out[38]: '/home/ssabchev/.cache'

Comment 6 Michael Schwendt 2015-06-21 21:40:25 UTC
Just for clarification:

Is the "yes" in comment 4 the answer to the question from comment 3? If so, how to reproduce the problem?

[...]

Considering that $HOME/.cache is a global directory which may be created by other programs, it's subject to race conditions and would benefit from OSError (errno.EEXIST) exception handling.

Comment 7 ssabchew 2015-06-21 22:57:30 UTC
About clarification: The "yes" is the answer for the question in comment 3.

About .cache - it is a symlink to /tmp/${USERNAME}_cache, may be the problem is somewhere else...
 URL=https://bugzilla.redhat.com/show_bug.cgi?id=1228488
 URL=https://bugzilla.redhat.com/show_bug.cgi?id=1229147

Comment 8 ssabchew 2015-06-21 23:03:31 UTC
The bluetooth service was stopped, and mask, so after starting it - all is OK.

Comment 9 Christopher Schramm 2015-06-22 06:08:51 UTC
(In reply to Michael Schwendt (Fedora Packager Sponsors Group) from comment #6)
> Considering that $HOME/.cache is a global directory which may be created by
> other programs, it's subject to race conditions and would benefit from
> OSError (errno.EEXIST) exception handling.

Thanks, I added that upstream. :)

Comment 10 Fedora Update System 2015-06-22 09:26:01 UTC
blueman-2.0-9.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/blueman-2.0-9.fc22

Comment 11 Fedora Update System 2015-06-22 09:26:14 UTC
blueman-2.0-9.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/blueman-2.0-9.fc20

Comment 12 Fedora Update System 2015-06-22 09:27:07 UTC
blueman-2.0-9.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/blueman-2.0-9.fc21

Comment 13 Fedora Update System 2015-06-30 20:10:34 UTC
blueman-2.0-9.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2015-06-30 20:19:47 UTC
blueman-2.0-9.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.