[BUG] Faulty IMSLP/WIMA redirections

Moderators: kcleung, Wiki Admins

Re: [BUG] Faulty IMSLP/WIMA redirections

Postby imslp » Tue Dec 27, 2011 4:39 pm

Would it be possible for you to add /bounce/ to the beginning of the URL instead of changing it to /scores1/? I.e., /bounce/scores/asola/Asola_O-Vos-Omnes-SAB.pdf I ask this just because /scores/ is part of the URL, and changing it is slightly more messy than appending /bounce/ in front.

Otherwise, I've already fixed it in the code, should go live on the next update cycle.
imslp
Site Admin
 
Posts: 1508
Joined: Thu Jan 01, 1970 12:00 am

Re: [BUG] Faulty IMSLP/WIMA redirections

Postby reccmo » Tue Dec 27, 2011 5:19 pm

imslp wrote:Would it be possible for you to add /bounce/ to the beginning of the URL instead of changing it to /scores1/? I.e., /bounce/scores/asola/Asola_O-Vos-Omnes-SAB.pdf I ask this just because /scores/ is part of the URL, and changing it is slightly more messy than appending /bounce/ in front.


Done. There is now a directory 'http://icking-music-archive.org/bounce/' containing a symlink to 'http://icking-music-archive.org/scores'. So all URLS like 'http://icking-music-archive.org/bounce/scores/foo/bar.pdf' will be valid provided the URL 'http://icking-music-archive.org/scores/foo/bar.pdf' is valid.

imslp wrote:Otherwise, I've already fixed it in the code, should go live on the next update cycle.
reccmo
active poster
 
Posts: 252
Joined: Mon Aug 08, 2011 8:54 am
Location: Aarhus, Denmark

Re: [BUG] Faulty IMSLP/WIMA redirections

Postby reccmo » Wed Dec 28, 2011 9:52 pm

reccmo wrote:
imslp wrote:Would it be possible for you to add /bounce/ to the beginning of the URL instead of changing it to /scores1/? I.e., /bounce/scores/asola/Asola_O-Vos-Omnes-SAB.pdf I ask this just because /scores/ is part of the URL, and changing it is slightly more messy than appending /bounce/ in front.


Done. There is now a directory 'http://icking-music-archive.org/bounce/' containing a symlink to 'http://icking-music-archive.org/scores'. So all URLS like 'http://icking-music-archive.org/bounce/scores/foo/bar.pdf' will be valid provided the URL 'http://icking-music-archive.org/scores/foo/bar.pdf' is valid.

imslp wrote:Otherwise, I've already fixed it in the code, should go live on the next update cycle.


How often does that update cycle take place? The generic redirect still has the reported error prone behavior.
reccmo
active poster
 
Posts: 252
Joined: Mon Aug 08, 2011 8:54 am
Location: Aarhus, Denmark

Re: [BUG] Faulty IMSLP/WIMA redirections

Postby imslp » Thu Dec 29, 2011 4:55 am

At the very latest the end of January, though I'll try to see if I can do it before then.
imslp
Site Admin
 
Posts: 1508
Joined: Thu Jan 01, 1970 12:00 am

Re: [BUG] Faulty IMSLP/WIMA redirections

Postby reccmo » Thu Dec 29, 2011 9:08 am

imslp wrote:At the very latest the end of January, though I'll try to see if I can do it before then.


When you perform the update please consider making the generic redirect code readable in http://imslp.org/wiki/Special:WIMALookup. That might be helpful for me and Max for maintaining the corresponding WIMA server side code.

I suppose bounced WIMA files will be prefixed with '/bounce/'?
reccmo
active poster
 
Posts: 252
Joined: Mon Aug 08, 2011 8:54 am
Location: Aarhus, Denmark

Re: [BUG] Faulty IMSLP/WIMA redirections

Postby imslp » Thu Dec 29, 2011 3:59 pm

reccmo wrote:
imslp wrote:At the very latest the end of January, though I'll try to see if I can do it before then.


