FAILURE: Syck parser (line 2, column 9): syntax error at /usr/local/cpanel/Cpanel/YAML.pm line 71.

FourthFloor

Member
Oct 7, 2020
12
0
1
Ohio
cPanel Access Level
Reseller Owner
I'm having an issue deploying my latest GIT Head Commit. It essentially just gets stuck on: The deployment that you triggered on Nov 23, 2020 6:24:38 PM is queued …

Further diving into the issue revealed the following in .cpanel/
Code:
2020-11-23T23:24:38Z: Processing 00000000/5fbc44b5ea47d7...
2020-11-23T23:24:38Z:   doing Cpanel::UserTasks::VersionControl::deploy
2020-11-23T23:24:38Z:   FAILURE: Syck parser (line 2, column 9): syntax error at /usr/local/cpanel/Cpanel/YAML.pm line 71.
2020-11-23T23:24:38Z: Queue empty, terminating
In looking directly in my YAML.pm file, this is what I see:

Code:
#Copied and slightly tweaked frm YAML::Syck;
sub LoadFile {
    my $file = shift;
    my $max  = shift;

    my $str_r;
    if ( _is_openhandle($file) ) {
        if ($max) {
            my $togo   = $max;
            my $buffer = '';
            my $bytes_read;
            while ( $bytes_read = read( $file, $buffer, $togo, length $buffer ) && length $buffer < $max ) {
                $togo -= $bytes_read;
            }
            $str_r = \$buffer;
        }
        else {
            $str_r = \do { local $/; <$file> };
        }
    }
    else {
        if ( !-e $file || -z $file ) {
            require Carp;
            Carp::croak("'$file' is non-existent or empty");
        }
        open( my $fh, '<', $file ) or do {
            require Carp;
            Carp::croak("Cannot read from $file: $!");
        };
        $str_r = \do { local $/; <$fh> };
    }

    return YAML::Syck::LoadYAML($$str_r);
}

1;
NOTE: I have not edited this and it was working without any edits in the past. I have zero idea why it suddenly stopped, unless it was an automatic update that possibly occurred. I'm not certain how to reset this as I am not very familiar with terminal/shell access.
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
16,585
2,614
363
cPanel Access Level
Root Administrator
Hey there! Sorry to hear about the Git issues you've run into. Do you see anything obviously wrong with the "config" file in the repo's .git directory, or have the timestamps on any of those files changed? There could also be an issue with the $file path on the account, so that is something to check as well.
 

FourthFloor

Member
Oct 7, 2020
12
0
1
Ohio
cPanel Access Level
Reseller Owner
The config file seems to be fine, although admittedly I'm not certain what it should look like:
Code:
[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[receive]
    denyCurrentBranch = updateInstead
[gc]
    auto = 0
The file path to the YAML.pm file seems to be right, if that's the file path you're referring to. If it's the one given in the .cpanel.yml file, it appears to be working fine. This is my code, which is working elsewhere with a slightly different file path of course. I have verified that that file path does exist (domain name and username have been removed from the example below).

YAML:
deployment:
      tasks:
        - export DEPLOYPATH=/home/*****/subdomains/staging.****.com
        - /bin/cp -R * $DEPLOYPATH

I will say that it seems like an older Git installation on my server is working properly (it was installed a few months ago), while all new Git installations that I've created in the past month or few weeks are having this issue. This particular installation has recently been installed (yesterday) and has never worked. I've compared
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
16,585
2,614
363
cPanel Access Level
Root Administrator
Thanks for the additional details. For these types of issues it is usually best if we get hands-on through a ticket so we can see all the configurations interacting on the system. If you can open a ticket and then post the number here I'll be sure to follow along so I can include the resolution.