Tags:
create new tag
, view all tags

Question

I am getting errors while attaching files. I tried both suggestions reported in AttachFailure to no avail. The problem seems to be that directories do not get created (being the first attachment, twiki needs to create a directory). Therefore I tried install instead of cp, again with no success. Log:


copy(/usr/tmp/CGItemp60942, /home/httpd/twiki/pub/Bioinf/Toolbox/cmpMSMS.pl) failed: No such file or directory at /home/httpd/twiki/bin/upload line 414.
copy(/usr/tmp/CGItemp59215, /home/httpd/twiki/pub/Test/TestTopic8/cmpMSMS.pl) failed: No such file or directory at /home/httpd/twiki/bin/upload line 414.
[Thu Jun 14 01:46:15 2001] [error] [client 192.168.190.99] File does not exist:
/home/httpd/twiki/pub/Test/TestTopic8/cmpMSMS.pl
[Thu Jun 14 01:48:40 2001] [error] [client 192.168.190.99] File does not exist:
/home/httpd/twiki/pub/Bioinf/Toolbox/cmpMSMS.pl
/bin/cp: cannot create regular file `/home/httpd/twiki/pub/Bioinf/Toolbox/cmpMSMS.pl': No such file or directory
copy(/usr/tmp/CGItemp60739, /home/httpd/twiki/pub/Bioinf/Toolbox/cmpMSMS.pl) failed:  at /home/httpd/twiki/bin/upload line 415.
[Thu Jun 14 01:55:04 2001] [error] [client 192.168.190.99] File does not exist:
/home/httpd/twiki/pub/Bioinf/Toolbox/cmpMSMS.pl
Can't exec "/usr/bin/install/usr/tmp/CGItemp60859": Not a directory at /home/httpd/twiki/bin/upload line 415.
copy(/usr/tmp/CGItemp60859, /home/httpd/twiki/pub/Bioinf/Toolbox/cmpMSMS.pl) failed: Not a directory at /home/httpd/twiki/bin/upload line 415.
[Thu Jun 14 01:55:16 2001] [error] [client 192.168.190.99] File does not exist:
/home/httpd/twiki/pub/Bioinf/Toolbox/cmpMSMS.pl
/usr/bin/install: cannot create regular file `/home/httpd/twiki/pub/Bioinf/Toolbox/cmpMSMS.pl': No such file or directory
copy(/usr/tmp/CGItemp60869, /home/httpd/twiki/pub/Bioinf/Toolbox/cmpMSMS.pl) failed:  at /home/httpd/twiki/bin/upload line 415.
[Thu Jun 14 01:56:56 2001] [error] [client 192.168.190.99] File does not exist:
/home/httpd/twiki/pub/Bioinf/Toolbox/cmpMSMS.pl       

Finally, I created the dirs by hand and changed permission to 755, owner twiki. Result:

[Thu Jun 14 01:56:56 2001] [error] [client 192.168.190.99] File does not exist:
/home/httpd/twiki/pub/Bioinf/Toolbox/cmpMSMS.pl
/usr/bin/install: cannot create regular file `/home/httpd/twiki/pub/Bioinf/Toolbox/cmpMSMS.pl': Permission denied
copy(/usr/tmp/CGItemp60868, /home/httpd/twiki/pub/Bioinf/Toolbox/cmpMSMS.pl) failed:  at /home/httpd/twiki/bin/upload line 415.
[Thu Jun 14 02:11:02 2001] [error] [client 192.168.190.99] File does not exist:
/home/httpd/twiki/pub/Bioinf/Toolbox/cmpMSMS.pl   

Any hint?

Thanks for your assistance

.

  • TWiki version: Dec 2000
  • Web server: apache-1.3.12-25
  • Server OS: RH 7.0 linux 2.2.16-22

-- AntonioPiccolboni - 14 Jun 2001

Answer

The easiest way to solve attachment problems is typically to do this for all your <WEB> directories:

chmod -R go+w /home/httpd/twiki/pub/<WEB>
This also needs to be done for the data/<WEB> directories.

This is all very insecure if you have any other users on this server - ideally you would just create these directories as owner nobody (used by Apache), mode 755 - but it's quite hard to do this if you don't have root.

See SecureSetup for discussion on how to set up TWiki more securely.

-- RichardDonkin - 14 Jun 2001


Question (again)

I seem to be having a similar problem: If I try to attach a file for the first time, the error log shows

upload: copy(/var/tmp/CGItemp51626, /Library/WebServer/TWiki/pub/Test/AttachTest/yup.txt) failed: No such file or directory at ../lib/TWiki/Store.pm line 771.
It's pretty clear that saveAttachment is failing to "create directories if they don't exist". If I create them by hand and then try attaching a file, all is well.

I have done chmod 777 on the pub directory, but this didn't help.

I must be overlooking something, because it was working fine on the first TWiki installation I made on a different server. (This is a brand new setup to replace the old one.)

  • TWiki version: Sep 2001
  • Web server: Apache 1.3.20
  • Server OS: Mac OS X 10.1

-- JonReid - 09 Nov 2001

Answer

It looks like the web directory or topic directory did not get created due to a permission problem. Check the permissions of the pub/Test directory. Also, test if the temporary file really exists. You need to do that check before you copy the file, i.e. with a &TWiki::writeDebug("Temp file $theTmpFilename exists") if( ! -e $theTmpFilename );

-- PeterThoeny - 10 Nov 2001

If I make the web directory by hand, it has no problem creating new topic directories. Odd, but I can live with it.

-- JonReid - 12 Nov 2001


Question (again)

I'm having similar problems when trying to attach a file - on one machine, I get this error:

Software error: CGI.pm: Server closed socket during multipart read (client aborted?).

And on another machine, it just says the file is empty or missing.

I've had a look at the upload script, and I've got the latest version of CGI.pm (Perl 5.8.0) - I'm running it under Windows2000 and Apache, and have tweaked lots of elements to get them to work (the WindowsInstallCookbook was a good starter). I can't seem to figure out what the problem is. Turning debug on shows something like:

use of uninitialized value in hash element at (eval 28) line 3

Putting a debug printline in the upload script shows the fault around filepath, but I still think it's CGI related.....HELP!!!

-- ClaudeSchneider - 20 Aug 2002

Please create a new question under AskedQuestions, including the versions you are using, and attach the output of the latest testenv (you can download this from CVSget:bin/testenv) - the latter will tell us your CGI.pm version. See SupportGuidelines for useful information to help resolve your problems.

Note that some people have had problems with Perl 5.8.0 and TWiki - there is much more experience with 5.6.x, but of course it should 'just work' smile

-- RichardDonkin - 21 Aug 2002

Topic revision: r10 - 2002-09-13 - PeterThoeny
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by PerlIdeas, 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.