Edgewall Software
Modify

Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#4088 closed defect (worksforme)

webadmin links broken with latest trac svn

Reported by: bobbens Owned by: Christopher Lenz
Priority: normal Milestone:
Component: admin/web Version: devel
Severity: normal Keywords:
Cc: russ@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Hello,

I've recently ugraded to Trac SVN (r4155) and have noticed that this breaks a few plugins like TracNav, TOCMacro and the WebAdmin plugin. It all seems to be in the links. I'm hosting several trac servers under the same host using http://host/server1 and have noticed that once I get into the webadmin the links point to http://host/admin instead of http://host/server1/admin like they used to. The first link in the bar points to it fine and other things like interwiki links, the timeline and svn browser work fine. I haven't touched my config and a trac-admin /var/env upgrade doesnt seem to need to upgrade anything. I can still use the webadmin but have to enter manually the paths, which is quite annoying.

Attachments (2)

upgradeFrom10_1to10_3.py (602 bytes ) - added by russ@… 17 years ago.
upgradeFrom10_1to10_3.2.py (594 bytes ) - added by russ@… 17 years ago.

Download all attachments as: .zip

Change History (19)

comment:2 by Christian Boos, 17 years ago

Note that you should remove the WebAdmin plugin, as this functionality is now part of Trac core.

Also, check the

[trac]
base_url = ...

setting, which is now mandatory. That can explain this kind of weird behavior for links.

comment:3 by anonymous, 17 years ago

Cc: russ@… added

If you dont mind my asking, what changed that base_url is now mandatory. I have like a hundred trac instances to update to make this work now.

Is there something I can put in the trac global ini that would make this work as it used to? (defaulting to the url that the rest of trac is using?)

comment:4 by anonymous, 17 years ago

I am having the same problem. Using revision 4438, and I have the baseURL set as well. No difference. Also, I should note that typing the address in manually works fine, except when I have to hit a submit button on a page, then the submit fails (ie: permissions page). This happened on a site I upgraded and on one where I did trac-admin ./ initenv.

comment:5 by anonymous, 17 years ago

anonymous,

