Defect #19398

Failed to get attachment with Chinese filename.

Added by Alan Liu over 4 years ago. Updated about 4 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-
Resolution:Duplicate Affected version:3.0.0

Description

  • No problem to get attachment with ASCII filename.
  • Failed to get attachment with Chinese filename. (Internal server error)
Environment:
  Redmine version                3.0.0.stable
  Ruby version                   1.9.3-p545 (2014-02-24) [i386-mingw32]
  Rails version                  4.2.0
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.7.5
  Git                            1.9.5
  Filesystem                     
Redmine plugins:
  redmine_issue_templates        0.1.0

Related issues

Duplicates Redmine - Defect #19374: MinGW thin and puma: Internal server error occoures when ... Closed

History

#1 Updated by Toshi MARUYAMA over 4 years ago

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

Duplicate of #19374.
Please contact bitnami team.

#2 Updated by Toshi MARUYAMA over 4 years ago

  • Duplicates Defect #19374: MinGW thin and puma: Internal server error occoures when attachment file name contains non ASCII added

#3 Updated by Alan Liu over 4 years ago

  • Status changed from Closed to Reopened
More background information:
  • OS: Windows Server 2008 R2 Standard SP1 (Traditional Chinese)
  • We do not use bitnami package.
  • The problem is caused after upgrading redmine from 2.6.1 to 3.0.0.

Thanks.

#4 Updated by Toshi MARUYAMA over 4 years ago

  • Status changed from Reopened to Closed

I cannot reproduce on Windows 8.1 Pro with webrick (#19374#note-3).
We cannot support individual web server and environment.

#5 Updated by Alan Liu over 4 years ago

It caused by Rails 4.2 (https://github.com/rails/rails/issues/19187 has a workaround, but I don't understand yet).

#6 Updated by Alan Liu over 4 years ago

  • Status changed from Closed to Reopened

Indeed, webrick has no problem.
But thin & puma do.
Why? webrick doesn't work with Rails 4.2?
(Sorry, I'm not a ruby programmer)

#7 Updated by Toshi MARUYAMA over 4 years ago

  • Status changed from Reopened to Closed

Alan Liu wrote:

It caused by Rails 4.2 (https://github.com/rails/rails/issues/19187 has a workaround, but I don't understand yet).

It is obvious thin problem.
You should report to thin, not to Rails.
Redmine is Rails app and does not depend on any web server.
We cannot do anything.

#8 Updated by Alan Liu over 4 years ago

The workaround (https://github.com/rails/rails/issues/19187): add some codes in C:\Ruby193\lib\ruby\gems\1.9.1\gems\actionpack-4.2.0\lib\action_dispatch\middleware\static.rb

          rescue EncodingError
            false

It will be (from line 31, EncodingError fixes my case)

      if match = paths.detect { |p|
        path = File.join(@root, p)
        begin
          File.file?(path) && File.readable?(path)
          rescue SystemCallError
            false
          rescue EncodingError
            false
        end
      }

#10 Updated by Alan Liu about 4 years ago

  • Status changed from Closed to Reopened

The problem comes back after upgrading to 3.0.2 & fixed by adding the same code in C:\Ruby193\lib\ruby\gems\1.9.1\gems\actionpack-4.2.1\lib\action_dispatch\middleware\static.rb

Environment:
  Redmine version                3.0.2.stable
  Ruby version                   1.9.3-p545 (2014-02-24) [i386-mingw32]
  Rails version                  4.2.1
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.7.5
  Git                            1.9.5
  Filesystem                     
Redmine plugins:
  redmine_issue_templates        0.1.0

#12 Updated by Toshi MARUYAMA about 4 years ago

You can use Rails 4-2-stable branch to change Gemfile.

-gem "rails", "4.2.1" 
+gem "rails", :github => 'rails/rails', :branch => '4-2-stable'

Also available in: Atom PDF