SID-01001: Some webs inaccessible after upgrade
| Status: |
Answered |
TWiki version: |
5.0.1 |
Perl version: |
Perl 5.10.1 |
| Category: |
CategoryInstallation |
Server OS: |
Solaris 10 |
Last update: |
13 years ago |
I am trying to upgrade my site from TWiki-4.1.2 to TWiki-5.0.1.
I have installed the latest version of TWiki on a new server (Solaris 10/SPARC with Apache 2.2.17 and Perl 5.10.1) and everything seems to work well.
However, after I had copied my own data into the new docroot, only some of the webs were visible, even though I can see the data in the docroot.
If I try to access one of the "missing" webs manually, I get: "Access check on
Main failed. Action "redirect": unsafe redirect to
http://twikitoo.teamtalk.comhttp://twikitoo.teamtalk.com/twiki/bin/viewauth
: host does not match {DefaultUrlHost} , and is not in {PermittedRedirectHostUrls}"http://twikitoo.teamtalk.com". "
...which looks to me like it's stuffing DefaultUrlHost in somewhere twice.
I have seen questions about a similar problem in earlier versions, but cannot find anything current.
Does anyone have a clue as to what is going on?
--
JonArmitage - 2010-10-20
Discussion and Answer
Hello. New server, maybe new IP? Check in
http://your-server/twiki/bin/configure
for the {DefaultUrlHost} parameter in "General path settings". It must match the server IP or name.
Check also file permissions (
SettingFileAccessRightsLinuxUnix)
--
EnriqueCadalso - 2010-10-22
Troubleshooting tip: Start from a clean slate. Remove or rename
twiki/lib/LocalSite.cfg and run configure to re-create the configuration from scratch.
--
PeterThoeny - 2010-10-22
Hey, I encountered the same behaviour. Must be some change introduced in the latest versions of twiki.
I did some research an made a first simple "quick and dirty" patch. If anyone is interested:
- Just download the attachment and place it into the "twiki root" dir, i.e.:
cp ApacheLogin.patch /home/twiki/ApacheLogin.patch
- then enter that dir, i.e.:
cd /home/twiki
- then patch it, by:
patch lib/TWiki/LoginManager/ApacheLogin.pm < ApacheLogin.patch
That should it be. For me it works like a charm. Have fun!
--
RolandOldenburg - 2010-12-08
Thanks Roland for the patch. I have not tried it, but just reading the patch I see some issues. For example, the "else" of the "if" is never reached if you append web and topic.
$twiki->getScriptUrl(1, $scriptName) returns an absolute URL that includes the protocol and host, so those need to be excluded when building the URL. Here is an untested patch.
--- lib/TWiki/LoginManager/ApacheLogin.pm (revision 22664)
+++ lib/TWiki/LoginManager/ApacheLogin.pm (working copy)
@@ -91,7 +91,7 @@
if( $url && $url =~ m!(.*/$scriptName)([^?]*)! ) {
# $url should not contain query string as it gets appended
# in TWiki::redirect. Script gets 'auth' appended.
- $url = "$twiki->{urlHost}${1}auth$2";
+ $url = "${1}auth$2";
} else {
if( $twiki->{request}->action !~ /auth$/ ) {
$url = $twiki->{urlHost}.'/'.$twiki->{request}->action . 'auth';
Please text and report back if this fixes the issue.
--
PeterThoeny - 2012-03-23
By implementing Peter's patch our test shows that the URL returned is of the form
http://hostname/twiki/bin/viewauth
The
Web and
Topic are missing from the URL so the user is returned to the default TWiki page.
I think this is why Roland appended the Web and Topic so that $2 picks them up in
$url = "${1}auth$2";
--
PeterJones - 2012-03-27
OK, please try this:
--- lib/TWiki/LoginManager/ApacheLogin.pm (revision 22664)
+++ lib/TWiki/LoginManager/ApacheLogin.pm (working copy)
@@ -87,11 +87,11 @@
# the path info, and the query string. All three query
# variables are in the list of the canonical request meta
# variables in CGI 1.1 (also provided by TWiki::Request).
- my $url = $twiki->getScriptUrl(1, $scriptName);
+ my $url = $twiki->getScriptUrl(1, $scriptName, $twiki->{webName}, $twiki->{topicName});
if( $url && $url =~ m!(.*/$scriptName)([^?]*)! ) {
# $url should not contain query string as it gets appended
# in TWiki::redirect. Script gets 'auth' appended.
- $url = "$twiki->{urlHost}${1}auth$2";
+ $url = "${1}auth$2";
} else {
if( $twiki->{request}->action !~ /auth$/ ) {
$url = $twiki->{urlHost}.'/'.$twiki->{request}->action . 'auth';
--
PeterThoeny - 2012-03-27
Success
We have tested the latest patch and have not found any problems yet.
--
PeterJones - 2012-04-03
This is handled in
TWikibug:Item6865
.
Now in SVN trunk and TWiki-5.1 release. Thanks
RolandOldenburg for the patch!
--
PeterThoeny - 2012-04-03
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.