Edgewall Software

Ticket #3722 (new defect)

Opened 2 years ago

Last modified 3 weeks ago

Cannot attach a file to a ticket, it seems because of file system permissions

Reported by: leo.devida@… Owned by: cboos
Priority: normal Milestone: 0.11.3
Component: general Version: 0.10b1
Severity: normal Keywords:
Cc:

Description

I created a ticket using Trac, and then tried to attach a file to it. It failed, probably because of file system permissions, but I think the problem wasn't properly reported, and it just threw an error.

Since I cannot attach the file to the ticket, or find out what's wrong, I decided to create a ticket here. The About Trac link says its version 0.10dev

Thanks

Traceback (most recent call last):
  File "/usr/local/python2.4/lib/python2.4/site-packages/trac/web/main.py", line 316, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/local/python2.4/lib/python2.4/site-packages/trac/web/main.py", line 201, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/local/python2.4/lib/python2.4/site-packages/trac/attachment.py", line 343, in process_request
    self._do_save(req, attachment)
  File "/usr/local/python2.4/lib/python2.4/site-packages/trac/attachment.py", line 475, in _do_save
    attachment.insert(filename, upload.file, size)
  File "/usr/local/python2.4/lib/python2.4/site-packages/trac/attachment.py", line 180, in insert
    os.makedirs(self.path)
  File "/usr/local/python2.4/lib/python2.4/os.py", line 156, in makedirs
    makedirs(head, mode)
  File "/usr/local/python2.4/lib/python2.4/os.py", line 159, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/home/brs/isode-trac/attachments/ticket'

Attachments

Change History

follow-up: ↓ 2   Changed 2 years ago by cboos

  • owner changed from jonas to cboos
  • milestone set to 0.11

This is a local configuration issue.

But you're right, the problem wasn't properly reported.

I suggest that we catch the above OSError, raise some a specific TracError (TracInstallError?) and render that error in a specific "install_error" template, making it obvious that this is a local installation error that the local Trac administrator should fix.

in reply to: ↑ 1   Changed 3 weeks ago by rblank

This still happens on 0.11-stable, but the error message is even less helpful: "Failed to create unique name: {path}.100.{ext}". This is due to create_unique_file() incrementing the index appended for duplicate file names for all OSError, including permission errors.

Replying to cboos:

I suggest that we catch the above OSError, raise some a specific TracError (TracInstallError?) and render that error in a specific "install_error" template, making it obvious that this is a local installation error that the local Trac administrator should fix.

Is this still the preferred way to solve this issue? If yes, I would like to try and implement it.

Add/Change #3722 (Cannot attach a file to a ticket, it seems because of file system permissions)

Author



Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will change. Next status will be 'new'
The owner will change to anonymous. Next status will be 'assigned'
 
Note: See TracTickets for help on using tickets.