WeBWorK Main Forum

email instructor issue

email instructor issue

by Anthony Weaver -
Number of replies: 2

This is for webwork version 2.19.  Clicking the email instructor button I'm getting the following issue

Failed to send message: undef is not an integer! at (eval 948) line 292. eval {...} called at (eval 948) line 291 Email::Sender::Transport::SMTP::new("Email::Sender::Transport::SMTP", HASH(0x564bb9d96558)) called at /opt/webwork/webwork2/lib/WeBWorK/Utils.pm line 339 WeBWorK::Utils::createEmailSenderTransportSMTP(WeBWorK::CourseEnvironment=HASH(0x564bb9412010)) called at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Feedback.pm line 256 WeBWorK::ContentGenerator::Feedback::try {...} () called at /usr/share/perl5/Try/Tiny.pm line 102 eval {...} called at /usr/share/perl5/Try/Tiny.pm line 93 Try::Tiny::try(CODE(0x564bb9d6d748), Try::Tiny::Catch=REF(0x564bb5d3b6e0)) called at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Feedback.pm line 260 WeBWorK::ContentGenerator::Feedback::initialize(WeBWorK::ContentGenerator::Feedback=HASH(0x564bb2305a68)) called at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm line 146 eval {...} called at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm line 109 WeBWorK::ContentGenerator::go(WeBWorK::ContentGenerator::Feedback=HASH(0x564bb2305a68)) called at /usr/share/perl5/Mojolicious.pm line 192 Mojolicious::_action(undef, WeBWorK::ContentGenerator::Feedback=HASH(0x564bb2305a68), CODE(0x564bb6ec6ac0), 1) called at /usr/share/perl5/Mojolicious/Plugins.pm line 15 Mojolicious::Plugins::__ANON__() called at /opt/webwork/webwork2/lib/Mojolicious/WeBWorK.pm line 165 eval {...} called at /opt/webwork/webwork2/lib/Mojolicious/WeBWorK.pm line 145 Mojolicious::WeBWorK::__ANON__(CODE(0x564bb99f39c0), WeBWorK::ContentGenerator::Feedback=HASH(0x564bb2305a68), CODE(0x564bb6ec6ac0), 1) called at /usr/share/perl5/Mojolicious/Plugins.pm line 15 Mojolicious::Plugins::__ANON__() called at /usr/share/perl5/Mojolicious/Plugins.pm line 18 Mojolicious::Plugins::emit_chain(Mojolicious::Plugins=HASH(0x564bb9261fa8), "around_action", WeBWorK::ContentGenerator::Feedback=HASH(0x564bb2305a68), CODE(0x564bb6ec6ac0), 1) called at /usr/share/perl5/Mojolicious/Routes.pm line 88 Mojolicious::Routes::_action(Mojolicious::WeBWorK=HASH(0x564bb279e5a8), WeBWorK::ContentGenerator::Feedback=HASH(0x564bb2305a68), CODE(0x564bb6ec6ac0), 1) called at /usr/share/perl5/Mojolicious/Routes.pm line 161 Mojolicious::Routes::_controller(Mojolicious::Routes=HASH(0x564bb0a8fdd0), Mojolicious::Controller=HASH(0x564bb9979750), HASH(0x564bb99ecea8), 1) called at /usr/share/perl5/Mojolicious/Routes.pm line 44 Mojolicious::Routes::continue(Mojolicious::Routes=HASH(0x564bb0a8fdd0), Mojolicious::Controller=HASH(0x564bb9979750)) called at /usr/share/perl5/Mojolicious/Routes.pm line 46 Mojolicious::Routes::continue(Mojolicious::Routes=HASH(0x564bb0a8fdd0), Mojolicious::Controller=HASH(0x564bb9979750)) called at /usr/share/perl5/Mojolicious/Routes.pm line 46 Mojolicious::Routes::continue(Mojolicious::Routes=HASH(0x564bb0a8fdd0), Mojolicious::Controller=HASH(0x564bb9979750)) called at /usr/share/perl5/Mojolicious/Routes.pm line 52 Mojolicious::Routes::dispatch(Mojolicious::Routes=HASH(0x564bb0a8fdd0), Mojolicious::Controller=HASH(0x564bb9979750)) called at /usr/share/perl5/Mojolicious.pm line 127 Mojolicious::dispatch(Mojolicious::WeBWorK=HASH(0x564bb279e5a8), Mojolicious::Controller=HASH(0x564bb9979750)) called at /usr/share/perl5/Mojolicious.pm line 136 Mojolicious::__ANON__(undef, Mojolicious::Controller=HASH(0x564bb9979750)) called at /usr/share/perl5/Mojolicious/Plugins.pm line 15 Mojolicious::Plugins::__ANON__() called at /usr/share/perl5/Mojolicious.pm line 202 eval {...} called at /usr/share/perl5/Mojolicious.pm line 202 Mojolicious::_exception(CODE(0x564bb996f438), Mojolicious::Controller=HASH(0x564bb9979750)) called at /usr/share/perl5/Mojolicious/Plugins.pm line 15 Mojolicious::Plugins::__ANON__() called at /usr/share/perl5/Mojolicious/Plugins.pm line 18 Mojolicious::Plugins::emit_chain(Mojolicious::Plugins=HASH(0x564bb9261fa8), "around_dispatch", Mojolicious::Controller=HASH(0x564bb9979750)) called at /usr/share/perl5/Mojolicious.pm line 141 Mojolicious::handler(Mojolicious::WeBWorK=HASH(0x564bb279e5a8), Mojo::Transaction::HTTP=HASH(0x564bb9979f30)) called at /usr/share/perl5/Mojo/Server.pm line 70 Mojo::Server::__ANON__(Mojo::Server::Prefork=HASH(0x564bb08d5590), Mojo::Transaction::HTTP=HASH(0x564bb9979f30)) called at /usr/share/perl5/Mojo/EventEmitter.pm line 15 Mojo::EventEmitter::emit(Mojo::Server::Prefork=HASH(0x564bb08d5590), "request", Mojo::Transaction::HTTP=HASH(0x564bb9979f30)) called at /usr/share/perl5/Mojo/Server/Daemon.pm line 103 Mojo::Server::Daemon::__ANON__(Mojo::Transaction::HTTP=HASH(0x564bb9979f30)) called at /usr/share/perl5/Mojo/EventEmitter.pm line 15 Mojo::EventEmitter::emit(Mojo::Transaction::HTTP=HASH(0x564bb9979f30), "request") called at /usr/share/perl5/Mojo/Transaction/HTTP.pm line 60 Mojo::Transaction::HTTP::server_read(Mojo::Transaction::HTTP=HASH(0x564bb9979f30), "POST /webwork2/MATT111_Nimershiem_Fall2024/feedback HTTP/1.1\x{d}"...) called at /usr/share/perl5/Mojo/Server/Daemon.pm line 224 Mojo::Server::Daemon::_read(Mojo::Server::Prefork=HASH(0x564bb08d5590), "78654711f117372221b1a3d30139809f", "POST /webwork2/MATT111_Nimershiem_Fall2024/feedback HTTP/1.1\x{d}"...) called at /usr/share/perl5/Mojo/Server/Daemon.pm line 202 Mojo::Server::Daemon::__ANON__(Mojo::IOLoop::Stream=HASH(0x564bb996a6c8)) called at /usr/share/perl5/Mojo/EventEmitter.pm line 15 Mojo::EventEmitter::emit(Mojo::IOLoop::Stream=HASH(0x564bb996a6c8), "read", "POST /webwork2/MATT111_Nimershiem_Fall2024/feedback HTTP/1.1\x{d}"...) called at /usr/share/perl5/Mojo/IOLoop/Stream.pm line 109 Mojo::IOLoop::Stream::_read(Mojo::IOLoop::Stream=HASH(0x564bb996a6c8)) called at /usr/share/perl5/Mojo/IOLoop/Stream.pm line 57 Mojo::IOLoop::Stream::__ANON__(Mojo::Reactor::EV=HASH(0x564bb22c97a0)) called at /usr/share/perl5/Mojo/Reactor/Poll.pm line 141 eval {...} called at /usr/share/perl5/Mojo/Reactor/Poll.pm line 141 Mojo::Reactor::Poll::_try(Mojo::Reactor::EV=HASH(0x564bb22c97a0), "I/O watcher", CODE(0x564bb997c8b8), 0) called at /usr/share/perl5/Mojo/Reactor/EV.pm line 54 Mojo::Reactor::EV::__ANON__(EV::IO=SCALAR(0x564bb9981100), 3) called at /usr/share/perl5/Mojo/Reactor/EV.pm line 32 eval {...} called at /usr/share/perl5/Mojo/Reactor/EV.pm line 32 Mojo::Reactor::EV::start(Mojo::Reactor::EV=HASH(0x564bb22c97a0)) called at /usr/share/perl5/Mojo/IOLoop.pm line 134 Mojo::IOLoop::start(Mojo::IOLoop=HASH(0x564bb22a6f80)) called at /usr/share/perl5/Mojo/Server/Prefork.pm line 152 Mojo::Server::Prefork::_spawn(Mojo::Server::Prefork=HASH(0x564bb08d5590)) called at /usr/share/perl5/Mojo/Server/Prefork.pm line 93 Mojo::Server::Prefork::_manage(Mojo::Server::Prefork=HASH(0x564bb08d5590)) called at /usr/share/perl5/Mojo/Server/Prefork.pm line 78 Mojo::Server::Prefork::run(Mojo::Server::Prefork=HASH(0x564bb08d5590)) called at /usr/share/perl5/Mojo/Server/Hypnotoad.pm line 74 Mojo::Server::Hypnotoad::run(Mojo::Server::Hypnotoad=HASH(0x564bb08a9860), "/opt/webwork/webwork2/bin/webwork2") called at /usr/bin/hypnotoad line 14


