Techno · 28/10/2022

WordPress Toolkit says “Error: Initial data load error: some required fields are not provided”

You access the WordPress Toolkit page in WHM and observe that it fails to load with this error:

Error: Initial data load error: some required fields are not provided Description

This can commonly be caused by corruption in the /usr/local/cpanel/3rdparty/wp-toolkit/var/wp-toolkit.sqlite3 database file that WordPress Toolkit uses.

This can also occur if the locale of the server is set to one that is not compatible with the PHP: ucfirst function. We have reported this incident to the Plesk WordPress Toolkit Developers and they have opened the case EXTWPTOOLK-7648 to fix this cause.

Update: This issue is resolved in WordPress Toolkit version 5.6.0.

“[-] (cPanel) It is now possible to install WordPress Toolkit on a server with Turkish locale (tr_TR). (EXTWPTOOLK-7648)”

Workaround

This issue has been resolved in WordPress Toolkit version 5.6.0, but the old workaround is below:

rpm -e –nodeps wp-toolkit-cpanel sh <(curl https://wp-toolkit.plesk.com/cPanel/installer.sh || wget -O – https://wp-toolkit.plesk.com/cPanel/installer.sh)

If the above task does not resolve the error, you will need to verify if your server is running an alternative locale that may be incompatible(ie. Turkish). The following is an example output of a default en_US locale.

# locale
LANG=en_US.UTF-8
LC_CTYPE=”en_US.UTF-8″
LC_NUMERIC=”en_US.UTF-8″

If your server is not using the en_US locale, this can be overridden for the sw-engine service in the startup configuration. To make this change, you will add the following line to the file ‘/usr/lib/systemd/system/sw-engine.service’.

Environment=LANG=en_US.UTF-8

This should be added at the bottom of the section labeled [Service] and would be expected to appear as below.

[Service] Type=notify PIDFile=/run/sw-engine.pid ExecStart=/usr/sbin/sw-engine-fpm –fpm-config /etc/sw-engine/sw-engine-fpm.conf -c /usr/local/psa/admin/conf/php.ini –nodaemonize –pid /run/sw-engine.pid ExecReload=/bin/kill -s SIGUSR2 $MAINPID # `rm -rf /dir1/dir2/*` doesn’t work in systemd unit ExecStopPost=-/usr/bin/find /run/lock/lmlib/ -mindepth 1 -delete KillMode=process Environment=LANG=en_US.UTF-8

Once this change has been made, you can apply it by reloading the service with the below commands.

systemctl daemon-reload systemctl restart sw-engine