[Solved] YAML Load error in log

Moderator: crythias

Locked
scottbean
Znuny newbie
Posts: 14
Joined: 30 Jan 2013, 21:08
Znuny Version: 2.4.7
Real Name: Scott Bean

[Solved] YAML Load error in log

Post by scottbean »

I am getting the following error in our system log about once per hour:

OTRS-otrs.GenericAgent.pl-90[25744]: [Error][Kernel::System::YAML::Load][Line:130]: Loading the YAML string failed: YAML::XS::Load Error: The problem: block sequence entries are not allowed in this context was found at document: 1, line: 4, column: 6

Usually there are three or four entries in a row when this happens. I have confirmed all dependencies using otrs.CheckModules.pl - everything shows OK.

My searches have come up short - nothing that I have found matches the error I get.

Any thoughts/ideas as to what may be causing this?

EDIT -- This is on our test box which is running OTRS 3.2.1 - Red Hat linux using Mod_Perl with a MySQL DB on the backend.
Last edited by scottbean on 08 Feb 2013, 18:00, edited 1 time in total.
OTRS 2.4.7/RHEL 5.9/MySQL 5.0.95 Production -- OTRS 3.2.2/RHEL 5.9/MySQL 5.0.95 Dev/Test
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: YAML Load error in log

Post by reneeb »

Can you post the YAML that leads to the error?
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
scottbean
Znuny newbie
Posts: 14
Joined: 30 Jan 2013, 21:08
Znuny Version: 2.4.7
Real Name: Scott Bean

Re: YAML Load error in log

Post by scottbean »

I'm not really sure what is causing the error. I am posting a more specific error message received in e-mail - hopefully this will help:

Code: Select all

ERROR: OTRS-otrs.GenericAgent.pl-90 Perl: 5.8.8 OS: linux Time: Thu Feb  7 07:40:03 2013

Message: Loading the YAML string failed: YAML::XS::Load Error: The problem:

    block sequence entries are not allowed in this context

was found at document: 1, line: 4, column: 7


Traceback (17988): 
   Module: Kernel::System::YAML::Load (v1.5) Line: 130
   Module: Kernel::System::DynamicField::DynamicFieldGet (v1.66) Line: 308
   Module: Kernel::System::DynamicField::DynamicFieldListGet (v1.66) Line: 951
   Module: Kernel::System::GenericAgent::new (v1.86) Line: 117
   Module: /opt/otrs/bin/otrs.GenericAgent.pl (v1.12) Line: 91
OTRS 2.4.7/RHEL 5.9/MySQL 5.0.95 Production -- OTRS 3.2.2/RHEL 5.9/MySQL 5.0.95 Dev/Test
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: YAML Load error in log

Post by crythias »

If I were to guess, there's a generic agent trying to do something with a dynamic field, only the list or data is corrupt in the storage.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
scottbean
Znuny newbie
Posts: 14
Joined: 30 Jan 2013, 21:08
Znuny Version: 2.4.7
Real Name: Scott Bean

Re: YAML Load error in log

Post by scottbean »

I found 2 Generic Agent jobs set to run automatically. I changed them fro valid to invalid. Nothing is showing in the logs as far as Generic Agents now, but I still get a YAML error.

Here is the new error:

Code: Select all

Feb  7 14:06:11 test-ticket OTRS-CGI-90[1007]: [Error][Kernel::System::YAML::Load][Line:130]: Loading the YAML string failed: YAML::XS::Load Error: The problem:      block sequence entries are not allowed in this context  was found at document: 1, line: 4, column: 6 
The difference here is instead of being OTRS-otrs.GenericAgent.pl-90 I now see OTRS-CGI-90.
OTRS 2.4.7/RHEL 5.9/MySQL 5.0.95 Production -- OTRS 3.2.2/RHEL 5.9/MySQL 5.0.95 Dev/Test
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: YAML Load error in log

Post by crythias »

I'm going to go with my previous statement. I don't know more about your data structure, but it appears that the "config" field in a given (which? I don't know) dynamic_field record is corrupt, bad, misspelled, invalid yaml, etc. Yes, it's just a guess, but considering only one possibility, this one appears to be at least close to feasible.

"How to fix?" Don't really know. First see if it's reasonable that this is the problem. Also, since I don't know anything about the history of this error, I can only assume that you did something or the table is corrupt.

Kernel/System/DynamicField.pm:

Code: Select all

    if ( $Param{ID} ) {
        return if !$Self->{DBObject}->Prepare(
            SQL =>
                'SELECT id, internal_field, name, label, field_order, field_type, object_type, config,'
                .
                ' valid_id, create_time, change_time ' .
                'FROM dynamic_field WHERE id = ?',
            Bind => [ \$Param{ID} ],
        );
    }

    else {
        return if !$Self->{DBObject}->Prepare(
            SQL =>
                'SELECT id, internal_field, name, label, field_order, field_type, object_type, config,'
                .
                ' valid_id, create_time, change_time ' .
                'FROM dynamic_field WHERE name = ?',
            Bind => [ \$Param{Name} ],
        );
    }

    my %Data;
    while ( my @Data = $Self->{DBObject}->FetchrowArray() ) {
        my $Config = $Self->{YAMLObject}->Load( Data => $Data[7] ) || {};

        %Data = (
            ID            => $Data[0],
            InternalField => $Data[1],
            Name          => $Data[2],
            Label         => $Data[3],
            FieldOrder    => $Data[4],
            FieldType     => $Data[5],
            ObjectType    => $Data[6],
            Config        => $Config,
            ValidID       => $Data[8],
            CreateTime    => $Data[9],
            ChangeTime    => $Data[10],
        );
    }
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
scottbean
Znuny newbie
Posts: 14
Joined: 30 Jan 2013, 21:08
Znuny Version: 2.4.7
Real Name: Scott Bean

Re: YAML Load error in log

Post by scottbean »

I disable the three dynamic fields that were converted from free text fields during our upgrade. The error is gone, so it looks like bad data was the culprit.

Thanks to everyone for the help. I really appreciate it.

Scott
OTRS 2.4.7/RHEL 5.9/MySQL 5.0.95 Production -- OTRS 3.2.2/RHEL 5.9/MySQL 5.0.95 Dev/Test
dietmarb01
Znuny newbie
Posts: 3
Joined: 15 Feb 2012, 00:46
Znuny Version: 3.0.11

Re: [Solved] YAML Load error in log

Post by dietmarb01 »

Hi,

after some more investigation:

YAML::XS bails at a key or value that is (contains?) just '-' in dropdown dynamic fields, which was quite common in OTRS 2.x to denote an "empty" value and therefore may appear in automatically migrated FreeText fields.

It is enough to delete only the key/value pair in question from the dynamic field and that is it.

Such a value will also keep you from installing some packages into OTRS 3.2 (FAQ, ITSM, ...) by triggering the same error!

Hope this helps,
Dietmar
-------------

Code: Select all

 Message: Loading the YAML string failed: YAML::XS::Load Error: The problem:
    block sequence entries are not allowed in this context

 Message: YAML data was: "---
DefaultValue: ~
PossibleValues:
  -: -                                <<<------------------------------------------------ this one!
  Baseline Entwicklung: Baseline Entwicklung
  Baseline Fehlfunktionen: Baseline Fehlfunktionen
...
"
Locked