In the interest of documenting the debugging process I'm going through (please overlook some stupidity, given that I've been up at least 60 of the last 72 hours), I tried this:

my @last_records = database('current')->quick_select('states', { host_name => $data->{'host_name'}, name => $data->{'service_description'} }, { order_by => { desc => 'id' } } ) or $delstatus .= '/error from quick_select call;' . ' ERR [' . Dancer::Plugin::Database::Core::DBI->err . +'];' . ' ERRSTR [' . Dancer::Plugin::Database::Core::DBI->err +str . ']';

And got this error:

[NagiosToServiceNow::json:40284] error @2018-09-22 20:32:46> Route exc +eption: Can't locate object method "err" via package "Dancer::Plugin: +:Database::Core::DBI" (perhaps you forgot to load "Dancer::Plugin::Da +tabase::Core::DBI"?) at /home/svcanagios/n2s/bin/../lib/NagiosToServi +ceNow/json.pm line 707. in /home/svcanagios/n2s/bin/../local/lib/perl +5/Dancer2/Core/App.pm l. 1473

I was trying to fully-quality the variable. So that didn't work, so I tried:

my @last_records = database('current')->quick_select('states', { host_name => $data->{'host_name'}, name => $data->{'service_description'} }, { order_by => { desc => 'id' } } ) or $delstatus .= '/error from quick_select call;' . ' ERR [' . $Dancer::Plugin::Database::Core::DBI::err . + '];' . ' ERRSTR [' . $Dancer::Plugin::Database::Core::DBI::er +rstr . ']';

and got:

Use of uninitialized value $Dancer::Plugin::Database::Core::DBI::err i +n concatenation (.) or string at /home/svcanagios/n2s/bin/../lib/Nagi +osToServiceNow/json.pm line 707. Use of uninitialized value $Dancer::Plugin::Database::Core::DBI::errst +r in concatenation (.) or string at /home/svcanagios/n2s/bin/../lib/N +agiosToServiceNow/json.pm line 707. [NagiosToServiceNow::json:57311] debug @2018-09-22 20:39:02> QUICK SEL +ECT STATUS: --=> checking for: [tibintprdsac2p.wsgc.com][AIXERRPT] fo +r last output entry./error from quick_select call; ERR []; ERRSTR []/ +found [0] to delete <=-- in /home/svcanagios/n2s/bin/../lib/NagiosToS +erviceNow/json.pm l. 719

asdf

my @last_records = database('current')->quick_select('states', { host_name => $data->{'host_name'}, name => $data->{'service_description'} }, { order_by => { desc => 'id' } } ) or $delstatus .= '/error from quick_select call;' . ' ERR [' . $Dancer::Plugin::Database::Core::DBI->err . + '];' . ' ERRSTR [' . $Dancer::Plugin::Database::Core::DBI->er +rstr . ']';

and got:

[NagiosToServiceNow::json:40572] error @2018-09-22 20:43:11> Route exc +eption: Can't call method "err" on an undefined value at /home/svcana +gios/n2s/bin/../lib/NagiosToServiceNow/json.pm line 707. in /home/svc +anagios/n2s/bin/../local/lib/perl5/Dancer2/Core/App.pm l. 1473

By now you're probably realizing that my frenzied mind is lost. Sadly, I am in serious need of some very real help from my fellow monks on this, or I'm afraid I'll just go crazy... :(

David Lee Crites, Author and DevOps Dude
Devops: lee@critesclan.com
Author: davidlee@adoniah.co
quad alii ut vivere

In reply to Re^3: Dancer2::Plugin::Database and database errors by lee_crites
in thread Dancer2::Plugin::Database and database errors by lee_crites

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.