SOLVED Error: API failure: Syck parser syntax error

CyclingTribe

Member
Aug 9, 2017
18
3
3
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
 

CyclingTribe

Member
Aug 9, 2017
18
3
3
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].
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,237
463
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.
 

CyclingTribe

Member
Aug 9, 2017
18
3
3
Work
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?
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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,237
463
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.
 

CyclingTribe

Member
Aug 9, 2017
18
3
3
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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,237
463
Anyway, I ran the rebuild script and it failed on [removed-domain]
Could you follow the earlier instructions for removing the YAML file for that domain name and verify if it solves the issue?

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,237
463
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.
 

CyclingTribe

Member
Aug 9, 2017
18
3
3
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,237
463
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.
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.
 
  • Like
Reactions: CyclingTribe

CyclingTribe

Member
Aug 9, 2017
18
3
3
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?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,237
463
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?
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.
 
  • Like
Reactions: CyclingTribe

CyclingTribe

Member
Aug 9, 2017
18
3
3
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!! ;)