redmine_importer icon indicating copy to clipboard operation
redmine_importer copied to clipboard

Error 500 of cookies overflow

Open archonwang opened this issue 13 years ago • 17 comments

Hi,

I import a large file and found a problem of cookies overflow. How can I solve it. Thanks

the csv file contains 180 rows.

the log shows:

Processing ImporterController#result (for 192.168.3.94 at 2012-01-09 15:50:43) [POST] Parameters: {"commit"=>"提交", "fields_map"=>{"报告日期"=>"start_date", "摘要"=>"subject", "编号"=>"", "问题分类"=>"", "最后更新"=>"due_date", "分类"=>"", "出现频率"=>"", "优先级"=>"priority", "说明"=>"description", "分派给"=>"assigned_to", "处理状况"=>"", "项目"=>"", "严重性"=>"", "报告员"=>"author", "状态"=>"status", "查看权限"=>""}, "project_id"=>"21", "unique_field"=>"", "add_versions"=>"true", "action"=>"result", "authenticity_token"=>"1CNktSwDtr9aCCdUsT0JKrWCV8uh4jMNolHflBhqyzA=", "send_emails"=>"true", "add_categories"=>"true", "controller"=>"importer", "import_timestamp"=>"2012-01-09 15:48:55", "default_tracker"=>"1"} Rendering template within layouts/base Rendering importer/result Completed in 5119ms (View: 216, DB: 195) | 200 OK [http://192.168.2.135/importer/result] /!\ FAILSAFE /!\ Mon Jan 09 15:50:48 +0800 2012 Status: 500 Internal Server Error ActionController::Session::CookieStore::CookieOverflow /usr/local/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.14/lib/action_controller/session/cookie_store.rb:111:in call' /usr/local/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.14/lib/action_controller/failsafe.rb:26:incall' /usr/local/ruby/lib/ruby/gems/1.8/gems/rack-1.1.2/lib/rack/lock.rb:11:in call' /usr/local/ruby/lib/ruby/gems/1.8/gems/rack-1.1.2/lib/rack/lock.rb:11:insynchronize' /usr/local/ruby/lib/ruby/gems/1.8/gems/rack-1.1.2/lib/rack/lock.rb:11:in call' /usr/local/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:106:incall' /usr/local/ruby/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/rack/static.rb:31:in call' /usr/local/ruby/lib/ruby/gems/1.8/gems/rack-1.1.2/lib/rack/urlmap.rb:47:incall' /usr/local/ruby/lib/ruby/gems/1.8/gems/rack-1.1.2/lib/rack/urlmap.rb:41:in each' /usr/local/ruby/lib/ruby/gems/1.8/gems/rack-1.1.2/lib/rack/urlmap.rb:41:incall' /usr/local/ruby/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/rack/log_tailer.rb:17:in call' /usr/local/ruby/lib/ruby/gems/1.8/gems/rack-1.1.2/lib/rack/content_length.rb:13:incall' /usr/local/ruby/lib/ruby/gems/1.8/gems/rack-1.1.2/lib/rack/chunked.rb:15:in call' /usr/local/ruby/lib/ruby/gems/1.8/gems/rack-1.1.2/lib/rack/handler/mongrel.rb:67:inprocess' /usr/local/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in process_client' /usr/local/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:ineach' /usr/local/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in process_client' /usr/local/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:inrun' /usr/local/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in initialize' /usr/local/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:innew' /usr/local/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in run' /usr/local/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:ininitialize' /usr/local/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in new' /usr/local/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:inrun' /usr/local/ruby/lib/ruby/gems/1.8/gems/rack-1.1.2/lib/rack/handler/mongrel.rb:38:in run' /usr/local/ruby/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/commands/server.rb:111 /usr/local/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require' /usr/local/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'

script/server:3

archonwang avatar Jan 09 '12 07:01 archonwang

Just to be sure... are you using the current importer? The problem you report was true of the rchady version of the importer, which is one of the reasons I originally started working on the plugin. I've tested the current plugin version with importing hundreds of issues without any problem, including while using the Chinese interface.

