Create new Trac environment, where is the Admin tab?

159 views
Skip to first unread message

Erick D

unread,
Sep 29, 2015, 2:45:03 PM9/29/15
to Trac Users
Hi, I recently created a new Trac environment using the command 'trac-admin /path/to/trac/NewTrac2 initenv'  .. it then asked me to upgrade the environment, I did, with 'trac-admin /path/to/trac/NewTrac2 upgrade' .

I do have multiple environments and I see an "Admin" tab that has 'plugins', 'Logging' , etc, on all older environments, but the the new one! 
What did I miss? 
I did modify the trac.ini under NewTrac2/conf/trac.ini  to match an old environment. But that did nothing. 

Please advise.

Thank you!

 


RjOllos

unread,
Sep 29, 2015, 2:50:11 PM9/29/15
to Trac Users
You'll need to grant TRAC_ADMIN permission to a trusted user.

Erick D

unread,
Sep 29, 2015, 2:50:20 PM9/29/15
to Trac Users
Some info: Using - Trac 1.0.1 
Also, when I create a ticket under the old environments, I can select from a list of owners to assign to, but the newly created environment does not have a list!
I think there something missed or I need to modify a file to point to the right direction.



On Tuesday, September 29, 2015 at 11:45:03 AM UTC-7, Erick D wrote:

RjOllos

unread,
Sep 29, 2015, 2:57:10 PM9/29/15
to Trac Users


On Tuesday, September 29, 2015 at 11:50:20 AM UTC-7, Erick D wrote:
[...]
Also, when I create a ticket under the old environments, I can select from a list of owners to assign to, but the newly created environment does not have a list!
[...]

 Set [ticket] restrict_owner to "enabled".

Erick D

unread,
Sep 29, 2015, 2:59:41 PM9/29/15
to Trac Users
Thanks, I performed the command 'trac-admin /path/to/projenv/NewTrac2 permission add Mike TRAC_ADMIN' .. I added myself. 
But no go, no Admin tab. I can log in just fine, but no Admin tab. 
I can the command again and I got "The user Mike already has permission TRAC_Admin." ... cleared cache/cookies. No go, no Admin tab.

Ryan Ollos

unread,
Sep 29, 2015, 3:05:20 PM9/29/15
to Trac Users
On Tue, Sep 29, 2015 at 11:59 AM, Erick D <charles...@gmail.com> wrote:
Thanks, I performed the command 'trac-admin /path/to/projenv/NewTrac2 permission add Mike TRAC_ADMIN' .. I added myself. 
But no go, no Admin tab. I can log in just fine, but no Admin tab. 
I can the command again and I got "The user Mike already has permission TRAC_Admin." ... cleared cache/cookies. No go, no Admin tab.

Please paste the output of:

$ trac-admin $env permission list Mike

You may be running into issues with case-sensitivity. If so, you can use [trac] ignore_auth_case = true

Erick D

unread,
Sep 29, 2015, 3:15:31 PM9/29/15
to Trac Users, ryan.j...@gmail.com
Output:

Mike BROWSER_VIEW
Mike CHANGESET_VIEW
Mike FILE_VIEW
Mike LOG_VIEW
Mike MILESTONE_VIEW
Mike REPORT_SQL_VIEW
Mike  REPORT_VIEW
Mike  ROADMAP_VIEW
Mike  SEARCH_VIEW
Mike  TICKET_APPEND
Mike  TICKET_CHGPROP
Mike  TICKET_CREATE
Mike  TICKET_MODIFY
Mike  TICKET_VIEW
Mike  TIMELINE_VIEW
Mike  WIKI_CREATE
Mike  WIKI_MODIFY
Mike  WIKI_VIEW


I don't see the TRAC_ADMIN permission, although I ran, again, the command "trac-admin ./NewTrac2 permission add Mike TRAC_ADMIN"
and again it states "The user Mike already has permission TRAC_ADMIN"



On Tuesday, September 29, 2015 at 12:05:20 PM UTC-7, RjOllos wrote:
On Tue, Sep 29, 2015 at 11:59 AM, Erick D <charles...@gmail.com> wrote:
Thanks, I performed the command 'trac-admin /path/to/projenv/NewTrac2 permission add Mike TRAC_ADMIN' .. I added myself. 
But no go, no Admin tab. I can log in just fine, but no Admin tab. 
I can the command again and I got "The user Mike already has permission TRAC_ADMIN." ... cleared cache/cookies. No go, no Admin tab.

