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] admin_request show (ActionView::Template::Error) "string length (137) exceeds the limit 128" #6853

Closed
gbp opened this issue Mar 4, 2022 · 8 comments
Labels
bug Breaks expected functionality f:request-management stale Issues with no activity for 12 months x:eu x:netherlands x:uk

Comments

@gbp
Copy link
Member

gbp commented Mar 4, 2022

An ActionView::Template::Error occurred in admin_request#show:

  string length (137) exceeds the limit 128
  app/models/raw_email.rb:23:in `date'


-------------------------------
Request:
-------------------------------

  * URL        : /en/admin/requests/1
  * HTTP Method: GET
  * Parameters : {"controller"=>"admin_request", "action"=>"show", "id"=>"1", "locale"=>"en"}


-------------------------------
Backtrace:
-------------------------------

  app/models/raw_email.rb:23:in `date'
  app/models/incoming_message.rb:99:in `block in parse_raw_email!'
  app/models/incoming_message.rb:97:in `parse_raw_email!'
  app/models/incoming_message.rb:178:in `mail_from'
  app/views/admin_request/show.html.erb:333
  app/views/admin_request/show.html.erb:330
  app/views/admin_request/show.html.erb:325
@gbp gbp added bug Breaks expected functionality x:eu labels Mar 4, 2022
@gbp
Copy link
Member Author

gbp commented Mar 4, 2022

This appears to be an issue upstream when parsing emails with the mail gem. Seems to be since Ruby 2.7.5 which included mitigation for CVE-2021-41817.

There is a PR which might fix this issue mikel/mail#1469

@gbp
Copy link
Member Author

gbp commented Mar 4, 2022

For the emails received by AsktheEU they all come from the same domain consilium.europa.eu and is caused by leading spaces on the header rows after the Date header. Such as:

Date: 27 Jan 2022 14:37:56 +0100
 To: [email protected]
 From: "Postmaster Consilium" <[email protected]>

As a temporary fix I have corrected the raw emails by removing the spaces for the affect raw emails (IDs: 35358, 35361, 35685, 35766, 35795, 35896, 35952)

@gbp
Copy link
Member Author

gbp commented Mar 8, 2022

Another message has been received with the same issue - manually fixed again.

gbp added a commit to mysociety/asktheeu-theme that referenced this issue Mar 8, 2022
Fixes issue where spaces are included before some email headers.

See mysociety/alaveteli#6853
@gbp
Copy link
Member Author

gbp commented Mar 8, 2022

Created a PR in the AskTheEU theme to save doing this manual fix everytime

@gbp
Copy link
Member Author

gbp commented Mar 14, 2022

Still receiving emails with the same issue. PR is up for review

@gbp
Copy link
Member Author

gbp commented Nov 18, 2022

Seeing the same issue on WDTK now:

Date: 17 Nov 2022 17:57:03 +0000
 To: snip
 From: "Mail Delivery System" <snip>

@gbp gbp added the x:uk label Nov 18, 2022
gbp added a commit to mysociety/whatdotheyknow-theme that referenced this issue Nov 18, 2022
Fixes issue where spaces are included before some email headers.

See mysociety/asktheeu-theme#120
See mysociety/alaveteli#6853
@gbp
Copy link
Member Author

gbp commented May 24, 2023

Seeing this on the Netherlands admin too.

@HelenWDTK HelenWDTK added the stale Issues with no activity for 12 months label Nov 19, 2024
@HelenWDTK
Copy link
Contributor

This issue has been automatically closed due to a lack of discussion or resolution for over 12 months.
Should we decide to revisit this issue in the future, it can be reopened.

@HelenWDTK HelenWDTK closed this as not planned Won't fix, can't repro, duplicate, stale Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Breaks expected functionality f:request-management stale Issues with no activity for 12 months x:eu x:netherlands x:uk
Projects
None yet
Development

No branches or pull requests

3 participants