Bug 1615366 - [abrt] copr-frontend: makedirs(): os.py:220:makedirs:PermissionError: [Errno 13] Permission denied: '/usr/share/copr/coprs_frontend/coprs/../../data'
Summary: [abrt] copr-frontend: makedirs(): os.py:220:makedirs:PermissionError: [Errno ...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: python-flask-whooshee
Version: 34
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Robert Kuska
QA Contact: Fedora Extras Quality Assurance
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:336250eb27a9f15826a4a01ee0d...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-13 12:34 UTC by lobocode
Modified: 2021-07-16 09:03 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2021-07-16 09:03:17 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: backtrace (1.07 KB, text/plain)
2018-08-13 12:34 UTC, lobocode
no flags Details
File: cgroup (357 bytes, text/plain)
2018-08-13 12:34 UTC, lobocode
no flags Details
File: cpuinfo (1.14 KB, text/plain)
2018-08-13 12:34 UTC, lobocode
no flags Details
File: environ (2.67 KB, text/plain)
2018-08-13 12:34 UTC, lobocode
no flags Details
File: mountinfo (3.17 KB, text/plain)
2018-08-13 12:34 UTC, lobocode
no flags Details
File: namespaces (129 bytes, text/plain)
2018-08-13 12:34 UTC, lobocode
no flags Details
File: open_fds (240 bytes, text/plain)
2018-08-13 12:34 UTC, lobocode
no flags Details

Description lobocode 2018-08-13 12:34:27 UTC
Description of problem:


Version-Release number of selected component:
copr-frontend-1.132-1.fc28

Additional info:
reporter:       libreport-2.9.5
cmdline:        /usr/bin/python3 /usr/share/copr/coprs_frontend/run/check_for_anitya_version_updates.py --backend pypi --delta=172800
crash_function: makedirs
exception_type: PermissionError
executable:     /usr/share/copr/coprs_frontend/run/check_for_anitya_version_updates.py
interpreter:    python3-3.6.6-1.fc28.x86_64
kernel:         4.16.3-301.fc28.x86_64
runlevel:       N 5
type:           Python3
uid:            977

Truncated backtrace:
os.py:220:makedirs:PermissionError: [Errno 13] Permission denied: '/usr/share/copr/coprs_frontend/coprs/../../data'

Traceback (most recent call last):
  File "/usr/share/copr/coprs_frontend/run/check_for_anitya_version_updates.py", line 18, in <module>
    from coprs import db, app, helpers, models
  File "/usr/share/copr/coprs_frontend/coprs/__init__.py", line 34, in <module>
    whooshee = Whooshee(app)
  File "/usr/lib/python3.6/site-packages/flask_whooshee.py", line 215, in __init__
    self.init_app(app)
  File "/usr/lib/python3.6/site-packages/flask_whooshee.py", line 250, in init_app
    os.makedirs(config['index_path_root'])
  File "/usr/lib64/python3.6/os.py", line 210, in makedirs
    makedirs(head, mode, exist_ok)
  File "/usr/lib64/python3.6/os.py", line 220, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/usr/share/copr/coprs_frontend/coprs/../../data'

Local variables in innermost frame:
tail: 'data'
head: '/usr/share/copr/coprs_frontend/coprs/../..'
exist_ok: False
mode: 511
name: '/usr/share/copr/coprs_frontend/coprs/../../data'

Comment 1 lobocode 2018-08-13 12:34:33 UTC
Created attachment 1475565 [details]
File: backtrace

Comment 2 lobocode 2018-08-13 12:34:35 UTC
Created attachment 1475566 [details]
File: cgroup

Comment 3 lobocode 2018-08-13 12:34:36 UTC
Created attachment 1475567 [details]
File: cpuinfo

Comment 4 lobocode 2018-08-13 12:34:38 UTC
Created attachment 1475568 [details]
File: environ

Comment 5 lobocode 2018-08-13 12:34:40 UTC
Created attachment 1475569 [details]
File: mountinfo

Comment 6 lobocode 2018-08-13 12:34:41 UTC
Created attachment 1475570 [details]
File: namespaces

Comment 7 lobocode 2018-08-13 12:34:43 UTC
Created attachment 1475571 [details]
File: open_fds

Comment 8 Pavel Raiskup 2019-04-15 05:34:45 UTC
I believe this is because python-flask-whooshee uses this:

(file flask_whooshee.py)
249         if not os.path.exists(config['index_path_root']):
250             os.makedirs(config['index_path_root'])

.. which is prone to race conditions.  It would be better to do:

try:
     os.makedirs(config['index_path_root'])
except FileExistsError:
     pass

Comment 9 Ben Cotton 2019-08-13 17:05:06 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to '31'.

Comment 10 Ben Cotton 2019-08-13 19:27:42 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to 31.

Comment 11 Ben Cotton 2020-11-03 15:01:49 UTC
This message is a reminder that Fedora 31 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '31'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 31 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 12 Ben Cotton 2020-11-24 18:35:48 UTC
Fedora 31 changed to end-of-life (EOL) status on 2020-11-24. Fedora 31 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 13 Ben Cotton 2021-02-09 15:06:31 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.

Comment 14 Pavel Raiskup 2021-07-16 09:03:17 UTC
I submitted upstream pull request for the TOCTOU issue:
https://github.com/bkabrda/flask-whooshee/pull/63/files

Though anyway, the original problem seems to be in Copr project misconfiguration.
Normally, the whooshee data directory is /var/lib/copr/data/whooshee/


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