Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with Maximum file multiparts in content reached #254

Closed
itowtips opened this issue Mar 5, 2015 · 4 comments

Comments

@itowtips
Copy link
Contributor

commented Mar 5, 2015

デフォルトの設定では、HTTPマルチパートを使用する通信にて制限があるようです。
記事や施設情報の更新postがエラーになる場合が発生しました。

unicornのエラーログ

E, [2015-03-05T18:50:02.076631 #32164] ERROR -- : app error: Too many open files - Maximum file multiparts in content reached (Rack::Multipart::MultipartPartLimitError)

http://stackoverflow.com/questions/27773368/rails-4-2-internal-server-error-with-maximum-file-multiparts-in-content-reached

以下の記述をinitializerに付けるなどすれば、エラーは回避できます。
Rack::Utils.multipart_part_limit = 0

unicorn_rails コマンドには該当のオプションが無い様子
rackのオプションはどこに記述すべきでしょうか。
https://github.com/rack/rack/blob/b0b5fb9467e6ed777d3eaf35afc81d758e308aab/lib/rack/utils.rb#L71-74

@sunny4381

This comment has been minimized.

Copy link
Member

commented Mar 6, 2015

config/initializers/multipart_part_limit.rb を新規追加し、上記のオプションを追加してはどうでしょうか?

なお、ENV['RACK_MULTIPART_PART_LIMIT'] の設定が優先されるので、unicorn:start タスクに設定することも出来ます。
https://github.com/shirasagi/shirasagi/blob/master/lib/tasks/unicorn.rake#L3-7

@itowtips

This comment has been minimized.

Copy link
Contributor Author

commented Mar 6, 2015

config/initializers/rack.rb
はどうでしょうか。

@tany

This comment has been minimized.

Copy link
Member

commented Mar 6, 2015

rack は大きすぎるので config/initializers/multipart_part_limit.rb でいいかと。

@itowtips

This comment has been minimized.

Copy link
Contributor Author

commented Mar 6, 2015

@tany わかりました。

itowtips added a commit to itowtips/shirasagi that referenced this issue Mar 6, 2015

sunny4381 added a commit that referenced this issue Mar 9, 2015

Merge pull request #261 from itowtips/fix-254
add configuration initializer for rack multiparts option #254

@itowtips itowtips closed this Mar 9, 2015

itowtips added a commit to itowtips/shirasagi that referenced this issue Mar 16, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.