Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
I want to enable wpml string translations and the site is crashing when I do.

[error] 14588#14588: *815 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught WpOrg\Requests\Exception\InvalidArgument: WpOrg\Requests\Cookie::__construct(): Argument #1 ($name) must be of type string, integer given in /data/EW/httpdocs/httpdocs_dsd/wp-includes/Requests/src/Exception/InvalidArgument.php:29
Solution:
Upgrading PHP to version 8+ helped
Relevant Documentation:

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 14 replies, has 2 voices.

Last updated by Nic 1 year, 7 months ago.

Assisted by: Bobby.

Author Posts
April 25, 2023 at 8:21 am #13531543

Nic

I want to enable wpml string translations and the site is crashing when I do.
I need to remove the plugin from filesystem in order to get the site back up.

stack trace from error log (from dev environment):

2023/04/25 08:05:32 [error] 14588#14588: *815 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught WpOrg\Requests\Exception\InvalidArgument: WpOrg\Requests\Cookie::__construct(): Argument #1 ($name) must be of type string, integer given in /data/EW/httpdocs/httpdocs_dsd/wp-includes/Requests/src/Exception/InvalidArgument.php:29
Stack trace:
#0 /data/EW/httpdocs/httpdocs_dsd/wp-includes/Requests/src/Cookie.php(83): WpOrg\Requests\Exception\InvalidArgument::create()
#1 /data/EW/httpdocs/httpdocs_dsd/wp-includes/class-wp-http.php(472): WpOrg\Requests\Cookie->__construct()
#2 /data/EW/httpdocs/httpdocs_dsd/wp-includes/class-wp-http.php(352): WP_Http::normalize_cookies()
#3 /data/EW/httpdocs/httpdocs_dsd/wp-includes/class-wp-http.php(634): WP_Http->request()
#4 /data/EW/httpdocs/httpdocs_dsd/wp-content/plugins/sitepress-multilingual-cms/classes/REST/Status.php(82): WP_Http->get()
#5 /data/EW/httpdocs/httpdocs_dsd/wp-content/plugins/sitepress-multilingual-cms/classes/REST/Status.php(47): WPML\Core\REST\Status->pingRestEndpoint()
#6 /data/EW/httpdocs/httpdocs_dsd" while reading response header from upstream, client: 84.243.225.220, server: hidden link, request: "GET /wp-admin/plugins.php?activate=true&plugin_status=all&paged=1&s= HTTP/1.1", upstream: "hidden link:", host: "www.dsd.test", referrer: "hidden link"

Can you help me out here?

Kind Regards,
Rick Altena
Developer

April 26, 2023 at 5:55 am #13537875

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Hi Rick,

For being of better help, can you please provide your WPML Debug information in the debug field below?
http://wpml.org/faq/provide-debug-information-faster-support/

Also, If you have a staging site, what are your results when testing with a minimal environment? There is a possibility a third-party plugin along with WPML might be causing this error.

April 26, 2023 at 7:16 am #13538303

Nic

I'm sorry I can't. The debug info button throws a fatal error. So the only info I've got is the stacktrace from php debug log.

April 26, 2023 at 7:17 am #13538305

Nic

Actually, without the string translation active I can get debug info and I've posted it above.

April 26, 2023 at 6:52 pm #13544471

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Thank you, everything looks ok so far, only recommendation is to increase your WP MEMORY LIMIT to 256M or higher as 40M is below our minimum requirements for WPML.

I would like to request temporary access (wp-admin and FTP) to your site to test the issue.
(preferably to a test site where the problem has been replicated if possible)

**Before we proceed It is necessary to take FULL BACKUP of your database and your website. Providing us with access, you agree that a backup has been taken **

I often use the Duplicator plugin for this purpose: http://wordpress.org/plugins/duplicator/
You will find the needed fields for this below the comment area when you log in to leave your next reply.
The information you enter is private which means only you and I have access to it.

NOTE: If access to the live site is not possible and the staging site does not exist please provide me with a duplicator package created with the duplicator plugin.

Thank you,
Bobby