Erick D

unread,
Sep 29, 2015, 3:31:20 PM9/29/15
to Trac Users
The 'parent' trac.ini, where other trac.ini settings are inherited, has 'restrict_owner = true' already to true. 

Ryan Ollos

unread,
Sep 29, 2015, 3:33:49 PM9/29/15
to Trac Users
On Tue, Sep 29, 2015 at 12:31 PM, Erick D <charles...@gmail.com> wrote:
The 'parent' trac.ini, where other trac.ini settings are inherited, has 'restrict_owner = true' already to true. 

Make sure it's not being overridden and set to false in the inheriting trac.ini

What value is show on your /about page for the restrict_owner value?

 

Erick D

unread,
Sep 29, 2015, 3:40:00 PM9/29/15
to Trac Users, ryan.j...@gmail.com
The 'About Trac' page shows no settings. (attached pic)
1.JPG

rjo...@gmail.com

unread,
Sep 29, 2015, 3:45:21 PM9/29/15
to trac-...@googlegroups.com, Trac Users
On Tuesday Sep 29, 2015 at 12:40, Erick D <charles...@gmail.com>, wrote:
The 'About Trac' page shows no settings. (attached pic)

Did you check the inheriting trac.ini?

Could you post your parent trac.ini? Sanitize if needed.

Erick D

unread,
Sep 29, 2015, 3:54:33 PM9/29/15
to Trac Users
This is the conf/trac.ini from the new env:
----------------------------------------------------------------------------------------
# -*- coding: utf-8 -*-

[components]
trachours.ticket.trachoursbycomment = disabled

[inherit]
file = /var/www/website/share/trac/conf/trac.ini

[project]
descr = NugetPackages
name = NugetPackages

[trac]
database = mysql://user:user@localhost/NugetPackages
repository_dir = /var/public/repositories/NugetPackages

----------------------------------------------------------------------------------------

This is the parent Trac.ini (attached)
---------------------------------------------------------------------------------------
Trac.ini

Ryan Ollos

unread,
Sep 29, 2015, 4:30:28 PM9/29/15
to Trac Users
On Tue, Sep 29, 2015 at 12:54 PM, Erick D <charles...@gmail.com> wrote:
This is the conf/trac.ini from the new env:
----------------------------------------------------------------------------------------

What is the output of?:
$ trac-admin $env config get ticket restrict_owner 

Erick D

unread,
Sep 29, 2015, 4:33:51 PM9/29/15
to Trac Users, ryan.j...@gmail.com
Output:

root@:/var/www/website/trac/NugetPackages# trac-admin . config get ticket restrict_owner
true

Ryan Ollos

unread,
Sep 29, 2015, 4:42:24 PM9/29/15
to Trac Users
Looking at your [components] section, I see some issues:

[components]
webadmin.* = enabled
acct_mgr.* = enabled
trac.web.auth.LoginModule = enabled
trac.ticket.report.* = enabled
acct_mgr.api = enabled
acct_mgr.web_ui.* = disabled
acct_mgr.register.EmailVerificationModule = disabled
mastertickets.* = enabled
graphviz.* = enabled
trachours.* = enabled
tracrpc.* = enabled
tracopt.versioncontrol.svn.* = enabled
tracmigrate.* = enabled
tracopt.ticket.commit_updater.* = enabled
tracwikiextras.* = enabled
trac.ticket.batch.* = enabled


Webadmin has been deprecated since 0.11 when equivalent functionality was added to Trac. Hopefully you no longer have an egg installed for it.

If you are using AccountManagerPlugin you should disable Trac's LoginModule.

From your [account-manager] section it looks like you are using an old version of that plugin, or else your configuration is just invalid. Please upgrade to 0.4.4 or else disabled acct_mgr.*

The entries highlighted in green are noise and can be removed.

What is the list of files in your [inherit] templates_dir?

After you make those changes we should take a look at the logs,

Erick D

unread,
Sep 29, 2015, 5:16:02 PM9/29/15
to Trac Users, ryan.j...@gmail.com
Removed: (Just commented out)
#webadmin.* = enabled 
#trac.ticket.report.* = enabled
#acct_mgr.api = enabled
#trac.ticket.batch.* = enabled

Disabled:
acct_mgr.* = disabled

We are using and need: 
trac.web.auth.LoginModule = enabled
(If I disable this, I get this "No handler matched request to /login")