I suspect the issue may be related to content posted here: https://webwork.maa.org/moodle/mod/forum/discuss.php?d=3951#p14297

regarding what is now in Utils.pm which looks like:

sub createEmailSenderTransportSMTP ($ce) {
    return Email::Sender::Transport::SMTP->new({
        host => $ce->{mail}{smtpServer},
        ssl  => $ce->{mail}{tls_allowed} // 0,
        defined $ce->{mail}->{smtpPort}       ? (port          => $ce->{mail}{smtpPort})       : (),
        defined $ce->{mail}->{smtpUsername}   ? (sasl_username => $ce->{mail}{smtpUsername})   : (),
        defined $ce->{mail}->{smtpPassword}   ? (sasl_password => $ce->{mail}{smtpPassword})   : (),
        defined $ce->{mail}->{smtpSSLOptions} ? (ssl_options   => $ce->{mail}{smtpSSLOptions}) : (),
        timeout => $ce->{mail}{smtpTimeout},
    });
}


I suspect the problem might be the smtpusername and password.  We are using google, specifically using google to send emails with SMTP relay.  As far as we can tell, google is setup correctly with the server ip and in site.conf I have smtp-relay.gmail.com for the smtp server.  With this setup we don't need to authenticate so I'm wondering if that's what's causing this issue.


Any help is appreciated

In reply to Anthony Weaver

Re: email instructor issue

by Glenn Rice -

What do you have $mail{smtpTimeout} set to in site.conf?

In reply to Glenn Rice

Re: email instructor issue

by Anthony Weaver -
That seems to have been the issue. We upgraded Webwork from a couple of versions ago and I didn't carry over all the new mail settings from site.conf.dist to our site.conf including the timeout
Thank you