Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SOLVED Error: API failure: Syck parser syntax error

Discussion in 'EasyApache' started by CyclingTribe, Aug 17, 2017.

  1. CyclingTribe

    CyclingTribe Member

    Joined:
    Aug 9, 2017
    Messages:
    12
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Work
    cPanel Access Level:
    Root Administrator
    Hello,

    When I go to MultiPHP Manager I get the following error (and no list of domains / PHP versions):

    Error: API failure: Syck parser (line 9, column -1): syntax error at /usr/local/cpanel/Cpanel/YAML.pm line 68.

    Any idea what's gone wrong and how I fix it?

    Thanks,
    Shaun
     
  2. CyclingTribe

    CyclingTribe Member

    Joined:
    Aug 9, 2017
    Messages:
    12
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Work
    cPanel Access Level:
    Root Administrator
    From /usr/local/cpanel/logs/error_log:

    [2017-08-17 11:52:01 +0100] info [xml-api] API failure: Syck parser (line 9, column 0): syntax error at /usr/local/cpanel/Cpanel/YAML.pm line 68. [php_get_vhost_versions] version [1].
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,220
    Likes Received:
    1,376
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    The error messages suggests one of your PHP-FPM YAML files is invalid or corrupt. Have you made manual changes to any PHP-FPM YAML files associated with an account? If not, try running the following command:

    Code:
    /scripts/php_fpm_config --rebuild
    The "Syck parser (line 3, column 11)" error message will appear on the next line after the check for the domain name with the corrupted YAML file. Once you find the affected domain name, you could move the invalid file out of the way with a command such as:

    Code:
    mv -v /var/cpanel/userdata/username/domain.tld.php-fpm.yaml /root/
    Then, browse to "WHM >> MultiPHP Manager" and re-enable PHP-FPM for the domain name to ensure the file is rebuilt. Once you confirm it's working well, you can remove the domain.tld.php-fpm.yaml file that was moved to the /root directory.

    Thank you.
     
  4. CyclingTribe

    CyclingTribe Member

    Joined:
    Aug 9, 2017
    Messages:
    12
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Work
    cPanel Access Level:
    Root Administrator
    Thanks Michael,

    Yes, I've made manual changes to all of them, to add:
    Code:
    request_terminate_timeout = 300
    ... because I was getting a lot of errors due to early process termination.

    I've also edited some to individually tweak the start/min_max spare/children etc. as one or two of the sites need much more resources than others.

    Cheers,
    Shaun
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,220
    Likes Received:
    1,376
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Could you use the steps in my last response to determine which YAML file is corrupted, and then let us know the contents of the corrupted file?

    Thank you.
     
  6. CyclingTribe

    CyclingTribe Member

    Joined:
    Aug 9, 2017
    Messages:
    12
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Work
    cPanel Access Level:
    Root Administrator
    Sorry Michael,

    I tried to edit my last post but it told me it was "spammy"?

    I haven't edited any of the YAML files - I've edited the .conf files in: /opt/cpanel/ea-php70/root/etc/php-fpm.d

    Anyway, I ran the rebuild script and it failed on [removed-domain]

    Kind regards,
    Shaun
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,220
    Likes Received:
    1,376
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Could you follow the earlier instructions for removing the YAML file for that domain name and verify if it solves the issue?

    Thank you.
     
  8. CyclingTribe

    CyclingTribe Member

    Joined:
    Aug 9, 2017
    Messages:
    12
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Work
    cPanel Access Level:
    Root Administrator
    I've tried, it brings up different domains each time - I move them and it fails on others - I move those, and it fails on the ones I previously moved. :confused:
     
  9. CyclingTribe

    CyclingTribe Member

    Joined:
    Aug 9, 2017
    Messages:
    12
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Work
    cPanel Access Level:
    Root Administrator
    Great - now it's deleted all the customisations I made to the conf files in /opt/cpanel/ea-php70/root/etc/php-fpm.d
     
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,220
    Likes Received:
    1,376
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You can restore the previous YAML files by moving them back from the /root/ directory to the /var/cpanel/userdata/$username/ directory. Since that did not help solve the issue, could you open a support ticket using the link in my signature so we can take a closer look?

    Thank you.
     
  11. CyclingTribe

    CyclingTribe Member

    Joined:
    Aug 9, 2017
    Messages:
    12
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Work
    cPanel Access Level:
    Root Administrator
    It has deleted all of the .conf files in /opt/cpanel/ea-php70/root/etc/php-fpm.d/ directory - where I'd spent quite a bit of time tweaking the individual site php-fpm settings. :mad:

    I'll start a ticket. Thanks for your assistance.
     
  12. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,220
    Likes Received:
    1,376
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Keep in mind that directly editing those configuration files is unsupported. Instead, you'd need to edit the YAML files to ensure the changes are preserved. This is documented at:

    PHP-FPM and EasyApache 4 - Documentation - cPanel Documentation

    Additionally, you may find this thread helpful:

    SOLVED - Stop cPanel from overwriting php-fpm settings file.

    Regarding the issue with "WHM >> MultiPHP Manager", feel free to post the ticket number here and we can update this thread with the outcome.

    Thank you.
     
    CyclingTribe likes this.
  13. CyclingTribe

    CyclingTribe Member

    Joined:
    Aug 9, 2017
    Messages:
    12
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Work
    cPanel Access Level:
    Root Administrator
    Ticket submitted: 8796917
     
  14. CyclingTribe

    CyclingTribe Member

    Joined:
    Aug 9, 2017
    Messages:
    12
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Work
    cPanel Access Level:
    Root Administrator
    Ah, okay, I see - so I've been editing the wrong files and should have added the changes to the .yaml file for the domain.

    Noted, along with the instructions - thanks. :)
     
    cPanelMichael likes this.
  15. CyclingTribe

    CyclingTribe Member

    Joined:
    Aug 9, 2017
    Messages:
    12
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Work
    cPanel Access Level:
    Root Administrator
    Just out of interest - if I wanted to make the timeout a default part of all future domain PHP-FPM configurations, is there a sort of "Master" file that is used as a template that I could add it to?
     
  16. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,220
    Likes Received:
    1,376
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Yes, this is possible. Here's a thread with instructions on how to do this:

    PHP-FPM - Default Settings

    I also encourage you to vote for the following feature request to allow for an easier method of making these types of changes:

    PHP-FPM Enhanced Configuration

    Thank you.
     
    CyclingTribe likes this.
  17. CyclingTribe

    CyclingTribe Member

    Joined:
    Aug 9, 2017
    Messages:
    12
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Work
    cPanel Access Level:
    Root Administrator
    Thanks, I've voted.

    I'm coming to WHM/cPanel after a decade of Debian and editing things manually - so I am not used to (and somewhat frustrated by) the way in which changes can be easily, and for me, unknowingly overwritten from the panel.

    Lots to learn and I suppose it's better I do it with a handful of domains than a year later with hundreds!! ;)
     
  18. CyclingTribe

    CyclingTribe Member

    Joined:
    Aug 9, 2017
    Messages:
    12
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Work
    cPanel Access Level:
    Root Administrator
    FIXED: I had made an incorrect entry in: /var/cpanel/ApachePHPFPM/system_pool_defaults.yaml

    I had used = for the timeout when I should have used :

    Thanks for sorting. :-D
     
    cPanelMichael likes this.
Loading...

Share This Page