Tags:
create new tag
, view all tags

Bug: Use of uninitialized value in pattern match (m//) at ../lib/TWiki/Store/RcsFile.pm line 383

$logs/apache/error.log:

[Tue Sep 10 05:33:36 2002] null: Use of uninitialized value in pattern match (m//) at ../lib/TWiki/Store/RcsFile.pm line 383.
rcs: /var/local/www/pub/Main/WetlandsOrthoimage/RCS/_draft-map-Sept-10.png: No such file or directory
[Tue Sep 10 05:33:36 2002] null: copy(/var/tmp/CGItemp12019, /var/local/www/pub/Main/WetlandsOrthoimage/_draft-map-Sept-10.png) failed: No such file or directory at ../lib/TWiki/Store/RcsFile.pm line 452.
ci: /var/local/www/pub/Main/WetlandsOrthoimage/RCS/_draft-map-Sept-10.png: No such file or directory
[Tue Sep 10 05:33:36 2002] null: can't lock an attachment at ../lib/TWiki/Store/RcsFile.pm line 420.
[Tue Sep 10 05:33:36 2002] null: Use of uninitialized value in pattern match (m//) at ../lib/TWiki/Store/RcsFile.pm line 383.
rcs: /var/local/www/pub/Main/WetlandsOrthoimage/RCS/_draft-map-Sept-10.png: No such file or directory
[Tue Sep 10 05:33:36 2002] null: Use of uninitialized value in pattern match (m//) at ../lib/TWiki/Store/RcsFile.pm line 383.
rcs: /var/local/www/pub/Main/WetlandsOrthoimage/RCS/_draft-map-Sept-10.png: No such file or directory
[Tue Sep 10 05:33:37 2002] [error] [client 199.247.173.70] File does not exist: /var/local/www/pub//Main/WetlandsOrthoimage/_draft-map-Sept-10.png

Test case

Try to attach any image (jpg, png, gif) to any topic in the Main web.

Environment

TWiki version: 2002 Aug 3 beta
TWiki plugins: KoalaSkin, SeeSkin, CommentPlugin
Server OS: debian 3.0; kernel 2.4.18-bf2.4
Web server: Apache/1.3.26, mod_perl
Perl version: v5.6.1
Client OS: win2k
Web Browser: Mozilla 1.1

/etc/twiki/apache.conf:

# next bit from Codev.ShorterURLs
Alias /bin /var/local/www/bin/
Alias /pub /var/local/www/pub/
Alias / /var/local/www/bin/view/
AliasMatch ^/[A-Z](.*) /var/local/www/bin/view$1

RedirectMatch  ^/$ http://bumblebee/Main/
RedirectMatch  ^/bin/view(.*) http://bumblebee$1

# make sure this is even needed, and ref the doc section needing it
<Directory /var/local/www/bin/>
    Options +ExecCGI
    SetHandler cgi-script
    AllowOverride All
    #AllowOverride AuthConfig
    Allow from all
</Directory>

<Directory /var/local/www/pub>
    Options FollowSymLinks +Includes
    AllowOverride None
    Allow from all
</Directory>

/var/local/www/bin/.htaccess/:

<Files *>
        SetHandler perl-script
        PerlHandler Apache::Registry
        Options ExecCGI
        PerlSendHeader On
</Files>

-- MattWilkie - 10 Sep 2002

Follow up

I eventually discovered that $pub/* was owned by root so I chown'd everthing to www-data and now attaches work. Weird thing is, attaches worked for any topic in Sandbox even though the $pub/Sandbox directory was owned by root too.

I recommend the error message be changed to something like "error: no write access to xxxx". It would have saved me a couple hours of frustation.

-- MattWilkie - 10 Sep 2002

Thanks for reporting. Error checking needs to be added.

-- PeterThoeny - 11 Sep 2002

Fix record

I have to look - I may have fixed this with a patch from MartinG - SvenD

Partially - you get a browser error which is more helpful - but it's still incomplete (error report is not helpful, ci just says "file does not exist"), Wrong permissions are the most common cause of an error so here's a patch that makes it more helpful.

Index: RcsWrap.pm
===================================================================
--- RcsWrap.pm  (revision 1573)
+++ RcsWrap.pm  (working copy)
@@ -587,6 +587,11 @@
 {
     my( $self, $file, $comment, $userName ) = @_;

+    # Check that we can write the file being checked in. This won't check that
+    # $file,v is writable, but it _will_ trap 99% of all common errors (permissions
+    # on directory tree)
+    return "$file is not writable" unless ( -w $file );
+
     my $cmd = $self->{"ciCmd"};
     my $rcsOutput = "";
     $cmd =~ s/%USERNAME%/$userName/;
-- CrawfordCurrie - 14 Jul 2004
Topic revision: r6 - 2004-07-18 - PeterThoeny
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.