Project

General

Profile

500 error when upload files and documents

Added by hugo joe almost 13 years ago

OS:debian squeeze(almost all default config)
Redmine:1.2.0 stable
Rails:2.3.11
rake:0.8.7
apache2 with libapache2-mod-passenger

When I try to upload files and documents to projects, page shows 500 Internal error.
I followed the link "http://www.redmine.org/projects/redmine/wiki/RedmineInstall" to change owner to a new created user "redmine" and change permission to 755. But page shows 500 Internal error.
Then I changed owner to www-data following the link "http://www.redmine.org/boards/2/topics/19859?r=20802#message-20802":
sudo chown -R www-data:www-data tmp log files/ public/plugin_assets/
sudo chmod -R 755 tmp log files/ public/plugin_assets/
But page still shows 500 Internal error.

Best regards

Hugo


Replies (4)

RE: 500 error when upload files and documents - Added by Alex A almost 13 years ago

Can u show redmine production log? The last error in log after u see "500 Internal error" show the reason why it was heppened.
And u can try to grant all permissions to files folder into your redmine directory.

RE: 500 error when upload files and documents - Added by hugo joe almost 13 years ago

Thanks, Alex.
1.My redmine production log is empty,but /var/log/apache2/error.log show:
Errno::EACCES (Permission denied - /opt/redmineold/files/110615104619_guo.txt):
2958 app/models/attachment.rb:79:in `initialize'
2959 app/models/attachment.rb:79:in `open'
2960 app/models/attachment.rb:79:in `before_save'
2961 app/models/attachment.rb:148:in `attach_files'
2962 app/models/attachment.rb:145:in `each_value'
2963 app/models/attachment.rb:145:in `attach_files'
2964 app/controllers/files_controller.rb:28:in `create'
2965 /usr/lib/ruby/1.8/phusion_passenger/rack/request_handler.rb:92:in `process_request'
2966 /usr/lib/ruby/1.8/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
2967 /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:418:in `start_request_handler'
2968 /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:358:in `handle_spawn_application'
2969 /usr/lib/ruby/1.8/phusion_passenger/utils.rb:184:in `safe_fork'
2970 /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:354:in `handle_spawn_application'
2971 /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__'
2972 /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop'
2973 /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
2974 /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:163:in `start'
2975 /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:213:in `start'
2976 /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application'
2977 /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
2978 /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application'
2979 /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
2980 /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
2981 /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
2982 /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:154:in `spawn_application'
2983 /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
2984 /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__'
2985 /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop'
2986 /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
2987 /usr/lib/phusion_passenger/passenger-spawn-server:61

2.grant all permissions to files folder into your redmine directory? Do you means "chmod -R 777 files"? Will this leads to security problem?

RE: 500 error when upload files and documents - Added by Alex A almost 13 years ago

I think that there is no big security problem if u grant full access to files folder.
U must execute

chmod -R go+rw files

RE: 500 error when upload files and documents (firewall settings?) - Added by Christopher Harwood about 10 years ago

I also see a 500 error when attaching files to an issue, but have confirmed that the user account running Redmine also owns the files folder. chmod/chown fixes will not resolve the issue in my case.

I am wondering whether my problem resides in the firewall settings, which I do not control (although I may request changes). Any idea what protocols and ports Redmine uses for attachment uploads?

    (1-4/4)