# Ticket #3205 (closed enhancement: fixed)

Opened 5 years ago

## Interaction with tracprivatetickets request

Reported by: Assigned to: js@gla-wel.de bobbysmith007 normal TimingAndEstimationPlugin normal 0.11

### Description

I just installed the Plugin in my Trac 0.11 RC2 Environment.

If I go to management tab and try to open one of the reports with TRAC_ADMIN Permission, everything works fine. But as a non-admin I get the following error message by all reports (except "Ticket Work Summary"):

Trac detected an internal error:

ValueError: invalid literal for int() with base 10: 'None'


afaik as I understood the docs correctly, TimingAndEstimationPlugin has no buildin security yet, so that cannot be the problem.

## Change History

### 06/18/08 15:53:08 changed by bobbysmith007

My guess is that this is a problem in the new trac release candidate. When I get a chance I will investigate and if necessary make a ticket over there.

russ

### 06/20/08 10:12:32 changed by js@gla-wel.de

• type changed from defect to enhancement.

I noticed that the error occures in conjunction with the tracprivatetickets 2.0.2 plugin.

I changed the type to enhancement, it would be a great feature if both extensions would work together (a programmer sees only the estimated and total hours of tickets he is allowed to view (TICKET_VIEW_SELF etc. from tracprivatetickets)

### 09/11/08 18:48:13 changed by bobbysmith007

• summary changed from Reports only viewable by TRAC_ADMIN to Interaction with tracprivatetickets request.

### 09/19/08 15:32:49 changed by bobbysmith007

• status changed from new to closed.
• resolution set to fixed.

Are you sure that this is the case? I ran both of these plugins side by side the other day and did not have this experience. If you can post the error from your trac log then I might be able to track down what is causing this.

If you write back feel free to reopen, but for now (given my recent experience of running both) I am assuming this is closed/fixed.

### 09/22/08 08:23:04 changed by js@gla-wel.de

Ok, here´s what I did: I opened Trac and clicked Management -> Ticket Hours with Description. Same error.

In the Log file these lines should be interesting:

2008-09-22 08:04:24,871 Trac[perm] DEBUG: No policy allowed juergen performing TRAC_ADMIN on <Resource u'ticket:26'>
2008-09-22 08:04:24,888 Trac[perm] DEBUG: No policy allowed juergen performing TRAC_ADMIN on <Resource u'ticket:80'>
2008-09-22 08:04:24,888 Trac[perm] DEBUG: No policy allowed juergen performing TRAC_ADMIN on <Resource u'ticket:81'>
2008-09-22 08:04:24,903 Trac[perm] DEBUG: No policy allowed juergen performing TRAC_ADMIN on <Resource u'ticket:None'>
2008-09-22 08:04:24,903 Trac[main] ERROR: invalid literal for int() with base 10: 'None'


I don´t know why, but it seems there is a ticket without a number in our environment. Don´t know how it happened, but everything else works without a problem, so I didn´t notice it yet.

### 09/22/08 08:24:11 changed by js@gla-wel.de

trac.log with traceback of this error

### 09/22/08 16:02:06 changed by bobbysmith007

Hmmm... This is definitely a bug in PrivateTicketsPlugin, but one that I think has been fixed as it skips tickets with resource none in the most recent release. Perhaps try updating that plugin and see if your problems disappear.

### 09/22/08 16:58:45 changed by js@gla-wel.de

Sorry, but an update to the latest revision didn´t solve it. I ivestigated a little bit and think I found the problem.

1. If have no ticket with an empty ticket id in my db 2. If I run the statement (look at the statement in the attached trac.log where the error occures) against our db I see that the last union select (where the remaining time is calculated) uses a null value for the ticket id

SELECT '1' AS __color__,
'background-color:#DFE;' as __style__,
NULL as ticket, 'Total' AS summary,
NULL as component,NULL as version, NULL as severity, NULL as  milestone,
'Time Remaining: ' as status,
CAST(
SUM(CASE WHEN EstimatedHours.value = '' OR EstimatedHours.value IS NULL THEN 0
ELSE CAST( EstimatedHours.value AS DECIMAL ) END) -
SUM(CASE WHEN totalhours.value = '' OR totalhours.value IS NULL THEN 0
ELSE CAST( totalhours.value AS DECIMAL ) END)
AS CHAR(512))  as owner,
SUM(CASE WHEN EstimatedHours.value = '' OR EstimatedHours.value IS NULL THEN 0
ELSE CAST( EstimatedHours.value AS DECIMAL ) END) as Estimated_work,
SUM(CASE WHEN totalhours.value = '' OR totalhours.value IS NULL THEN 0
ELSE CAST( totalhours.value AS DECIMAL ) END) as Total_work,
NULL as billable,
NULL as created, NULL as modified,         -- ## Dates are formatted

NULL AS _description_,
NULL AS _changetime,
NULL AS _reporter
,1 as _ord
FROM ticket as t
JOIN enum as p ON p.name=t.priority AND p.type='priority'

LEFT JOIN ticket_custom as EstimatedHours ON EstimatedHours.name='estimatedhours'
AND EstimatedHours.Ticket = t.Id

LEFT JOIN ticket_custom as totalhours ON totalhours.name='totalhours'
AND totalhours.Ticket = t.Id

LEFT JOIN ticket_custom as billable ON billable.name='billable'
AND billable.Ticket = t.Id

WHERE t.status IN (%s, %s, %s, %s, %s)
AND billable.value in (%s, %s)
)  as tbl
ORDER BY _ord ASC, ticket
) AS tab  LIMIT 100 OFFSET 0


I am not so familiar with the internals of trac, but I could imagine that the result of this query is passed to private ticket which expects a ticket id to check if the user has access rights on it. Can you tell me where this query is located (file system or db?), so I can change it to a real ticket id (just for testing, maybe that fixes the problem)

### 09/22/08 17:06:01 changed by anonymous

Update: Just noticed how to edit the query. If I disable PrivateTicket? and run the query, I can use the "Edit Report" Button.

If I change the query to:

SELECT '1' AS __color__,
'background-color:#DFE;' as __style__,
'''0''' as ticket, 'Total' AS summary,



the error is gone (only the "total" row now shows a link to ticket #0 which does not exist)

### 09/22/08 17:07:30 changed by bobbysmith007

I think you will find that you have some caching going on where you didnt expect. (You might wish to remove your trac-eggs-cache folder and restart your webserver). The line of code I mentioned, in the previous version is a check to verify that the ticket id is not null before we try to instantiate it.

You can certainly edit all of the reports (go to the report screen and click the edit button), but I do not think that is the problem.

HTH, Russ

### 09/22/08 17:07:57 changed by bobbysmith007

previous version

should have been previous comment

### 09/22/08 17:08:29 changed by anonymous

Upps,

The query is nonsense, I wanted to highlight the 0 with bold text. It should read:

SELECT '1' AS __color__,
'background-color:#DFE;' as __style__,
0 as ticket, 'Total' AS summary,



### Add/Change #3205 (Interaction with tracprivatetickets request)

Change Properties