Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

Last modified 12 years ago

#5287 closed defect (worksforme)

ValueError: invalid literal for int(): /path/to/newticket

Reported by: brooke@… Owned by: Jonas Borgström
Priority: low Milestone:
Component: ticket system Version: devel
Severity: normal Keywords: needinfo
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Christian Boos)

Using version 11dev, I receive the above error when trying to create a new ticket. From the log:

<snip>
2007-05-08 15:47:49,056 Trac[main] DEBUG: Dispatching <Request "GET /newticket">
2007-05-08 15:47:49,103 Trac[main] ERROR: invalid literal for int(): projects/isound/newticket
Traceback (most recent call last):
  File "/usr/lib/python2.3/site-packages/Trac-0.11dev_r5354-py2.3.egg/trac/web/main.py", line 429, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.3/site-packages/Trac-0.11dev_r5354-py2.3.egg/trac/web/main.py", line 217, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.3/site-packages/Trac-0.11dev_r5354-py2.3.egg/trac/ticket/web_ui.py", line 123, in process_request
    return self._process_ticket_request(req)
  File "/usr/lib/python2.3/site-packages/Trac-0.11dev_r5354-py2.3.egg/trac/ticket/web_ui.py", line 347, in _process_ticket_request
    id = int(req.args.get('id'))
ValueError: invalid literal for int(): projects/isound/newticket
2007-05-08 15:47:49,366 Trac[chrome] DEBUG: Prepare chrome data for request
</snip>

Attachments (0)

Change History (9)

comment:1 by brooke@…, 18 years ago

FYI, #5287 & #5286 are related.

comment:2 by Christian Boos, 18 years ago

Description: modified (diff)
Keywords: needinfo added
Priority: highlow
Severity: blockernormal

Ok, here we see: <Request "GET /newticket">

As opposed to #5286, id is not set by TicketModule.match_request, but as we're going into self._process_ticket_request(req) instead of self._process_newticket_request(req) in TicketModule.process_request, this shows that the id is set by some other means.

In #5286, it's projects/isound/report, here it's projects/isound/newticket, so there must be something in your web front-end that adds an id request parameter corresponding to projects/isound plus the value of the GET request.

It must be a misconfiguration of your web front-end, but it would be interesting nevertheless to understand what's going on, in order to see if this is something likely to happen for other people or not.

comment:3 by anonymous, 18 years ago

what could the misconfiguration be? and where would that be set? do you mean something from GET HTTP variable? any ideas would be appreciated… I assumed that trac was generating an id somewhere (it must be for a new ticket, right?).

please advise…

comment:4 by Christian Boos, 18 years ago

Well, no idea, but that id is not coming from Trac, for sure. What web front-end are you using? Apache and mod_python? What is your web server configuration related to this Trac instance?

comment:5 by anonymous, 18 years ago

hmmm. yeah, i'm using Apache with mod_python and I've got some authentication in place. It's odd that 'id' would ever be a path, so I assumed that line was just pulling the wrong value out of an array or something. Are you suggesting this is an issue with how Apache is configured?

comment:6 by brooke@…, 18 years ago

i think i just found it. mod_rewrite is used and 'id' is a stupid variable for set (presumabely to a path). i guess i have to figure out how to make my application variables and trac variables play nice. grrrr…

thanks for your help, i think you can close this out now.

comment:7 by Christian Boos, 18 years ago

Resolution: worksforme
Status: newclosed

Glad you found it, so mod_rewrite was the culprit. And btw, also avoid using the project_id or project variable names, for compatibility with future Trac 1.0 release ;-)

comment:8 by brooke@…, 18 years ago

I confirmed that the mod_rewrite rules were in fact causing this problem (as well as a problem related to not letting me edit the wiki — i guess the ?action=edit parameter was getting rewritten as well).

my solution was to simply exclude any trac-related directories from being rewritten by mod_rewrite rules. i did something like this:

RewriteRule /(trac) - [L]

where trac is the 'base' directory of all my trac projects that i specify in the httpd.conf file (using mod_python approach, obvs).

thanks for your help!!

comment:9 by Christian Boos, 12 years ago

Milestone: 0.11

(clearing report:35)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.