Also, AccountManagerPlugin is at 0.4.4, although it is disabled now. 


What is the list of files in your [inherit] templates_dir?  (from - /share/trac/templates)
about.html
attachment.html
diff_div.html
diff_view.html
error.html
footer.cs
header.cs
history_view.html
index.html
layout.html
macros.cs
macros.html
macros.rss
page_index.html
README
theme.html


I will be checking the logs next.
Thank you!

Erick D

unread,
Sep 29, 2015, 5:21:27 PM9/29/15
to Trac Users, ryan.j...@gmail.com
I set the logs to DEBUG, restarted web server. What exactly am I looking for in the logs?

Thanks!

Ryan Ollos

unread,
Sep 29, 2015, 5:21:43 PM9/29/15
to Erick D, Trac Users
On Tue, Sep 29, 2015 at 2:16 PM, Erick D <charles...@gmail.com> wrote:
Removed: (Just commented out)
#webadmin.* = enabled 
#trac.ticket.report.* = enabled
#acct_mgr.api = enabled
#trac.ticket.batch.* = enabled

Disabled:
acct_mgr.* = disabled

We are using and need: 
trac.web.auth.LoginModule = enabled
(If I disable this, I get this "No handler matched request to /login")

Right, you only want to disable Trac's LoginModule if you are using AccountManagerPlugin.
 
Also, AccountManagerPlugin is at 0.4.4, although it is disabled now. 


What is the list of files in your [inherit] templates_dir?  (from - /share/trac/templates)
about.html
attachment.html
diff_div.html
diff_view.html
error.html
footer.cs
header.cs
history_view.html
index.html
layout.html
macros.cs
macros.html
macros.rss
page_index.html
README
theme.html

The .cs files are ClearSilver templates from Trac < 0.11. They won't cause any issues, but the html files could cause problems. Unless you've done some customization to the templates, I think you probably want to remove [inherit] templates_dir from the parent config. 

Are you running a webserver or TracStandalone?

Ryan Ollos

unread,
Sep 29, 2015, 5:23:36 PM9/29/15
to Erick D, Trac Users
On Tue, Sep 29, 2015 at 2:21 PM, Erick D <charles...@gmail.com> wrote:
I set the logs to DEBUG, restarted web server. What exactly am I looking for in the logs?

Thanks!

You should see a bunch of messages about components being loaded. Look for messages about components being skipped, or just post the output to the mailing list. Also look for ERRORs and Python tracebacks in the log. 

Erick D

unread,
Sep 29, 2015, 6:10:44 PM9/29/15
to Trac Users, charles...@gmail.com, ryan.j...@gmail.com
Removed: [inherit] templates_dir  from the parent config. 
Trac log attached. 
We are running Trac on a webserver (Apache).

Thanks!
trac.log

Ryan Ollos

unread,
Sep 29, 2015, 6:27:51 PM9/29/15
to Erick D, Trac Users
On Tue, Sep 29, 2015 at 3:10 PM, Erick D <charles...@gmail.com> wrote:
Removed: [inherit] templates_dir  from the parent config. 
Trac log attached. 
We are running Trac on a webserver (Apache).

Thanks!

There's nothing telling in the logs. There are no messages in the logs about permission checks, which suggests that you really do have TRAC_ADMIN permission.

The behavior you describe is a bit bizarre. We could take a look at your Apache configuration next. You could also consider upgrading to Trac 1.0.9, though I don't think there's a defect in Trac going on here, rather some strange installation issue.
 

Erick D

unread,
Sep 30, 2015, 1:44:45 PM9/30/15
to Trac Users, charles...@gmail.com, ryan.j...@gmail.com
Thanks Ryan.
I think it may be the way Mysql interacts with the new Trac env. 
Before I created the env, I created a Test folder on the directory where all other environments are, and our site got an SQL Access error. 
I then created a DB on mysql matching the name of the new Test folder and made the mysql connection string 'mysql://user:password@localhost:3306/NameofNewEnv'    ...then the SQL access error disappeared. 

I don't think it's the Apache config, the other environments are working fine. 
If I upgrare to v 1.0.9, will there be major headaches? 

Ryan Ollos

unread,
Sep 30, 2015, 1:58:25 PM9/30/15
to Erick D, Trac Users
On Wed, Sep 30, 2015 at 10:44 AM, Erick D <charles...@gmail.com> wrote:
Thanks Ryan.
I think it may be the way Mysql interacts with the new Trac env. 
Before I created the env, I created a Test folder on the directory where all other environments are, and our site got an SQL Access error. 
I then created a DB on mysql matching the name of the new Test folder and made the mysql connection string 'mysql://user:password@localhost:3306/NameofNewEnv'    ...then the SQL access error disappeared. 