do you have base_url (note the underscore) set and is it set to something that has the full web address of your trac (ie http://foo.bar.com/trac). I had no problems with trac working correctly after I set this attribute in the trac section of the trac.ini file.

russ

ps I will attach a file script I found useful for updating many tracs at once

by russ@…, 17 years ago

Attachment: upgradeFrom10_1to10_3.py added

by russ@…, 17 years ago

Attachment: upgradeFrom10_1to10_3.2.py added

comment:6 by russ@…, 17 years ago

I left my server name in the first one (which I am guessing will be harder to notice than your.server.here.com when they accidentally go to the url. You should use the second uploaded version.

Sorry, Russ

in reply to:  5 comment:7 by Christian Boos, 17 years ago

Replying to russ:

… do you have base_url (note the underscore) set and is it set to something that has the full web address of your trac (ie http://foo.bar.com/trac). I had no problems with trac working correctly after I set this attribute in the trac section of the trac.ini file. … ps I will attach a file script I found useful for updating many tracs at once

Wait, are you sure this is something that has changed since 0.10.1 to 0.10.3?

In the comment comment:2 above, I was talking about milestone:0.11. If this has also changed for milestone:0.10.3, we should document it in the release notes.

comment:8 by russ@…, 17 years ago

All my plugins that use self.env.href.Someword() stopped working (until I defined that key), after I upgraded to r4303 (based on info http://trac.edgewall.org/milestone/0.10.2). I was trying to debug some interaction between my plugin and that version of trac. In an attempt to fix the linking problems, I upgraded to trac head (r4441). I don't have a link handy but after your comment yesterday I found a couple other tickets talking about how this key had become mandatory.

Either way, my plugin would not generate links correctly without that key on revision r4441. (Not sure what milestone that is flagged for)

Hope this helps /sorry for the confusion,

Russ

in reply to:  8 comment:9 by Christian Boos <cboos@…>, 17 years ago

Resolution: worksforme
Status: newclosed

Replying to russ:

… In an attempt to fix the linking problems, I upgraded to trac head (r4441) Either way, my plugin would not generate links correctly without that key on revision r4441. (Not sure what milestone that is flagged for)

Well, that's 0.11dev.

At any rate, avoid using self.env.href when you have the req (and therefore req.href).

self.env.href should only be used outside of the context of an user request, when you want to make use the "canonical" URL to access the Trac environment (e.g. when sending an e-mail notification).

Thanks for the patches, btw, I'm sure that can help other users having lots of Trac environments to update (even if they have less than hundreds!).

comment:10 by phpxcache@…, 17 years ago

Milestone: 0.11
Resolution: worksforme
Status: closedreopened

it's not working, i can reproduce it with lighttpd 1.4.x + trac.fcgi, without trac.base_url set, what more info should i provide?

comment:11 by Christian Boos, 17 years ago

Keywords: needinfo added
Milestone: 0.11
  • which version of Trac are you using?
  • if trunk, are you still using the WebAdmin plugin by any chance? It must be uninstalled or at least disabled in the 0.11 environments.

Also, please don't schedule anything for 0.11, thanks.

comment:12 by Christian Boos, 17 years ago

Btw, if you're using a recent trunk, look for the following line in your log:

WARNING: TracWebAdmin plugin was used instead of Trac's builtin admin module. ...

comment:13 by phpxcache@…, 17 years ago

Keywords: needinfo removed

okay, here's the feedback:

TracWebAdmin package is required for most of the old admin plugins to be compatible with 0.11 admin. and yes, i can and should be disabled to enable 0.11 internal admin.

the test is done when base_url is empty

  1. when TracWebAdmin is enabled. result: admin links is broken
  2. when TracWebAdmin is installed but disabled. result: other admin links work but both iniadmin 0.10 and iniadmin 0.11 will do a wrong url redirect after submit. iniadmin 0.10 was working fine with trac 0.10, it would better not to break any plugins this way, not just iniadmin. and yes, i saw WARNING: TracWebAdmin plugin was used instead of Trac's builtin admin module. ... because some of my installe and enabled plugins try to import it.
  3. when TracWebAdmin is NOT installed, almost same as 2, but the WARNING is gone, and iniadmin 0.10 no longer works (no iniadmin links in admin page), iniadmin 0.11 is the same as 2.

in reply to:  13 comment:14 by Christian Boos, 17 years ago

Replying to phpxcache@gmail.com:

okay, here's the feedback …

Thanks!

… when TracWebAdmin is installed but disabled. result: other admin links work but both iniadmin 0.10 and iniadmin 0.11 will do a wrong url redirect after submit.

Well, iniadmin 0.11 should work with 0.11. If not, that's an iniadmin issue.

iniadmin 0.10 was working fine with trac 0.10, it would better not to break any plugins this way, not just iniadmin.

Well, too many things changed from 0.10 to 0.11 so that can't ensure a out-of-the-box compatibility. At least some minimal porting work is expected.

I'll try to have a look at the specifics of the iniadmin problem, though.

comment:15 by Christian Boos, 17 years ago

Resolution: worksforme
Status: reopenedclosed

Well, the following works for me:

As for the need of a base_url setting, see also the recent discussion in googlegroups:trac-dev:af5abb087ad85d02

comment:16 by phpxcache@…, 17 years ago

in iniadmin/iniadmin.py, i add a self.log.debug(self.env.href.admin(cat, page)) just before the redirect, it logs /admin/tracini/account-manager without auto detected base_url. tracnav "edit" link also due to the same reason (the broken env.href)

i'll leave this bug as close, but downgrading the auto detect ability and force ppl to set it in most case isn't nice.

comment:17 by Christian Boos, 17 years ago

Indeed, it should be:

  • iniadmin.py

     
    3838            if modified:
    3939                self.env.log.debug("Updating trac.ini")
    4040                self.env.config.save()
    41             req.redirect(self.env.href.admin(cat, page))
     41            req.redirect(req.href.admin(cat, page))
    4242
    4343
    4444        add_stylesheet(req, 'iniadmin/css/iniadmin.css')

Using env.href without base_url set is not supported anymore since r4086. That being said, the discussion is not over, follow #5064 and the mail thread cited above.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christopher Lenz.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christopher Lenz 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.