Skip to content

bridge - irrecoverable error processing message #1135

Closed

Description

@riker1

Dear Justin.

I tried to submit this possible bug via the mailing list but the captcha kept preventing me from 2x opting I apologize in advance if this duplicates that.

I have a discussion list configured to use Bridge to pick messages up from a POP3 box. A subscriber/member sent two messages: a short 4-sentence paragraph with a link, following message composed of 7 or so paragraphs with 8 or so URLs therein regarding sources looking for contributors.

The first, short message went through fine and went to archive as usual. The longer second message disappeared. Upon tailing postfix, syslog, and dada error log I found an error message:

Mailing List: YorkTalk (yorktalk)

  • Connecting with Net::POP3 v3.14
  • Connecting to POP3 host:'172.16.xxx.x1' on port:'995'
  • Dovecot (Ubuntu) ready.

Capabilities:
PIPELINING:
CAPA:
SASL: PLAIN LOGIN
USER:
RESP-CODES:
UIDL:
AUTH-RESP-CODE:
TOP:

APOP may NOT be supported.
SSL Supported
Authentication via POP.

POP3 Login succeeded!

Message count: 1

Message Size: 7.62K
Received message is below maximum size allowed.
Received message is below maximum soft size allowed.
* Message Size is below both Soft and Hard Max Sizes.

  • Checking Recipient: postmaster@mailings.york.cuny.edu
    * From List Owner: No.
    * Discussion List Support is enabled.
    * Moderation disabled.
    * From Subscriber: No.
    * Authorized Senders is enabled.
    * From Authorized Sender: Yes.
    * SpamAssassin check is enabled.
    * Looking for embedding SpamAssassin Headers...
    * Message passed! Spam Test (Score of: , 6 needed.)

bridge - irrecoverable error processing message. Skipping message: parse_data: unable to open in-memory file handle at plugins/bridge line 2545.

Sending a copy of the message to the List Owner

  • Removing message from server:
    * Disconnecting from POP3 server

Processing Digests:

Mailing List: YorkTalk (yorktalk)
* Digests are not enabled for, yorktalk

Line 2545 in the bridge app is not very helpful as it points to various variables etc. I've tried switching from parsing messages on disk in .dada_files and using RAM and /tmp folder. Neither adjustment of those settings resulted in any positive change, either remediating the parsing problem and or sending the message out to the list.

I've included some output that I think may be useful mail-sample.txt

Any thoughts or suggestions would be greatly appreciated.

In health,

-est2

