Bug#963071: daily errors in webwml/check_trans.pl (called by cron/scripts/check_trans.sh)

2020-06-18 Thread Steve McIntyre
On Thu, Jun 18, 2020 at 03:59:21PM +0200, Laura Arjona Reina wrote:
>Package: www.debian.org
>User www.debian@packages.debian.org
>Usertag: scripts
>Severity: normal
>
>We are receiving daily errors about the check_trans.pl tool on top of
>the webwml folder, it seems Perl is not able to get the translator.db.pl
>files for each language. We have 2 types of error:
>
>1.- L1024: require $db_file; fails, but the file is there. For example
>arabic:
>
>Can't locate arabic/international/arabic/translator.db.pl in @INC (@INC
>contains: /srv/www.debian.org/webwml/Perl /etc/perl
>/usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1
>/usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5
>/usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24
>/usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at
>./check_trans.pl line 1024.
>
>We didn't change the check_trans.pl recently, I guess maybe something
>changed in the Perl environment that we need to provide the full path to
>the file (and not only relative path) or load the file in other way, no
>idea. Any Perl expert around?

ACK. Simple tweak is to modify the reauire slightly:

-   require $db_file;
+   require "./$db_file";

and that fixes this. I've no idea why this worked before but not now,
though. :-(

>2.- L1024: require $db_file; fails because the file is in other folder,
>for example Chinese:
>
>File `chinese/international/chinese/translator.db.pl' doesn't exist!
>I need my DBs to send mails.
>Please read the comments in the script and try again
>
>
>(The translator.db.pl is in the
>chinese/international/Chinese/translator.db.pl path). This issue
>(translator.db.pl in a diferent path) happens for 3 languages only:
>
>./catalan/international/Catalan/translator.db.pl
>./chinese/international/Chinese/translator.db.pl
>./german/international/German/translator.db.pl

Again, I have no idea WTH has *changed* here that might have caused
things to break suddenly! It looks like require is now suddenly acting
more strictly or something...

>I guess we need to:
>A.- move the translator.db.pl file to the corresponding folder with
>lower case letters
>or
>B.- add logic to the check_trans.pl to try the folder with capital
>letter if the usual path fails
>
>I tend to the A proposal because it's the one that I can do, but if
>there is anybody who can provide B, that's more elegant I guess :-)

Option A looks like the obvious thing to do, so I've just done it. I
don't see any good reason for the leading-cap names to exist here?

-- 
Steve McIntyre, Cambridge, UK.st...@einval.com
The two hard things in computing:
 * naming things
 * cache invalidation
 * off-by-one errors  -- Stig Sandbeck Mathisen



Bug#963071: daily errors in webwml/check_trans.pl (called by cron/scripts/check_trans.sh)

2020-06-18 Thread Laura Arjona Reina
Package: www.debian.org
User www.debian@packages.debian.org
Usertag: scripts
Severity: normal

We are receiving daily errors about the check_trans.pl tool on top of
the webwml folder, it seems Perl is not able to get the translator.db.pl
files for each language. We have 2 types of error:

1.- L1024: require $db_file; fails, but the file is there. For example
arabic:

Can't locate arabic/international/arabic/translator.db.pl in @INC (@INC
contains: /srv/www.debian.org/webwml/Perl /etc/perl
/usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1
/usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5
/usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24
/usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at
./check_trans.pl line 1024.

We didn't change the check_trans.pl recently, I guess maybe something
changed in the Perl environment that we need to provide the full path to
the file (and not only relative path) or load the file in other way, no
idea. Any Perl expert around?

2.- L1024: require $db_file; fails because the file is in other folder,
for example Chinese:

File `chinese/international/chinese/translator.db.pl' doesn't exist!
I need my DBs to send mails.
Please read the comments in the script and try again


(The translator.db.pl is in the
chinese/international/Chinese/translator.db.pl path). This issue
(translator.db.pl in a diferent path) happens for 3 languages only:

./catalan/international/Catalan/translator.db.pl
./chinese/international/Chinese/translator.db.pl
./german/international/German/translator.db.pl

I guess we need to:
A.- move the translator.db.pl file to the corresponding folder with
lower case letters
or
B.- add logic to the check_trans.pl to try the folder with capital
letter if the usual path fails

I tend to the A proposal because it's the one that I can do, but if
there is anybody who can provide B, that's more elegant I guess :-)

Kind regards,

Laura Arjona Reina
https://www.debian.org/LauraArjona