Project

General

Profile

Actions

Defect #3334

closed

Unable to delete wiki page attachments.

Added by James Byrne over 15 years ago. Updated over 15 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Attachments
Target version:
-
Start date:
2009-05-11
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

Attempts to delete attachments cause an internal server error. The Apache log file displays this:

[Mon May 11 10:24:08 2009] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
Error during failsafe response: closed stream
(originally closed stream)
[ pid=26862 file=ext/apache2/Hooks.cpp:547 time=2009-05-11 10:26:42.642 ]:
  Backend process 26946 did not return a valid HTTP response. It returned no data.

The configuration data for this installation are:


ruby 1.8.6 (2007-09-24 patchlevel 111) [i686-linux]
# svn info
Path: .
URL: http://redmine.rubyforge.org/svn/trunk
Repository Root: http://redmine.rubyforge.org/svn
Repository UUID: e93f8b46-1217-0410-a6f0-8f06a7374b81
Revision: 2658
Node Kind: directory
Schedule: normal
Last Changed Author: jplang
Last Changed Rev: 2655
Last Changed Date: 2009-04-05 08:33:45 -0400 (Sun, 05 Apr 2009)
# rake db:version = Current version: 20090214190337

# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.2.2' unless defined? RAILS_GEM_VERSION

This issue was first noticed immediately following an update to Redmine V0.8.3 from the trunk repository:

  1. svn update -r 2658

Based on "2658 2009-04-05 14:59 Jean-Philippe Lang tagged version 0.8.3"

Actions #1

Updated by Jean-Philippe Lang over 15 years ago

Can you attach your Redmine log because I'm not able to reproduce with current trunk.

Actions #2

Updated by James Byrne over 15 years ago

Nothing to attach. There are no entries created in the production log when this error happens.

# ll
total 20
-rw-r--r-- 1 root root 36 May  9 09:57 delete.me
-rw-rw-rw- 1 pas  pas   0 May 12 03:15 development.log
-rw-r--r-- 1 pas  pas   0 May 12 03:15 production.log
-rw-r--r-- 1 pas  pas   0 May 12 03:15 test.log

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
Apache/2.2.3 (CentOS) Server at pas.harte-lyne.ca Port 443

Actions #3

Updated by James Byrne over 15 years ago

I discover that the same problem occurs when attempting to upload a file to a wiki page or on the files page.

Actions #4

Updated by Jean-Philippe Lang over 15 years ago

Please try to reproduce with webrick:

ruby script/server -e production -p <port>
Actions #5

Updated by James Byrne over 15 years ago

But I see this. I have not changed permissions or ownership on any directories. Would updating from svn do so?

Redmine 0.8.0.devel.2658 (PostgreSQL)
Default administrator account changed True
Attachments directory writable (/var/data/pas-redmine/files) False
Plugin assets directory writable (/var/data/pas-redmine/public/plugin_assets) False
RMagick available (optional)

Actions #6

Updated by James Byrne over 15 years ago

Webrick works fine. But I use https protocol with Apache. I see this in the ssl.error.log when trying to delete an attachment.

[Tue May 12 17:02:47 2009] [error] [client 216.185.71.24] Premature end of script headers: attachments, referer: https://pas.harte-lyne.ca/projects/hll-administration/files

Actions #7

Updated by James Byrne over 15 years ago

I probably should mention that I use mod_rails (Phusion Passenger) as well.

Actions #8

Updated by Jean-Philippe Lang over 15 years ago

I can't do anything without the application stack trace.

Actions #9

Updated by James Byrne over 15 years ago

Jean-Philippe Lang wrote:

I can't do anything without the application stack trace.

There is no stack trace. The application does not blow up. It simply renders the error and permits one to continue. I believe that the error message is related to this:

http://httpd.apache.org/docs/1.3/misc/FAQ-F.html#premature-script-headers

I think that the issue is either the permissions or the ownership of the directory and files. In my installation the apache user belongs to the pas group and the pas user and group own all of the redmine directory tree. This configuration worked up until the last update. I do not know what changed but I suspect this is where the problem is.

Actions #10

Updated by James Byrne over 15 years ago

How does redmine determine these values or where are they set?

Information

Redmine 0.8.0.devel.2658 (PostgreSQL)
Default administrator account changed True
Attachments directory writable (/var/data/pas-redmine/files) False
Plugin assets directory writable (/var/data/pas-redmine/public/plugin_assets) False
RMagick available (optional) False

Actions #11

Updated by James Byrne over 15 years ago

I looked into the admin controller to discover how this is done and this is what I found:

# 
# ll -d files
drwxrwxr-x 3 apache pas 20480 May 12 16:59 files
#
# su pas
sh-3.2$ echo $RAILS_ENV
production
sh-3.2$ script/console
Loading production environment (Rails 2.2.2)
>> File.writable?(Attachment.storage_path)
=> true
>> File.writable?(Engines.public_directory)
=> true
>> exit
sh-3.2$ exit
exit
[root@inet01 pas-redmine]# su apache
sh-3.2$ script/console
Loading production environment (Rails 2.2.2)
Rails Error: Unable to access log file. Please ensure that /var/data/pas-redmine/log/production.log exists
and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem
is fixed.
>> File.writable?(Attachment.storage_path)
=> true
>> File.writable?(Engines.public_directory)
=> true
>> exit

So, why am I getting un-writable results when accessing the application through apache?

# User/Group: The name (or #number) of the user/group to run httpd as.
#  . On SCO (ODT 3) use "User nouser" and "Group nogroup".
#  . On HPUX you may not be able to use shared memory as nobody, and the
#    suggested workaround is to create a user www and use that user.
#  NOTE that some kernels refuse to setgid(Group) or semctl(IPC_SET)
#  when the value of (unsigned)Group is above 60000; 
#  don't use Group #-1 on these systems!
#
User apache
Group apache

Even this works:

# ll -d files
drwxrwxr-x 3 pas pas 20480 May 12 16:59 files
# su apache
sh-3.2$ script/console
Loading production environment (Rails 2.2.2)
>> File.writable?(Attachment.storage_path)
=> true
>> Attachment.storage_path
=> "/var/data/pas-redmine/files" 
>> %x[echo $RAILS_ENV]
=> "production\n" 
>>
Actions #12

Updated by Jean-Philippe Lang over 15 years ago

  • Status changed from New to Closed
  • Resolution set to Invalid

Sorry, but I have to close this ticket since it's definitely not a Redmine defect.

Actions #13

Updated by James Byrne over 15 years ago

James Byrne wrote:

I probably should mention that I use mod_rails (Phusion Passenger) as well.

This was an issue with Passenger. Due to some local changes to environment.rb the ownership of that file was inadvertently changed during the Redmine upgrade process and this was not noticed. The owner of the environment.rb file is the user id that passenger uses for that application. Resetting the ownership and restarting the service correctly resolved the issue.

Actions

Also available in: Atom PDF