#5377 closed defect (invalid)
Add Attachment Error
Reported by: | anonymous | Owned by: | Jonas Borgström |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | general | Version: | |
Severity: | normal | Keywords: | needinfo |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
An error occured while trying to add an attachment (filesize was about 8KB):
Python Traceback
Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 406, in dispatch_request dispatcher.dispatch(req) File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 237, in dispatch resp = chosen_handler.process_request(req) File "/usr/lib/python2.4/site-packages/trac/attachment.py", line 361, in process_request self._do_save(req, attachment) File "/usr/lib/python2.4/site-packages/trac/attachment.py", line 496, in _do_save attachment.insert(filename, upload.file, size) File "/usr/lib/python2.4/site-packages/trac/attachment.py", line 183, in insert filename)) File "/usr/lib/python2.4/site-packages/trac/util/__init__.py", line 112, in create_unique_file raise Exception('Failed to create unique name: ' + path) Exception: Failed to create unique name: /srv/trac/lsoc/attachments/wiki/Video-Telefonie/class03.100.png
Attachments (0)
Change History (4)
comment:1 by , 17 years ago
Description: | modified (diff) |
---|---|
Keywords: | needinfo added |
comment:2 by , 17 years ago
I get the same error (file is very large — about 3megs)
Most recent call last:
- File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r5683-py2.4.egg/trac/web/main.py", line 432, in dispatch_request
Code fragment:
- if not env and env_error:
- raise HTTPInternalError(env_error)
- try:
- try:
- dispatcher = RequestDispatcher(env)
- dispatcher.dispatch(req)
- except RequestDone:
- pass
- return req._response or []
- finally:
- if not run_once:
- File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r5683-py2.4.egg/trac/web/main.py", line 217, in dispatch
Code fragment:
- 'Do you have cookies enabled?')
- # Process the request and render the template
- try:
- try:
- resp = chosen_handler.process_request(req)
- if resp:
- if len(resp) == 2: # Clearsilver
- chrome.populate_hdf(req)
- template, content_type = \
- self._post_process_request(req, *resp)
- File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r5683-py2.4.egg/trac/attachment.py", line 407, in process_request
Code fragment:
- ('attachment', attachment.filename, resource=attachment)
- add_link(req, 'up', ctx.parent.resource_href(), ctx.parent.name()) 404.
- if req.method == 'POST':
- if action == 'new':
- self._do_save(ctx)
- elif action == 'delete':
- self._do_delete(ctx)
- elif action == 'delete':
- data = self._render_confirm_delete(ctx)
- elif action == 'new':
- File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r5683-py2.4.egg/trac/attachment.py", line 545, in _do_save
Code fragment:
- req.perm.require('ATTACHMENT_DELETE', context)
- old_attachment.delete()
- except TracError:
- pass # don't worry if there's nothing to replace
- attachment.filename = None
- attachment.insert(filename, upload.file, size)
- # Redirect the user to list of attachments (must add a trailing '/')
- req.redirect(context.resource_href('..') + '/')
- def _do_delete(self, context):
- File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r5683-py2.4.egg/trac/attachment.py", line 244, in insert
Code fragment:
- if not os.access(self.path, os.F_OK):
- os.makedirs(self.path)
- filename = unicode_quote(filename)
- path, targetfile = create_unique_file(os.path.join(self.path,
- filename))
- try:
- # Note:
path
is an unicode string becauseself.path
was one. - # As it contains only quoted chars and numbers, we can use
ascii
- basename = os.path.basename(path).encode('ascii')
- filename = unicode_unquote(basename)
- File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r5683-py2.4.egg/trac/util/init.py", line 85, in create_unique_file
Code fragment:
- return path, os.fdopen(os.open(path, flags), 'w')
- except OSError:
- idx += 1
- # A sanity check
- if idx > 100:
- raise Exception('Failed to create unique name: ' + path)
- path = '%s.%d%s' % (parts[0], idx, parts[1])
- class NaivePopen:
- """This is a deadlock-safe version of popen that returns an object with
File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r5683-py2.4.egg/trac/web/main.py", line 432, in dispatch_request
dispatcher.dispatch(req)
File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r5683-py2.4.egg/trac/web/main.py", line 217, in dispatch
resp = chosen_handler.process_request(req)
File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r5683-py2.4.egg/trac/attachment.py", line 407, in process_request
self._do_save(ctx)
File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r5683-py2.4.egg/trac/attachment.py", line 545, in _do_save
attachment.insert(filename, upload.file, size)
File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r5683-py2.4.egg/trac/attachment.py", line 244, in insert
filename))
File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r5683-py2.4.egg/trac/util/init.py", line 85, in create_unique_file
raise Exception('Failed to create unique name: ' + path)
System Information:
User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 Trac: 0.11dev-r5683 Python: 2.4.3 (#1, Oct 23 2006, 14:19:47) [GCC 4.1.1 20060525 (Red Hat 4.1.1-1)] setuptools: 0.6c3 SQLite: 3.3.3 pysqlite: 1.1.7 Genshi: 0.4.1 jQuery: 1.1.2
comment:3 by , 17 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Closing this bug (I was the one that opened it). Was a configuration error on my part.
comment:4 by , 17 years ago
I am having the same problem. What's your configuration error? and how did you fix it?
Thanks./
How many times did you try? What was the uploaded file name (on your client filesystem)?