I don't think it's the Apache config, the other environments are working fine. 
If I upgrare to v 1.0.9, will there be major headaches? 

You might find some valuable info on this page,

In general upgrading a minor version should present no issues. For the case of running MySQL though, if you are running an unsupported storage engine, character set or collation you might not notice any issues for Trac < 1.0.2. However, in Trac 1.0.2 and later it is enforced that you are not, for instance, using MyISAM storage engine rather than InnoDB.

The least risky approach would be to create a virtual environment with a clean Trac installation of Trac 1.0.9, connecting it to your MySQL database and testing it out. That way you can just delete the virtual environment at the end of the test and not affect any of your other installations. Let me know if you need more info on that approach.

- Ryan

Erick D

unread,
Sep 30, 2015, 5:16:54 PM9/30/15
to Trac Users, charles...@gmail.com, ryan.j...@gmail.com
I checked mysql's character set and collation, all are good. 
Today, I noticed that I provided the incorrect trac.log. (attached)

Attached is the correct log. I noticed, that although Mike has TRAC_ADMIN when I run 'trac-admin . permission list' .... the debug log shows
"No policy allowed Mike performing TRAC_ADMIN on None"

I think there's an issue here?

Thanks
trac.log

Ryan Ollos

unread,
Sep 30, 2015, 5:23:40 PM9/30/15
to Erick D, Trac Users
On Wed, Sep 30, 2015 at 2:16 PM, Erick D <charles...@gmail.com> wrote:
I checked mysql's character set and collation, all are good. 
Today, I noticed that I provided the incorrect trac.log. (attached)

Attached is the correct log. I noticed, that although Mike has TRAC_ADMIN when I run 'trac-admin . permission list' .... the debug log shows
"No policy allowed Mike performing TRAC_ADMIN on None"

I think there's an issue here?

It is certainly behaving as though Mike has been granted TRAC_ADMIN in the database, but value hasn't been retrieved by permission store. There is some caching of permissions in the permission store. Have you tried restarting the web server?

Erick D

unread,
Sep 30, 2015, 5:39:11 PM9/30/15
to Trac Users, charles...@gmail.com, ryan.j...@gmail.com
I have restarted apache several times via 'sudo /etc/init.d/apache2 restart' ... restarts just fine, but same issue.
Anyway to clear the permission cache?

Thanks

Ryan Ollos

unread,
Sep 30, 2015, 5:56:55 PM9/30/15
to Erick D, Trac Users
On Wed, Sep 30, 2015 at 2:39 PM, Erick D <charles...@gmail.com> wrote:
I have restarted apache several times via 'sudo /etc/init.d/apache2 restart' ... restarts just fine, but same issue.
Anyway to clear the permission cache?

The cached property would certainly be cleared by restarting Apache because the values are cached in the in-memory application. It should also be cleared when granting a permission.

Erick D