May 2, 2023 at 9:12 pm #13574189

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Hi Rick,

Thank you for sharing the access details!

At the moment I am not able to login to the backend. Please verify they are correct. ( I have tried the username with the space and without)

May 5, 2023 at 6:24 am #13590827

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Thank you for the access details!

As I did not have the FTP credentials and the string translation plugin crashes the site I was able to create a duplicator package to test locally.

It looks like the theme EWIM is possibly causing this error with WPML.

Go to Appearance-> switch your theme to a standard theme temporarily (twenty23 for example) and attempt to enable WPML String Translation, does it work ok?

May 8, 2023 at 7:40 am #13602563

Nic

Hey Bobby,

thanks for checking. I've tried and it still crashed as soon as I activated the string translation. That was with a clean install for the default twenty23 theme.
I think there must be something wrong with the setup for cookies when it's not a user sent request. At least that's what the error stack trace comes down to.

But I could really use some assistance here.

May 8, 2023 at 10:18 pm #13609125

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Hi there,

I was able to activate WPML string translation on the site by going to Plugins->Add new->Commercial tab-> Install & activate without any fatal errors at the moment.

May 9, 2023 at 6:59 am #13610057

Nic

Sorry Bobby, the site still crashed. I'm going to delete the plugin again, and send the stack trace again. I need to give a training on the site this afternoon so please keep that in mind in case you want to re-activate the plugin.

stacktrace:
[Tue May 09 08:51:37.836434 2023] [proxy_fcgi:error] [pid 4122] [client 84.243.225.220:59276] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught WpOrg\\Requests\\Exception\\InvalidArgument: WpOrg\\Requests\\Cookie::__construct(): Argument #1 ($name) must be of type string, integer given in /var/www/vhosts/eigenwijze.nl/dsd.eigenwijze.nl/httpdocs/wp-includes/Requests/src/Exception/InvalidArgument.php:29\nStack trace:\n#0 /var/www/vhosts/eigenwijze.nl/dsd.eigenwijze.nl/httpdocs/wp-includes/Requests/src/Cookie.php(83): WpOrg\\Requests\\Exception\\InvalidArgument::create()\n#1 /var/www/vhosts/eigenwijze.nl/dsd.eigenwijze.nl/httpdocs/wp-includes/class-wp-http.php(472): WpOrg\\Requests\\Cookie->__construct()\n#2 /var/www/vhosts/eigenwijze.nl/dsd.eigenwijze.nl/httpdocs/wp-includes/class-wp-http.php(352): WP_Http::normalize_cookies()\n#3 /var/www/vhosts/eigenwijze.nl/dsd.eigenwijze.nl/httpdocs/wp-includes/class-wp-http.php(634): WP_Http->request()\n#4 /var/www/vhosts/eigenwijze.nl/dsd.eigenwijze.nl/httpdocs/wp-content/plugins/sitepress-multilingual-cms/classes/REST/Status.php(82): WP_Http->get()\n#5 /var/www/vhosts/eigenwijze.nl/dsd...', referer: hidden link

May 9, 2023 at 6:52 pm #13616791

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Thank you for updating me!

Did the site crash at a random time or was there a specific action that showcased the fatal error? For example, viewing a translation or trying to add a translation.

When I enabled String Translation I did not get a fatal error. This will help in reproducing this behavior.

Thank you!

May 10, 2023 at 7:09 am #13618697

Nic

The site crashed when I went back in the back-end. Front end was stable at first, but then once I logged in the dash crashed.

Kind regards,
Rick

May 11, 2023 at 4:37 pm #13632141

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Hi Rick,

I am migrating a copy of the site to our cloudways servers where we can further test without having to risk your site going down. will update you here as soon as there are updates

May 22, 2023 at 9:22 am #13687665

Nic

Hey Bobby,

I noticed you were running a different PHP version, so I changed mine. It's working now. PHP needs to be at 8 minimum to run it seems.

Cheers and thanks for helping us out.

Kind regards,
Rick

May 22, 2023 at 9:23 am #13687669

Nic

Upgrading PHP to version 8+ helped me fix this issue.