ITSM No SCALAR param in Bind!

English! place to talk about development, programming and coding
Post Reply
cpuguy83
Znuny newbie
Posts: 11
Joined: 15 Sep 2011, 23:42
Znuny Version: 3.0.10
Real Name: Brian Goff

ITSM No SCALAR param in Bind!

Post by cpuguy83 »

I'm getting the following error/trace in my logs when creating a new XML version via the API.
Here is the XML data I am sending:

Code: Select all

[nil,
   {"Version"=>
      "State"=>[nil, {"Content"=>"NY"}],
      "TimeZone"=>[nil, {"Content"=>""}],
      "UnionLabor"=>[nil, {"Content"=>"No"}],
      "WebsiteAddress"=>[nil, {"Content"=>"http://www.google.com/"}],
      "Zip"=>[nil, {"Content"=>"97301"}]
   }
]
As far as I can tell everything is working, CI's work correctly, new versions, data in db looks good, except this one error:
ERROR: OTRS-RPC-10 Perl: 5.10.1 OS: linux Time: Thu Sep 29 17:27:20 2011

Message: No SCALAR param in Bind!

Traceback (28764):
Module: Kernel::System::XML::XMLHashAdd (v1.105.2.2) Line: 144
Module: Kernel::System::ITSMConfigItem::XML::_XMLVersionAdd (v1.18) Line: 426
Module: Kernel::System::ITSMConfigItem::Version::VersionAdd (v1.29) Line: 539
Module: Core::Dispatch (unknown version) Line: 225
Module: ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_json_2epl::handler (unknown version) Line: 65
Module: (eval) (v1.13) Line: 204
Module: ModPerl::RegistryCooker::run (v1.13) Line: 204
Module: ModPerl::RegistryCooker::default_handler (v1.13) Line: 170
Module: ModPerl::Registry::handler (v1.99) Line: 31
Last edited by cpuguy83 on 30 Sep 2011, 16:38, edited 1 time in total.
cpuguy83
Znuny newbie
Posts: 11
Joined: 15 Sep 2011, 23:42
Znuny Version: 3.0.10
Real Name: Brian Goff

Re: ITSM No SCALAR param in Bind!

Post by cpuguy83 »

Obviously this is coming from the XMLHashAdd method.
Specifically when it sends it to the db:

Code: Select all

$Self->{DBObject}->Do(
                SQL =>
                    'INSERT INTO xml_storage (xml_type, xml_key, xml_content_key, xml_content_value) VALUES (?, ?, ?, ?)',
                Bind => [ \$TmpKey, \$Param{Key}, \$Key, \$ValueHASH{$Key}, ],
            );
        }
Code that is tripping is:

Code: Select all

my @Array;
   if ( $Param{Bind} ) {
       for my $Data ( @{ $Param{Bind} } ) {
           if ( ref $Data eq 'SCALAR' ) {
               push @Array, $$Data;
           }
           else {
               $Self->{LogObject}->Log(
                   Caller   => 1,
                   Priority => 'Error',
                   Message  => 'No SCALAR param in Bind!',
               );
               return;
           }
       }
   }
10:19
cpuguy83
Znuny newbie
Posts: 11
Joined: 15 Sep 2011, 23:42
Znuny Version: 3.0.10
Real Name: Brian Goff

Re: ITSM No SCALAR param in Bind!

Post by cpuguy83 »

Seems like I'm missing something from my array but I'm not sure what.
Wondering if I'm getting this because this is being converted from a Ruby array into JSON then to Perl.

Anyone know what this Bind object is for? Is it wise to proceed with this error?
cpuguy83
Znuny newbie
Posts: 11
Joined: 15 Sep 2011, 23:42
Znuny Version: 3.0.10
Real Name: Brian Goff

Re: ITSM No SCALAR param in Bind!

Post by cpuguy83 »

Going through more code, I have found this is fairly benign as long as none of my records are over 4K in size.

Essentially Bind is a method to insert into the database.
XMLHashAdd is looking for the Bind param and attempting to insert with that.
For me this is failing because I'm missing something in my array.
Code moves on to the next method which is a standard SQL insert.
First it checks to see if the record is > 4K, if it is it will throw an exception saying you need to use Bind for compatibility reasons.

So I'm good unless the record is > 4K.
I personally use MySQL for OTRS, but have not found any references to a 4K limitation.
This could possibly be changed to not throw the exception at > 4K insert.
crons
Znuny newbie
Posts: 58
Joined: 17 Aug 2012, 06:11
Znuny Version: 3.3.x
Real Name: Cornelius Jackson

Re: ITSM No SCALAR param in Bind!

Post by crons »

Did you able to create ConfigItems via ApI? If so how ?
Thanks is Advance
Post Reply