unread,
Oct 1, 2015, 1:36:13 PM10/1/15
to Trac Users, charles...@gmail.com, ryan.j...@gmail.com
I compared '#trac-admin . permission list' to mysql interface (I'm using SQLyog), I pulled up the permission table .. and I did have trac admin, but it spelled out exactly like "TRAC_Admin" .. I changed it to all caps "TRAC_ADMIN", restarted apache and worked! I now have the Admin tab.

Thanks for your help Ryan. I appreciate it. 

Ryan Ollos

unread,
Oct 1, 2015, 2:23:16 PM10/1/15
to Erick D, Trac Users
On Thu, Oct 1, 2015 at 10:36 AM, Erick D <charles...@gmail.com> wrote:
I compared '#trac-admin . permission list' to mysql interface (I'm using SQLyog), I pulled up the permission table .. and I did have trac admin, but it spelled out exactly like "TRAC_Admin" .. I changed it to all caps "TRAC_ADMIN", restarted apache and worked! I now have the Admin tab.

Thanks for your help Ryan. I appreciate it. 

Okay, I assumed that was just a typo in your second message. I should never assume!

I can't reproduce your issue with Trac 1.0.1 though. See commands and output below.

Did you resolve the issue you were having with [ticket] restrict_owner? 


(pve)~/Documents/Workspace/trac-dev$trac-admin proj-1.0 permission list user2

User   Action             
--------------------------
user2  BROWSER_VIEW       
user2  CHANGESET_VIEW     
user2  FILE_VIEW          
user2  INVALID_PERM       
user2  LOG_VIEW           
user2  MILESTONE_VIEW     
user2  REPORT_SQL_VIEW    
user2  REPORT_VIEW        
user2  ROADMAP_VIEW       
user2  SEARCH_VIEW        
user2  TICKET_APPEND      
user2  TICKET_BATCH_MODIFY
user2  TICKET_CHGPROP     
user2  TICKET_CREATE      
user2  TICKET_MODIFY      
user2  TICKET_VIEW        
user2  TIMELINE_VIEW      
user2  WIKI_CREATE        
user2  WIKI_MODIFY        
user2  WIKI_VIEW          


Available actions:
 BROWSER_VIEW, CHANGESET_VIEW, CONFIG_VIEW, EMAIL_VIEW, FILE_VIEW,
 LOG_VIEW, MILESTONE_ADMIN, MILESTONE_CREATE, MILESTONE_DELETE,
 MILESTONE_MODIFY, MILESTONE_VIEW, PERMISSION_ADMIN, PERMISSION_GRANT,
 PERMISSION_REVOKE, REPORT_ADMIN, REPORT_CREATE, REPORT_DELETE,
 REPORT_MODIFY, REPORT_SQL_VIEW, REPORT_VIEW, ROADMAP_ADMIN, ROADMAP_VIEW,
 SEARCH_VIEW, TICKET_ADMIN, TICKET_APPEND, TICKET_BATCH_MODIFY,
 TICKET_CHGPROP, TICKET_CREATE, TICKET_EDIT_CC, TICKET_EDIT_COMMENT,
 TICKET_EDIT_DESCRIPTION, TICKET_MODIFY, TICKET_VIEW, TIMELINE_VIEW,
 TRAC_ADMIN, VERSIONCONTROL_ADMIN, WIKI_ADMIN, WIKI_CREATE, WIKI_DELETE,
 WIKI_MODIFY, WIKI_RENAME, WIKI_VIEW

(pve)~/Documents/Workspace/trac-dev$trac-admin proj-1.0 permission add user2 TRAC_Admin
(pve)~/Documents/Workspace/trac-dev$trac-admin proj-1.0 permission add user2 TRAC_ADMIN

Erick D

unread,
Oct 1, 2015, 3:08:54 PM10/1/15
to Trac Users, charles...@gmail.com, ryan.j...@gmail.com
Did you resolve the issue you were having with [ticket] restrict_owner? 
Did not check this.. The 'About Trac' shows 'restrict_owner' = True
When I create a new ticket, I do see myself in the drop down list, but no one else. I'm trying to figure out how I can get a list of users from my other trac environments on the same machine.

Ryan Ollos

unread,
Oct 1, 2015, 3:13:45 PM10/1/15
to Erick D, Trac Users
On Thu, Oct 1, 2015 at 12:08 PM, Erick D <charles...@gmail.com> wrote:
Did you resolve the issue you were having with [ticket] restrict_owner? 
Did not check this.. The 'About Trac' shows 'restrict_owner' = True
When I create a new ticket, I do see myself in the drop down list, but no one else. I'm trying to figure out how I can get a list of users from my other trac environments on the same machine.

The user must authenticate at least once in order to appear in the list. A workaround is to insert an entry for every user into the session table with the authenticated column set to 1. 

Erick D

unread,
Oct 1, 2015, 3:26:12 PM10/1/15
to Trac Users, charles...@gmail.com, ryan.j...@gmail.com
Just added all users into session table with auth set to 1. It worked.
Thanks a bunch Ryan!

RjOllos

unread,
Oct 5, 2015, 7:12:43 PM10/5/15
to Trac Users, charles...@gmail.com, ryan.j...@gmail.com


On Thursday, October 1, 2015 at 12:26:12 PM UTC-7, Erick D wrote:
Just added all users into session table with auth set to 1. It worked.
Thanks a bunch Ryan!

Glad all the issues are resolved. 

I believe the issue you were experiencing with TRAC_ADMIN and TRAC_Admin, and my inability to reproduce with SQLite, must be due to differences in handling of case-sensitivity between the databases. I've created an issue to investigate further:

To address the recurring issue of populating the assign-to field, created:

- Ryan 
Reply all
Reply to author
Forward
0 new messages