Troglodyne-Internet-Widgets / iContact-cPanel-Plugins

Extra "Contact Manager" Providers for cPanel and WHM
BSD 3-Clause "New" or "Revised" License
20 stars 11 forks source link

Discord message length constraints cause send failures on larger messages #18

Closed troglodyne closed 4 years ago

troglodyne commented 4 years ago

Got this from a backup run on my personal box the other day, seems the message was too hueg:

[2020-02-15 02:00:16 -0600] warn [backup] Failed to send notification of type “DISCORD”: (XID acvtyc) 1 error occurred:
Error #1: The system failed to send the message to “https://discordapp.com/api/webhooks/***REDACTED***” due to an error: Cpanel::Exception::HTTP::Server/(XID epzvfr) The response to the <abbr title="Hypertext Transfer Protocol">HTTP</abbr> “POST” request from “https://discordapp.com/api/webhooks/***REDACTED***” indicated an error (400, BAD REQUEST): {"content": ["Must be 2000 or fewer in length."]}
 at /usr/local/cpanel/Cpanel/HTTP/Client.pm line 13__CPANEL_URLPW_HIDDEN__.
    Cpanel::HTTP::Client::request(Cpanel::HTTP::Client=HASH(0x3fab888), "POST", "https://discordapp.com/api/webhooks/***REDACTED***"..., HASH(0x3fabb40)) called at /var/cpanel/perl/Cpanel/iContact/Provider/Discord.pm line 80
    Cpanel::iContact::Provider::Discord::__ANON__() called at /usr/local/cpanel/3rdparty/perl/530/lib/perl5/cpanel_lib/Try/Tiny.pm line 97
    eval {...} called at /usr/local/cpanel/3rdparty/perl/530/lib/perl5/cpanel_lib/Try/Tiny.pm line 88
    Try::Tiny::try(CODE(0x3d5b750), Try::Tiny::Catch=REF(0x3cd1560)) called at /var/cpanel/perl/Cpanel/iContact/Provider/Discord.pm line 93
    Cpanel::iContact::Provider::Discord::send(Cpanel::iContact::Provider::Discord=HASH(0x3d5f8__CPANEL_URLPW_HIDDEN__8)) called at /usr/local/cpanel/Cpanel/iContact.pm line 569
    Cpanel::iContact::__ANON__() called at /usr/local/cpanel/3rdparty/perl/530/lib/perl5/cpanel_lib/Try/Tiny.pm line 97
    eval {...} called at /usr/local/cpanel/3rdparty/perl/530/lib/perl5/cpanel_lib/Try/Tiny.pm line 88
    Try::Tiny::try(CODE(0x3c1__CPANEL_URLPW_HIDDEN__7c0), Try::Tiny::Catch=REF(0x3cd1440)) called at /usr/local/cpanel/Cpanel/iContact.pm line 577
    Cpanel::iContact::_send_notifications(HASH(0x33034f0), HASH(0x33__CPANEL_URLPW_HIDDEN__aea8), ARRAY(0x3114778)) called at /usr/local/cpanel/Cpanel/iContact.pm line 5__CPANEL_URLPW_HIDDEN__4
    Cpanel::iContact::icontact("subject", "The backup process completed.", "html_related", ARRAY(0x31113a8), "x_headers", HASH(0x3ba6c40), "domain", "hydra.teodesian.net", ...) called at /usr/local/cpanel/Cpanel/iContact/Class.pm line 594
    Cpanel::iContact::Class::_todo_inside_daemon(Cpanel::iContact::Class::Backup::Success=HASH(0x31da9a0)) called at /usr/local/cpanel/Cpanel/iContact/Class.pm line 377
    Cpanel::iContact::Class::__ANON__() called at /usr/local/cpanel/Cpanel/iContact/Class.pm line 95
    Cpanel::iContact::Class::__ANON__() called at /usr/local/cpanel/3rdparty/perl/530/lib/perl5/cpanel_lib/Try/Tiny.pm line 97
    eval {...} called at /usr/local/cpanel/3rdparty/perl/530/lib/perl5/cpanel_lib/Try/Tiny.pm line 88
    Try::Tiny::try(CODE(0x31e__CPANEL_URLPW_HIDDEN__978), Try::Tiny::Catch=REF(0x__CPANEL_URLPW_HIDDEN__fd69a0)) called at /usr/local/cpanel/Cpanel/iContact/Class.pm line 100
    Cpanel::iContact::Class::__ANON__() called at /usr/local/cpanel/Cpanel/ForkAsync.pm line 68
    eval {...} called at /usr/local/cpanel/Cpanel/ForkAsync.pm line 68
    Cpanel::ForkAsync::do_in_child(CODE(0x31dada8)) called at /usr/local/cpanel/Cpanel/iContact/Class.pm line 10__CPANEL_URLPW_HIDDEN__
    Cpanel::iContact::Class::_do_in_daemon(CODE(0x31dabb0)) called at /usr/local/cpanel/Cpanel/iContact/Class.pm line 379
    Cpanel::iContact::Class::send(Cpanel::iContact::Class::Backup::Success=HASH(0x31da9a0)) called at /usr/local/cpanel/Cpanel/iContact/Class.pm line 356
    Cpanel::iContact::Class::new("Cpanel::iContact::Class::Backup::Success", "account_errors", ARRAY(0x__CPANEL_URLPW_HIDDEN__fc4178), "reason", undef, "signal", 0, "transport_errors", ...) called at /usr/local/cpanel/Cpanel/Notify.pm line 75
    Cpanel::Notify::__ANON__() called at /usr/local/cpanel/Cpanel/Notify.pm line 148
    Cpanel::Notify::_notification_backend("cPanel Backup System", "", 1, CODE(0x3118cf0)) called at /usr/local/cpanel/Cpanel/Notify.pm line 77
    Cpanel::Notify::notification_class("class", "Backup::Success", "application", "cPanel Backup System", "interval", 1, "priority", __CPANEL_URLPW_HIDDEN__, ...) called at /usr/local/cpanel/bin/backup line 774
    bin::backup::parse_log_and_notify(HASH(0x__CPANEL_URLPW_HIDDEN__fb83d0)) called at /usr/local/cpanel/bin/backup line __CPANEL_URLPW_HIDDEN__90
    bin::backup::__ANON__(undef) called at /usr/local/cpanel/Cpanel/Backup/Sync.pm line 40__CPANEL_URLPW_HIDDEN__
    eval {...} called at /usr/local/cpanel/Cpanel/Backup/Sync.pm line 40__CPANEL_URLPW_HIDDEN__
    Cpanel::Backup::Sync::__ANON__() called at /usr/local/cpanel/Cpanel/Finally.pm line 59
    eval {...} called at /usr/local/cpanel/Cpanel/Finally.pm line 57
    Cpanel::Finally::DESTROY(Cpanel::Finally=HASH(0x__CPANEL_URLPW_HIDDEN__fa3e68)) called at /usr/local/cpanel/bin/backup line 484
    eval {...} called at /usr/local/cpanel/bin/backup line 484
    bin::backup::run("bin::backup") called at /usr/local/cpanel/bin/backup line 1__CPANEL_URLPW_HIDDEN__0
 at /usr/local/cpanel/Cpanel/iContact.pm line 573. 
    Cpanel::iContact::__ANON__(Cpanel::Exception::Collection=HASH(0x3fabac8)) called at /usr/local/cpanel/3rdparty/perl/530/lib/perl5/cpanel_lib/Try/Tiny.pm line 118
    Try::Tiny::try(CODE(0x3c127c0), Try::Tiny::Catch=REF(0x3cd1440)) called at /usr/local/cpanel/Cpanel/iContact.pm line 577
    Cpanel::iContact::_send_notifications(HASH(0x33034f0), HASH(0x332aea8), ARRAY(0x3114778)) called at /usr/local/cpanel/Cpanel/iContact.pm line 524
    Cpanel::iContact::icontact("subject", "The backup process completed.", "html_related", ARRAY(0x31113a8), "x_headers", HASH(0x3ba6c40), "domain", "hydra.teodesian.net", ...) called at /usr/local/cpanel/Cpanel/iContact/Class.pm line 594
    Cpanel::iContact::Class::_todo_inside_daemon(Cpanel::iContact::Class::Backup::Success=HASH(0x31da9a0)) called at /usr/local/cpanel/Cpanel/iContact/Class.pm line 377
    Cpanel::iContact::Class::__ANON__() called at /usr/local/cpanel/Cpanel/iContact/Class.pm line 95
    Cpanel::iContact::Class::__ANON__() called at /usr/local/cpanel/3rdparty/perl/530/lib/perl5/cpanel_lib/Try/Tiny.pm line 97

Gonna have to fix this. Not sure how yet, estay tunis

troglodyne commented 4 years ago

Ok, testing this on my personal box now, will see how it goes

troglodyne commented 4 years ago

Works