Mailing List Archive

Perl upgrade on Debian 9 causes JSON error
Upgrading the Perl packages on Debian testing causes external auth to fail:

> 16594] [Thu Oct 27 16:22:52 2016] [error]: encountered object '1', but neither allow_blessed, convert_blessed nor allow_tags settings are enabled (or TO_JSON/FREEZE method missing) at /usr/share/perl5/JSON.pm line 154.
>
> Stack:
> [/usr/share/perl5/JSON.pm:154]
> [/usr/share/request-tracker4/lib/RT/Interface/Web.pm:197]
> [/usr/share/request-tracker4/lib/RT/Interface/Web.pm:4065]
> [/usr/share/request-tracker4/html/Elements/JavascriptConfig:79]
> [/usr/share/request-tracker4/html/Elements/Header:64]
> [/usr/share/request-tracker4/html/index.html:4]
> [/usr/share/request-tracker4/lib/RT/Interface/Web.pm:681]
> [/usr/share/request-tracker4/lib/RT/Interface/Web.pm:369]
> [/usr/share/request-tracker4/html/autohandler:53] (/usr/share/request-tracker4/lib/RT/Interface/Web/Handler.pm:209)A quick google doesn't show this particular error.

Any hints as to what might be wrong? I was using external auth and thought that might be causing the problem, but turning that off leaves the JSON error.

I'm using the Debian packages for everything, which had JSON at 3.02 and JSON::XS at 2.98 after the upgrade. Upgrading JSON::XS with CPAN worked and now CPAN says that JSON and JSON::XS packages are both up to date (3.02)

The rest of the system works as advertised, just not the web UI.

James Zuelow
Systems Operations Manager
City and Borough of Juneau - MIS
(907) 586-0236
Re: Perl upgrade on Debian 9 causes JSON error [ In reply to ]
OK, to answer my own question, I edited line 197 of /usr/share/request-tracker4/lib/RT/Interface/Web.pm

I just added the allow_blessed => 1 to get rid of the error message.

> sub EncodeJSON {
> my $s = JSON::to_json(shift, { allow_blessed => 1, allow_nonref => 1 });
> $s =~ s{/}{\\/}g;
> return $s;
> }

Now the question remains - am I silently breaking something else with that little hack?

I know just enough Perl to be dangerous, so freely admit I'm not aware of all of the possible ramifications of the edit.


James Zuelow
Systems Operations Manager
City and Borough of Juneau - MIS
(907) 586-0236