Modify

Opened 18 years ago

Closed 17 years ago

#1494 closed defect (fixed)

Error when trying to upload an image

Reported by: mordor Owned by: Radek Bartoň
Priority: high Component: ScreenshotsPlugin
Severity: major Keywords:
Cc: Trac Release: 0.10

Description

DiscussionPlugin: 0.10 (r21228) Trac: 0.10.3.1 gentoo package Server: Apache 2.0.59 + mod_python 3.2.10 Database: postgres OS: Linux

Hi, I'm trying to add an image, but something is causing an error. I click on the "add" button in the ScreeShots screen, type the fields (leaving the tags field in blank) and when a click on the "submit" button, the system returns this error message:

Python Traceback

Traceback (most recent call last):

File "/usr/lib64/python2.4/site-packages/trac/web/main.py", line 387, in dispatch_request

dispatcher.dispatch(req)

File "/usr/lib64/python2.4/site-packages/trac/web/main.py", line 237, in dispatch

resp = chosen_handler.process_request(req)

File "build/bdist.linux-x86_64/egg/tracscreenshots/core.py", line 134, in process_request File "build/bdist.linux-x86_64/egg/tracscreenshots/core.py", line 222, in _do_actions File "build/bdist.linux-x86_64/egg/tracscreenshots/api.py", line 126, in add_screenshot File "/usr/lib64/python2.4/site-packages/trac/db/util.py", line 50, in execute

return self.cursor.execute(sql_escape_percent(sql), args)

File "/usr/lib64/python2.4/site-packages/trac/db/util.py", line 50, in execute

return self.cursor.execute(sql_escape_percent(sql), args)

ProgrammingError: can't adapt

The image that I'm trying to upload is at .jpg format and I already have installed ImageMagick, TagsPlugin. All of the plugins are the latest version (from trunk).

Plz, help me. Thanks in advance.

Attachments (0)

Change History (5)

comment:1 Changed 18 years ago by Radek Bartoň

Status: newassigned

Please try changeset 2207. There was a rests of code from previous Trac's versions, which makes problem only with PostgreSQL and I never tested this plugin with it.

comment:2 in reply to:  1 ; Changed 18 years ago by anonymous

Replying to Blackhex:

Please try changeset 2207. There was a rests of code from previous Trac's versions, which makes problem only with PostgreSQL and I never tested this plugin with it.

Unfortunately, it doesn't work.

I deleted the old .egg file, downloaded the changeset 2207, replace the files, executed the command "python setup.py bdist_egg", copied the new .egg file to the plugins directory, and restarted the apache server.

When I tried to upload an image, I got the same error again:

Python Traceback

Traceback (most recent call last):

File "/usr/lib64/python2.4/site-packages/trac/web/main.py", line 387, in dispatch_request

dispatcher.dispatch(req)

File "/usr/lib64/python2.4/site-packages/trac/web/main.py", line 237, in dispatch

resp = chosen_handler.process_request(req)

File "build/bdist.linux-x86_64/egg/tracscreenshots/core.py", line 136, in process_request File "build/bdist.linux-x86_64/egg/tracscreenshots/core.py", line 224, in _do_actions File "build/bdist.linux-x86_64/egg/tracscreenshots/api.py", line 128, in add_screenshot File "/usr/lib64/python2.4/site-packages/trac/db/util.py", line 50, in execute

return self.cursor.execute(sql_escape_percent(sql), args)

File "/usr/lib64/python2.4/site-packages/trac/db/util.py", line 50, in execute

return self.cursor.execute(sql_escape_percent(sql), args)

ProgrammingError: can't adapt

I tried to execute "trac-admin /path/to/my-project/ upgrade", but it says that my database is already up-to-date. Maybe because I already have executed this command previously when I installed the plugin the first time. There is any modifications on the database in this changeset? If yes, I would have to drop my database and create it again?

Thanks again.

comment:3 in reply to:  2 ; Changed 18 years ago by Radek Bartoň

Replying to anonymous:

I tried to execute "trac-admin /path/to/my-project/ upgrade", but it says that my database is already up-to-date. Maybe because I already have executed this command previously when I installed the plugin the first time. There is any modifications on the database in this changeset? If yes, I would have to drop my database and create it again?

No, it's not. I thought that error is caused by old-styled escaping of form values before insertion to database. Could you please send here relevant part of debug log? Is error caused everytime you fill in any values to form or only with some? I couldn't evoke this error with PostgreSQL and tracd, but I found error when ones try to upload file with international characters in name, but this error is in Trac itself. :-). I'll try to evoke error with Apache later...

comment:4 in reply to:  3 Changed 18 years ago by anonymous

Replying to Blackhex:

Replying to anonymous:

I tried to execute "trac-admin /path/to/my-project/ upgrade", but it says that my database is already up-to-date. Maybe because I already have executed this command previously when I installed the plugin the first time. There is any modifications on the database in this changeset? If yes, I would have to drop my database and create it again?

No, it's not. I thought that error is caused by old-styled escaping of form values before insertion to database. Could you please send here relevant part of debug log? Is error caused everytime you fill in any values to form or only with some? I couldn't evoke this error with PostgreSQL and tracd, but I found error when ones try to upload file with international characters in name, but this error is in Trac itself. :-). I'll try to evoke error with Apache later...

This error is caused with any values to form. For example: NAME: aaaa, DESCRIPTION: aaaa

Here it goes the debug:

2007-05-03 10:01:31,411 Trac[init] DEBUG: Loading egg plugin iniadmin from /opt/trac/aea/plugins/IniAdmin-0.1-py2.4.egg 2007-05-03 10:01:31,425 Trac[init] DEBUG: Loading plugin /opt/trac/aea/plugins/TracCC-0.1.1-py2.4.egg 2007-05-03 10:01:31,441 Trac[init] DEBUG: Loading egg plugin tractags from /opt/trac/aea/plugins/TracTags-0.4-py2.4.egg 2007-05-03 10:01:31,466 Trac[init] DEBUG: Loading egg plugin TracScreenshots.core from /opt/trac/aea/plugins/TracScreenshots-0.4-py2.4.egg 2007-05-03 10:01:31,476 Trac[init] DEBUG: Loading egg plugin TracScreenshots.tags from /opt/trac/aea/plugins/TracScreenshots-0.4-py2.4.egg 2007-05-03 10:01:31,478 Trac[init] DEBUG: Loading egg plugin TracScreenshots.wiki from /opt/trac/aea/plugins/TracScreenshots-0.4-py2.4.egg 2007-05-03 10:01:31,479 Trac[init] DEBUG: Loading egg plugin TracScreenshots.init from /opt/trac/aea/plugins/TracScreenshots-0.4-py2.4.egg 2007-05-03 10:01:31,493 Trac[init] DEBUG: Loading egg plugin pagetopdf.pagetopdf from /opt/trac/aea/plugins/TracPageToPDF-0.2-py2.4.egg 2007-05-03 10:01:31,636 Trac[init] DEBUG: SELECT value FROM system WHERE name='screenshots_version' 2007-05-03 10:01:31,715 Trac[init] DEBUG: path: /opt/screenshots/ 2007-05-03 10:01:31,715 Trac[init] DEBUG: SELECT name, description FROM component 2007-05-03 10:01:31,716 Trac[init] DEBUG: SELECT name, description FROM version 2007-05-03 10:01:31,717 Trac[init] DEBUG: component_id: 0 2007-05-03 10:01:31,717 Trac[init] DEBUG: component: {'id': 1, 'name': u'Geral', 'description': u} 2007-05-03 10:01:31,717 Trac[init] DEBUG: version_id: 0 2007-05-03 10:01:31,717 Trac[init] DEBUG: version: {'id': 1, 'name': u'1.0', 'description': u} 2007-05-03 10:01:31,719 Trac[init] DEBUG: action: post-add 2007-05-03 10:01:31,719 Trac[init] DEBUG: modes: ['post-add', 'display'] 2007-05-03 10:01:31,720 Trac[init] DEBUG: INSERT INTO screenshot (name, description, time, author, tags, large_file, medium_file, small_file) VALUES (aaaa, aaaa, 1178197291, mordor, , teste22222_large.jpg, teste22222_medium.jpg, teste22222_small.jpg) 2007-05-03 10:01:31,721 Trac[init] ERROR: can't adapt Traceback (most recent call last):

File "/usr/lib64/python2.4/site-packages/trac/web/main.py", line 387, in dispatch_request

dispatcher.dispatch(req)

File "/usr/lib64/python2.4/site-packages/trac/web/main.py", line 237, in dispatch

resp = chosen_handler.process_request(req)

File "build/bdist.linux-x86_64/egg/tracscreenshots/core.py", line 136, in process_request File "build/bdist.linux-x86_64/egg/tracscreenshots/core.py", line 224, in _do_actions File "build/bdist.linux-x86_64/egg/tracscreenshots/api.py", line 128, in add_screenshot File "/usr/lib64/python2.4/site-packages/trac/db/util.py", line 50, in execute

return self.cursor.execute(sql_escape_percent(sql), args)

File "/usr/lib64/python2.4/site-packages/trac/db/util.py", line 50, in execute

return self.cursor.execute(sql_escape_percent(sql), args)

ProgrammingError: can't adapt

Thank you again.

comment:5 Changed 17 years ago by Radek Bartoň

Resolution: fixed
Status: assignedclosed

Changeset 2542 should fix this.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Radek Bartoň.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.