Activity

  1. riker1 commented on Nov 7, 2022

    @riker1
    Author

    I'm having issues now with multiple users who cannot send messages to the list: bridge seems to have trouble parsing

    [Sun Nov 6 22:35:06 2022] mail.cgi: bridge - irrecoverable error processing message. Skipping message: parse_data: unable to open in-memory file handle at plugins/bridge line 2545. [Sun Nov 6 22:35:06 2022] mail.cgi: at plugins/bridge line 1217. [Sun Nov 6 22:35:06 2022] mail.cgi: bridge::catch {...} ("parse_data: unable to open in-memory file handle at plugins/b"...) called at DADA/perllib/Try/Tiny.pm line 123 [Sun Nov 6 22:35:06 2022] mail.cgi: Try::Tiny::try(CODE(0x55c70a37ba00), Try::Tiny::Catch=REF(0x55c70a37bbc8)) called at plugins/bridge line 1225 [Sun Nov 6 22:35:06 2022] mail.cgi: bridge::start(undef) called at plugins/bridge line 1024 [Sun Nov 6 22:35:06 2022] mail.cgi: bridge::scheduled_task("_all") called at /usr/lib/cgi-bin/dada/DADA/App.pm line 16815 [Sun Nov 6 22:35:06 2022] mail.cgi: DADA::App::try {...} () called at DADA/perllib/Try/Tiny.pm line 102 [Sun Nov 6 22:35:06 2022] mail.cgi: eval {...} called at DADA/perllib/Try/Tiny.pm line 93 [Sun Nov 6 22:35:06 2022] mail.cgi: Try::Tiny::try(CODE(0x55c708a9c110), Try::Tiny::Catch=REF(0x55c708c44378)) called at /usr/lib/cgi-bin/dada/DADA/App.pm line 16819 [Sun Nov 6 22:35:06 2022] mail.cgi: DADA::App::schedules(DADA::App=HASH(0x55c7072dcfc8)) called at /usr/local/share/perl/5.34.0/CGI/Application.pm line 144 [Sun Nov 6 22:35:06 2022] mail.cgi: eval {...} called at /usr/local/share/perl/5.34.0/CGI/Application.pm line 143 [Sun Nov 6 22:35:06 2022] mail.cgi: CGI::Application::__get_body(DADA::App=HASH(0x55c7072dcfc8), "_schedAPSGX2R9C37HQ9ZS") called at /usr/local/share/perl/5.34.0/CGI/Application.pm line 192

    any ideas? I've tried reconfiguring the settings in dada to parse via tmp/file either in .dada_mail_settings or in /tmp makes no difference. server has plenty of RAM/Disk/ & CPU so I'm at a loss as to do try something else.

    Internal Problem
    The attached message was sent to your mailing list to be sent out to as a mass mailing. but an internal error in the app itself stopped the message from being sent out. Additional tries will not be attempted.

    At your discretion, you may look over the message, and manually send out the contents through the list control panel.

    Errors are below:

    parse_data: unable to open in-memory file handle at plugins/bridge line 2545.

  2. justingit commented on Nov 7, 2022

    @justingit
    Owner

    Can you attach the source of the message (the simpler the message, the better) that's illustrating this problem?

  3. riker1 commented on Nov 7, 2022

    @riker1
    Author
  4. justingit commented on Nov 7, 2022

    @justingit
    Owner

    I'm looking for the SOURCE of the message, so headers and all, message encoded, etc. Without that, I don't have something to recreate the issue.

  5. justingit commented on Nov 7, 2022

    @justingit
    Owner
  6. riker1 commented on Nov 7, 2022

    @riker1
    Author
  7. justingit commented on Nov 7, 2022

    @justingit
    Owner

    Thanks @riker1

  8. edcoates commented on Nov 14, 2022

    @edcoates

    I'm having the same issue after upgrading to the newest version of dada_mail-v11_20_0_stable_2022-10-03. It's not every message that's sent to the list, but it seems to be happening more frequently. Here is the lastest message that I'm getting this error on

    email_error.txt

  9. justingit commented on Nov 14, 2022

    @justingit
    Owner

    I've tried testing both @riker1 and @edcoates messages, and they both process correctly. Thus, I'm having trouble recreating the problem itself. line 2545 in bridge is just a left curly brace, so yeah: not super helpful in pointing at what the problem is.

    https://github.com/justingit/dada-mail/blob/main/app/dada/plugins/bridge#L2545

    I may have to set up a test list for one of you to send messages to, to try to have the problem happen on a Dada Mail I have full control of. Either of you willing to send messages to a test list?

  10. riker1 commented on Nov 14, 2022

    @riker1
    Author
  11. pinned this issue on Nov 14, 2022
  12. justingit commented on Nov 14, 2022

    @justingit
    Owner

    @riker1 if you can just privately email me the email address you'll be using to send to the test list, I'll add you as an authorized sender. My email is listed at, https://dadamailproject.com/contact/

  13. edcoates commented on Nov 14, 2022

    @edcoates
  14. edcoates commented on Nov 14, 2022

    @edcoates

    One difference I have noticed is that when upgraded to this version it told me that it had found a newer version of perl at /usr/local/cpanel/3rdparty/bin/perl (v5.30.0) and I chose it. The installer made the appropriate changes for the files except for the extensions and plugins. They seem to still point to /usr/bin/perl which is version 5.16.3 on my system.

    Not sure if that might be the issue, but thought it was worth noting.

    Ed

  15. justingit commented on Nov 14, 2022

    @justingit
    Owner

    Plugins aren't called directly ie - the URLs SHOULDN'T be this,

    https://example.com/dada/plugins/bridge

    but should look like this,

    https://example.com/dada/mail.cgi/plugins/bridge

    "/plugins/bridge" is just information given to the mail.cgi script in a cleverer way.

    So, there shouldn't be a difference in Perl versions used in Dada Mail.

  16. justingit commented on Dec 8, 2022

    @justingit
    Owner

    Did anyone have any trouble with the messages they sent?

  17. edcoates commented on Dec 8, 2022

    @edcoates
  18. riker1 commented on Dec 8, 2022

    @riker1
    Author
  19. unpinned this issue on Jan 4, 2023
  20. justingit commented on Jan 13, 2023

    @justingit
    Owner

    Here’s the original message sender tried and it didn’t go through. I tried to also send it as I am an authorized sender and same failure. Here’s output I pasted into a file showing bridge trying to work on the message mail-sample.txt https://github.com/justingit/dada-mail/files/9863383/mail-sample.txt

    I'm going to use this as an example, as it's easy to see what's going on.

    There's unicode characters in this message. For example:

     I also hope to see proposals on Ian Fleming’s novels, the history 
    	and development of Bond
    

    This all look innocuous enough, but the, "‘" character is not an ASCII single quote, ' but Unicode Character “′” (U+2032)

    https://www.compart.com/en/unicode/U+2032

    The message itself is supposed to be encoded in 7bit, which only allows ASCII characters.

    In this case, the bug is perhaps with the software which made this email message, "Roundcube Webmail" - it should have used a different encoding like 8bit - or better still: quoted-printable. I've tried to recreate this problem with my own email address, sending with RoundCube, but it does the right thing and uses 8bit encoding. My version is, 1.3.15.

    But nevertheless, Dada Mail should be able to handle something like this without die'ing and this is very much a bug in Dada Mail/bridge. Here's a test script that closely mimics what Dada Mail does internally:

    #!/usr/bin/perl 
    
    use strict; 
    use warnings; 
    
    use Encode qw(encode decode);
    use MIME::Parser; 
    
    my $msg = q{
    From: example@example.com
    To: example@example.com
    Subject: Calls for contributors  | Retransmit
    Content-type: text/plain; charset="UTF-8"; format="flowed"
    Content-Transfer-Encoding: 7bit
    
     Though the volume will focus predominately on the 
    films, I also hope to see proposals on Ian Fleming’s novels};
    
    my $parser = MIME::Parser->new;
       $parser->tmp_to_core(1); # this actually won't change things
    
    $msg = decode('UTF-8', $msg );
    
    my $entity = $parser->parse_data($msg);
    print $entity->as_string;
    
    

    parse_data: unable to open in-memory file handle at untitled 12 line 24.

    The only problem is this line,

    $msg = decode('UTF-8', $msg );

    Remove that, and the above doesn't fail to run. There's only one place in all of Dada Mail where this happens,

    $msg = decode( 'UTF-8', $msg );

    If you change that line to,

        $msg = safely_decode( $msg );
    

    Things may actually work a lot better! I can't imagine why it's written that way, but it's been that way for 8 years. There may be other things that need to be tweaked, but I'm working on it.

    What an altogether difficult bug to track down, given a lot of the problems people are having are from invisible, or seemingly innocuous characters.

  21. added a commit that references this issue on Jan 14, 2023
    48db517
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions