On Tue, Dec 13, 2016 at 04:55:37AM -0900, James Zuelow wrote:
> I run request-tracker4, apache2, and postfix.  I've been tracking testing in 
> order to get a newer version of request-tracker4 than is available in Jessie.
> 
> After upgrading request-tracker4 when I run the unmodified package, Apache 
> generates a 500 internal
> server error as such:
> 
> xxxxxxxxx
> 
> [31143] [Tue Dec 13 13:29:06 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)
> 
> xxxxxxxxxx
> 
> I've tried updating JSON via CPAN, etc. without success.  However a simple 
> addition to Web.pm resolves the issue.  I've been running this modification 
> in production without any issues.  There has been at least one other person 
> on rt-users that has needed this in conjunction with a Debian install, so I'm 
> fairly sure that this isn't being caused by a local modification.  (Unless 
> we've both made the same modification without realizing it.)  However Best 
> Practical hasn't responded on: rt-users, so this may be Debian specific.
> 
> Patch for /usr/share/request-tracker4/lib/RT/Interface/Web.pm:
> 
> xxxxxxxxxx
> 
> --- Web.pm      2016-12-13 04:40:12.199936566 -0900
> +++ Web-jfz.pm  2016-12-13 04:39:53.643473002 -0900
> @@ -194,7 +194,7 @@
>  =cut
>  
>  sub EncodeJSON {
> -    my $s = JSON::to_json(shift, { allow_nonref => 1 });
> +    my $s = JSON::to_json(shift, { allow_blessed => 1, allow_nonref => 1 });
>      $s =~ s{/}{\\/}g;
>      return $s;
>  }
> 
> xxxxxxxxxx

> -- Package-specific info:
> Changed files:
>   usr/share/request-tracker4/lib/RT/Interface/Web.pm
> 
> There are locally modified files in /usr/local/share/request-tracker4/,
>  these may (or may not) be the source of the problem.

Hi James,

Sorry to hear that you are having problems. Just a quick question
before I dive into the code; can you clarify what web server interface
you are using (mod_perl or something else), and whether you can
reproduce the problem without your other local modifications. It 
would help if you could share the changes in
/usr/local/share/request-tracker4/ if they look relevant.

I note that this problem looks similar to one seen quite a while ago:

http://requesttracker.8502.n7.nabble.com/Update-to-RT-4-2-1-gt-JSON-error-after-login-td55890.html

and a similar problem is here:

http://www.perlmonks.org/?node_id=1159078

In both of those mod_perl is implicated, and maybe JSON::XS too.
You mention that JSON::XS is installed, but it's not a direct dependency
of RT - can you try uninstalling it (from the package and CPAN install)
and see if that makes a difference?

Cheers,
Dominic.

Reply via email to