When you perform the update please consider making the generic redirect code readable in http://imslp.org/wiki/Special:WIMALookup. That might be helpful for me and Max for maintaining the corresponding WIMA server side code.


I'm not sure I understand what you mean by "generic redirect code"...

I suppose bounced WIMA files will be prefixed with '/bounce/'?


Yes
imslp
Site Admin
 
Posts: 1508
Joined: Thu Jan 01, 1970 12:00 am

Re: [BUG] Faulty IMSLP/WIMA redirections

Postby reccmo » Thu Dec 29, 2011 9:27 pm

imslp wrote:I'm not sure I understand what you mean by "generic redirect code"...


I'm referring to the code used in 'http://imslp.org/wiki/Special:WIMALookup'
reccmo
active poster
 
Posts: 252
Joined: Mon Aug 08, 2011 8:54 am
Location: Aarhus, Denmark

Re: [BUG] Faulty IMSLP/WIMA redirections

Postby imslp » Wed Jan 04, 2012 7:48 am

This is now implemented in Special:WIMALookup. However, there is still a redirect loop for non-existent files, because /bounce/ still redirects back to IMSLP, which it should never do (all errors, e.g. non-existent files, must be processed on WIMA's server to prevent the redirect loop).
imslp
Site Admin
 
Posts: 1508
Joined: Thu Jan 01, 1970 12:00 am

Re: [BUG] Faulty IMSLP/WIMA redirections

Postby reccmo » Wed Jan 04, 2012 4:11 pm

imslp wrote:This is now implemented in Special:WIMALookup. However, there is still a redirect loop for non-existent files, because /bounce/ still redirects back to IMSLP, which it should never do (all errors, e.g. non-existent files, must be processed on WIMA's server to prevent the redirect loop).


On the WIMA server the redirects are now handled like this

  • The .htaccess file in the scores root folder, 'http://icking-music-archive.org/scores/' includes a handler for .pdf- and audio files
    Code: Select all
    RewriteEngine on
    RewriteRule ^(.*)\.(pdf|mp3|mid|midi)$ /Redirect.php?file=$1.$2 [R,L]
  • The php script pointed to, 'http://icking-music-archive.org/Redirect.php' says
    Code: Select all
    $start_dir = "/scores/";
    $imslp_url = "http://imslp.org/index.php?title=Special:WIMALookup&url=";
    $filename = $_GET['file'];
    header("location: ".$imslp_url.$start_dir.$filename);
  • If the URL returned by 'Special:WIMALookup' points to a file transferred to IMSLP then we end up at the IMSLP work page in question,
    else we end up at the WIMA folder 'http://icking-music-archive.org/bounce/'
  • The folder, 'http://icking-music-archive.org/bounce/' contains nothing but a .htaccess file
    Code: Select all
    RewriteEngine on
    RewriteRule ^(.*)\.(.*) /Bounce.php?file=$1.$2 [R,L]
  • The php script pointed to, 'http://icking-music-archive.org/Bounce.php' says
    Code: Select all
    $start_dir = "/scores1";
    $filename_in = $_GET['file'];
    $filename_out = $start_dir . preg_replace('/scores/','',$filename_in,1);
    header("location: ".$filename_out);
  • The folder, 'http://icking-music-archive.org/scores1/' contains symbolic links to all the folder inodes in 'http://icking-music-archive.org/scores/' plus a .htaccess file with 'not-found' handlers. Due to the symlinked folder inodes valid URLs within 'http://icking-music-archive.org/scores/' are also valid within 'http://icking-music-archive.org/scores1/'. But there is no redirection handler in this folder which could cause infinite loops.

I've successfully performed a couple of WIMA->IMSLP transfers with the above outlined method taken into production. Please let me know if I overlooked any pitfalls.
reccmo
active poster
 
Posts: 252
Joined: Mon Aug 08, 2011 8:54 am
Location: Aarhus, Denmark

Re: [BUG] Faulty IMSLP/WIMA redirections

Postby imslp » Thu Jan 05, 2012 10:23 am

I think you are missing a blackslash at the end of "/scores1"
imslp
Site Admin
 
Posts: 1508
Joined: Thu Jan 01, 1970 12:00 am

Re: [BUG] Faulty IMSLP/WIMA redirections

Postby reccmo » Thu Jan 05, 2012 3:06 pm

imslp wrote:I think you are missing a blackslash at the end of "/scores1"


When WIMA's Apache server receives a file request in the folder 'http://icking-music-archive.org/bounce/' it looks like

scores/foo/bar.pdf

Hence the php regex replacement function

preg_replace('/scores/','',$filename_in,1)

will return

/foo/bar.pdf

That's why I omit a trailing slash at '/scores1': the redirect address is a concatenation of '/scores1' and the string returned by preg_replace.
reccmo
active poster
 
Posts: 252
Joined: Mon Aug 08, 2011 8:54 am
Location: Aarhus, Denmark

Re: [BUG] Faulty IMSLP/WIMA redirections

Postby jeko89 » Tue Mar 06, 2012 5:35 pm

Hi everybody,
I raised the problem months ago but I don't think is solved:
The last PDF by Brodersen at page http://icking-music-archive.org/ByComposer/Altnikol.php still doesn't link back to IMSLP....and I suppose it happens to many others...
:(
jeko89
 
Posts: 5
Joined: Tue Oct 04, 2011 12:23 pm

Re: [BUG] Faulty IMSLP/WIMA redirections

Postby Carlos M » Mon Dec 10, 2012 6:41 pm

I've reported a related bug at the wiki but here is probably the best place to discuss it: composer redirections from WIMA sometimes end up on a nonexistent page at IMSLP, because of faulty character conversion. This only happens for composer names that contain language-specific characters:

http://icking-music-archive.org/ByComposer/Couperin.php
http://icking-music-archive.org/ByComposer/Boely.php

There are many articles on Wikipedia which still point to such pages.
Carlos M
 
Posts: 1
Joined: Mon Dec 10, 2012 5:15 pm

Re: [BUG] Faulty IMSLP/WIMA redirections

Postby reccmo » Tue Dec 11, 2012 10:56 pm

Carlos M wrote:I've reported a related bug at the wiki but here is probably the best place to discuss it: composer redirections from WIMA sometimes end up on a nonexistent page at IMSLP, because of faulty character conversion. This only happens for composer names that contain language-specific characters:

http://icking-music-archive.org/ByComposer/Couperin.php
http://icking-music-archive.org/ByComposer/Boely.php

There are many articles on Wikipedia which still point to such pages.


I believe the error was due to corrupted character encoding (latin1/utf-8) corrupted during file transfer between linux servers. I've been using wget to check all WIMA/IMSLP redirects through a perl script. The result was this list of WIMA composer pages with non working redirects

Albeniz.php
M.Albeniz.php
Amann.php
Ahlstroem.php
Baekgaard.php
Benaut.php
J.Bloch.php
Boellmann.php
Boely.php
Boeddecker.php
Bridgham.php
Calviere.php
Campra.php
Clerambault.php
Couperin.php
dAgincourt.php
Dominguez.php
Droste-Huelshoff.php
Dvorak.php
Foerster.php
Galles.php
Grueber.php
Jomelli.php
A.Klein.php
Kuehnel.php
Lange.php
Lefebure-Wely.php
Lenzi.php
Macque.php
Milan.php
Miramontes.php
Mondonville.php
Mueller.php
Narvaez.php
Oginski.php
Pedersen.php
Perez.php
Philidor.php
C.Raehs.php
Raehs.php
Rosenmueller.php
Selma.php
Sussmayr.php
Szervac.php
Vivanco.php

I've edited the redirects of these pages and moved the redirect source to WIMA's database.

Please let me know if (or rather when) you encounter new redirect flaws.
reccmo
active poster
 
Posts: 252
Joined: Mon Aug 08, 2011 8:54 am
Location: Aarhus, Denmark

Previous

Return to Feature Requests / Bug Reports

Who is online

Users browsing this forum: No registered users and 1 guest