Bug 1322698 - [abrt] git-cola: posixpath.py:361:abspath:FileNotFoundError: [Errno 2] Aucun fichier ou dossier de ce type
Summary: [abrt] git-cola: posixpath.py:361:abspath:FileNotFoundError: [Errno 2] Aucun ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: git-cola
Version: 23
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Nikos Roussos
QA Contact: Fedora Extras Quality Assurance
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:f668c229247caade984d3c47dc9...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-31 07:10 UTC by Gwendal
Modified: 2016-05-06 17:57 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-06 17:57:02 UTC
Type: ---


Attachments (Terms of Use)
File: backtrace (1.03 KB, text/plain)
2016-03-31 07:11 UTC, Gwendal
no flags Details
File: environ (1.56 KB, text/plain)
2016-03-31 07:11 UTC, Gwendal
no flags Details

Description Gwendal 2016-03-31 07:10:57 UTC
Version-Release number of selected component:
git-cola-2.3-1.fc23

Additional info:
reporter:       libreport-2.6.4
cmdline:        /usr/bin/python3 /usr/bin/git-cola --prompt
executable:     /usr/bin/git-cola
kernel:         4.4.6-300.fc23.x86_64
runlevel:       N 5
type:           Python3
uid:            1000

Truncated backtrace:
posixpath.py:361:abspath:FileNotFoundError: [Errno 2] Aucun fichier ou dossier de ce type

Traceback (most recent call last):
  File "/usr/share/git-cola/lib/cola/inotify.py", line 247, in run
    notifier.process_events()
  File "/usr/lib/python3.4/site-packages/pyinotify.py", line 1275, in process_events
    self._default_proc_fun(revent)
  File "/usr/lib/python3.4/site-packages/pyinotify.py", line 910, in __call__
    return _ProcessEvent.__call__(self, event)
  File "/usr/lib/python3.4/site-packages/pyinotify.py", line 636, in __call__
    return self.process_default(event)
  File "/usr/share/git-cola/lib/cola/inotify.py", line 137, in process_default
    path = os.path.relpath(os.path.join(event.path, event.name))
  File "/usr/lib64/python3.4/posixpath.py", line 448, in relpath
    start_list = [x for x in abspath(start).split(sep) if x]
  File "/usr/lib64/python3.4/posixpath.py", line 361, in abspath
    cwd = os.getcwd()
FileNotFoundError: [Errno 2] Aucun fichier ou dossier de ce type

Local variables in innermost frame:
path: '.'

Comment 1 Gwendal 2016-03-31 07:11:02 UTC
Created attachment 1142083 [details]
File: backtrace

Comment 2 Gwendal 2016-03-31 07:11:03 UTC
Created attachment 1142084 [details]
File: environ

Comment 3 David Aguilar 2016-03-31 08:08:26 UTC
Most impressive -- how did you trigger this behavior?

From the looks of it, os.getcwd() failed, which can usually only be explained by someone doing "rm -rf" on their git repository while cola is running.

It's unclear how to proceed in this scenario. One approach would be to fail fast (as we do) and abort the current operation.

This would be pretty annoying to defensively handle. Theoretically, every call to abspath, relpath, getcwd, and probably lots of other standard library functionality would need to be wrapped to account for this narrow, arguably bogus use case. 

Thus, I think this falls into the category of, "if it hurts, don't do that", probably won't fix, not a real bug, or if it is, the bug is in the python standard library ;-)

It could be argued that relpath() should return its argument unchanged when it fails to get the current directory. 

That said, I might try to repro this and perhaps terminate the inotify thread if possible.  

I am slightly curious to see if I can make cola robust to these shenanigans. Let's take the abrt challenge. Thanks for the report.

Comment 4 Gwendal 2016-03-31 09:36:32 UTC
glad to help! I usually try to send reports with ABRT when I can

I don't know how I managed to trigger this. It only looked to a random crash to me, and I didn't pay attention to what I was doing at the same time. Sorry for the lack of precision :(

Yet it never occurred again, so I guess it's not a big problem. But if that's an interesting challenge for you, that's still something :)

Comment 5 David Aguilar 2016-04-03 19:17:10 UTC
Hmm, looking closer, I think we probably should close this bug.

The later versions of git-cola completely reworked how the inotify subsystem works, so this one shouldn't really happen anymore. If you could kindly clone the latest from github (git clone git://github.com/git-cola/git-cola.git), run it in-place (./git-cola/bin/git-cola) and reproduce the problem there then we'd be happy to keep poking at this issue in our upstream bug tracker.

Would you mind filing an issue on our github issue tracker? (https://github.com/git-cola/git-cola/issues)

Even with the existing backtrace, that'll make sure that the other git-cola developers see it, particularly Daniel who completely restructured the inotify subsystem in v2.5.  I'm pretty sure the nature of this problem will pique his interest.

cheers,
David

Comment 6 Fedora Admin XMLRPC Client 2016-05-05 16:27:05 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 7 Fedora Admin XMLRPC Client 2016-05-05 16:34:38 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 8 Nikos Roussos 2016-05-06 17:57:02 UTC
Closing this per comment #5. If this error persists we re-open.


Note You need to log in before you can comment on or make changes to this bug.