The error message trace you encountered doesn't actually involve the importer, which makes sense because the importer itself doesn't save anything in cookies. Given an error that late in the import, your issues may well have been saved anyway (notice the log line before the error, Completed in 5119ms (View: 216, DB: 195) | 200 OK [http://192.168.2.135/importer/result]). Did you verify whether your issues were imported?

There's a report in Japanese that this occurs if you have the old version of the plugin (in particular, if you have the old zh.yml file for the Chinese localization). Have you updated to a recent version of Redmine Importer, and in particular that you've picked up this change which resolved some unusual problems caused by the old file?

It could be that this is not related to the Importer, but to other plugins you are using. There are reports on the net here and here from Eric David (current maintainer of Redmine) that the Timesheet and Rate plugins cause this problem. Are you using those or other plugins besides the Importer?

Sorry to not have an immediate solution to hand, but the stack trace looks like it's something outside of the Importer itself that's triggering the problem. If you forward your CSV file privately, I'll be happy to verify whether I can import it here.

leovitch avatar Jan 09 '12 09:01 leovitch

thanks a lot. i will try again for the recent version.

archonwang avatar Jan 09 '12 14:01 archonwang

Unfortunately, I tried the newest version and I found the problem is still here.

so, any solution for it? Thanks.

archonwang avatar Jan 10 '12 02:01 archonwang

I asked a few questions above:

  • What version of Redmine are you using?
  • What language is your interface set to?
  • What other plugins are installed in your Redmine?
  • Were your issues imported despite the error message?
  • Can you forward your CSV file to me privately so I can try to reproduce your problem?

leovitch avatar Jan 10 '12 04:01 leovitch

OK. One by One. thanks.

  • What version of Redmine are you using? Redmine 1.3.0
  • What language is your interface set to? Simplified Chinese
  • What other plugins are installed in your Redmine? Yes. much installed. I will post it into the email.
  • Were your issues imported despite the error message? http 500 error
  • Can you forward your CSV file to me privately so I can try to reproduce your problem? OK.No problem

archonwang avatar Jan 10 '12 06:01 archonwang

Hi, leovitch I can not find your email. Could you please tell me your email? thanks.

archonwang avatar Jan 10 '12 07:01 archonwang

To send me a message, click on my username "leovitch" anywhere you see it to go to my profile page. You should see a button just the right of my username that says "Message" and you can send me a private message there. If you set up an email in the "email addresses" section of your profile I should be able to send you messages as well.

leovitch avatar Jan 10 '12 07:01 leovitch

Hi, leovitch

I leave my email in my profile page. or you can send email to me directly [email protected]

Thanks.

archonwang avatar Jan 10 '12 07:01 archonwang

please check the attachment.

2012/1/10 leovitch < [email protected]

To send me a message, click on my username "leovitch" anywhere you see it to go to my profile page. You should see a button just the right of my username that says "Message" and you can send me a private message there. If you set up an email in the "email addresses" section of your profile I should be able to send you messages as well.


Reply to this email directly or view it on GitHub: https://github.com/leovitch/redmine_importer/issues/11#issuecomment-3426400

archonwang avatar Jan 10 '12 08:01 archonwang

Hi, I experienced the same issue : 'ActionController::Session::CookieStore::CookieOverflow' after submitting the import button. Did you find a solution?

yev avatar Feb 01 '12 09:02 yev

I had the same issue. It seems to be caused by having lots of errors in the CSV file. The errors seem to accumulate in the session store. The problem went away for me when I fixed my csv issues.

swadey avatar Feb 02 '12 13:02 swadey

It seems like the csv files contains too much errors.

anyone could modify it? Thanks.

archonwang avatar Feb 02 '12 14:02 archonwang

I modified some columns description (I set 'Ignore' status almost for everything ) and Importer plugin successfully imported 52 issues of 500... I didn't see any CVS's related errors in the log file. Only CookieOverflow...

yev avatar Feb 02 '12 15:02 yev

I got the same error then i load a big file with subjects longer then 255 symbols. I think it's a good idea to chomp long subjects before create issue.

AlDemion avatar Feb 16 '12 14:02 AlDemion

Had success by splitting up the csv into small size around 35 rows or 24Kb. Not sure it's the rows problem or size problem but seems working.

ghost avatar Apr 07 '12 06:04 ghost

I think that I, may be, have found the root cause of the error. I do not have experience with ruby but, after reading the controller code and searching about CookieOverflow I think that the problem is related to the way the controller stores error messages. When I worked with a 17 rows csv file, due to errors in columns data type and missed required fields, instead of HTTP Error 500 I was able to see the error log in the results page. After reading about FasterCSV and the importer_controller.rb line 416 (just one of many lines who stores error messages)

 flash.append(:warning,"The following data-validation errors occurred on issue #{@failed_count} in the list below")

I believe that the CookieOverflow is triggered when there are more than 4K of text with error messages to be shown. Perhaps you should review the way to store result messages, maybe store them in the ipp table instead of using FlashHash approach.

Just my two cents

mhdion avatar Jun 08 '12 19:06 mhdion

This is what I did to fix it.

had modified below files:

  1. redmine_importer/app/views/importer/result.html.erb
  2. redmine_importer/app/controllers/importer_controller.rb

in restult.html.erb, add below code at begining before content_for :header_tags:

<% unless @errors_with_csv.empty? %>
  <div class="flash warning">
    <%= @errors_with_csv.join("<br />") %>
  </div>
<% end %>

in importert_controller.rb, replace all flash.append with @errors_with_csv. For example, replace

flash.append(:warning,"When adding issue #{@failed_count} below, the #{@unfound_class} #{@unfound_key} was not found")

with

@errors_with_csv << "When adding issue #{@failed_count} below, the #{@unfound_class} #{@unfound_key} was not found"

and declare array in result method before iip = ImportInProgress.find_by_user_id(User.current.id) as

@errors_with_csv = []
iip = ImportInProgress.find_by_user_id(User.current.id)

waleedjaffar avatar Dec 19 '12 07:12 waleedjaffar