Skip to content Skip to sidebar

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.

Sun Mon Tue Wed Thu Fri Sat
- - 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00
- - - - - - -

Supporter timezone: America/Lima (GMT-05:00)

Tagged: 

This topic contains 58 replies, has 2 voices.

Last updated by Andreas W. 5 months, 3 weeks ago.

Assisted by: Andreas W..

Author Posts
October 3, 2025 at 3:07 am #17453263

rhettY

Please check this video record: hidden link

The 2 issues always happen in my production site:
1. Api error missing resource: No sitekey found for this website -- Unregistered and re-registered many times already
2. PHP Fatal error: Uncaught InvalidArgumentException: Argument $language_code must be a non empty string

I don't know how to trigger those errors.

A new error: German shop page link in switcher doesn't update. I just submitted another ticket about this: https://wpml.org/forums/topic/2-secondary-shop-pages-exist/#post-17453254

October 3, 2025 at 1:24 pm #17454536

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Do these errors only appear in the server's error.log or also in the WordPress debug.log?

So far, I haven't seen any errors on the staging site.

The problem with the shop page resolves itself on the staging site when I re-translate the page.

October 3, 2025 at 2:16 pm #17454666

rhettY

"Api error missing resource: No sitekey found for this website" appears in wpml -> support -> error log under Advanced Translation Editor

"PHP Fatal error: Uncaught InvalidArgumentException: Argument $language_code must be a non empty string" only appears in wp debug log

Please check the video: hidden link

There are lot of error logs relating WPML. I don't know how they appear or what triggered them.

October 3, 2025 at 3:15 pm #17454852

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

To investigate the issue, I need to be able to see the errors on the site I am working on.

On hidden link such errors do not occur in the debug.log so far.

I can only see this warning relative to WPML so far:

PHP Warning:  Undefined array key "REQUEST_METHOD" in /home/sensutoy/public_html/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Shared/st/class-wpml-pb-integration.php on line 177

Possible steps:
- Create a new staging and make sure the errors are occurring there too
- Provide me again access to the live site
(Currently password is not valid for admin access to hidden link, and FTP access is not working: Timeout detected. (control connection) Connection failed.)

October 11, 2025 at 4:09 pm #17476581

rhettY

Please tell me what you will do. I've provided the access several times. The issue didn't get solved yet. They are still happening.

The site was launched now. I don't wanna test or debug disrupts its running.

October 11, 2025 at 4:44 pm #17476613

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

I am sorry, but you are not answering my questions:

Where do you see the error? Which is the date of the latest entry? Please send me a screenshot.

On hidden link I could not confirm any "PHP Fatal error: Uncaught InvalidArgumentException" error in the debug.log, and I have no access to the server's error_log.

On the staging currently not any errors are found. This might be because it is unclear what is actually triggering this error.

If the error occurs only on the live site, then I need access to the site where I can see the error. I would then take a local copy for debugging.

October 12, 2025 at 1:14 am #17476974

rhettY

Please check the video record. It showed where the error happens:

hidden link

On racinghobby.com, I didn't notice "PHP Fatal error: Uncaught InvalidArgumentException", but
"Api error missing resource: No sitekey found for this website" is logged.

Or should I submit another ticket for "Api error missing resource: No sitekey found for this website"?

October 14, 2025 at 9:12 am #17482422

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

According to your video, the error "PHP Fatal error: Uncaught InvalidArgumentException" seems not to have occurred again since the 9th of October. If the error occurs again, please let me know.

The error "Api error missing resource: No sitekey found for this website" would mean that the site has an issue with the usage of the Advanced Translation Editor and the usage of credits for automatic translation.

On the staging, the last entry for this error was on 2025/10/11, and after using the Advanced Translation Editor on this site, the error did not occur again, which means that this issue no longer occurs on the staging, or it does not occur as the staging has no credits for AI translation.

If the error keeps occurring with new entries on your live site and you have issues with using the Advanced Translation Editor or the usage of credits for automatic translation, please provide me access to the live site, as I can no longer log in.

The private reply form is enabled again.

October 14, 2025 at 9:30 am #17482607

rhettY

Please check the video. "PHP Fatal error: Uncaught InvalidArgumentException" occurred yesterday again.

hidden link

The error "Api error missing resource: No sitekey found for this website" didn't occur yesterday.

The 2 errors didn't cause issue in frontend or backend. Maybe I just ignore them?

October 14, 2025 at 9:53 am #17482711

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Can you please confirm if the error "PHP Fatal error: Uncaught InvalidArgumentException" occurs on your server's error.log, also on the staging site?

If not, I might need access to the live site.

I can offer to take a local copy of the site and investigate further.

October 15, 2025 at 1:35 am #17485589

rhettY

It appears in wp debug log, not server error log.

When I reported the issue at the beginning, it appeared in server error log. At the time, wp debug was not on. Not sure why it didn't appear in the server error log now.

I didn't notice it in staging site's wp debug log. I didn't use staging site recently.

I can't provide access to live site now, as an ad campaign is running.

Your colleague has got a copy of the staging site (in this ticket: https://wpml.org/forums/topic/after-changing-to-other-currency-cant-change-back-to-default-currency-usd/). You can investigate from there.

October 15, 2025 at 3:18 pm #17487537

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

On the mentioned ticket, I only find access to the staging site and no download link for a site package.

If you can not provide access to the live site, I suggest you set up a new staging, enable WP DEBUG, and confirm if the error occurs on the staging, too.

Then provide me access to this new staging site.

The private reply form is enabled again.

October 17, 2025 at 3:28 pm #17494662

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

The provided password does not allow me to access this site. I can currently not access the live site or staging site with any of the earlier provided credentials.

Note that you had already provided me access to this staging site earlier, and I was not able to confirm the error "PHP Fatal error: Uncaught InvalidArgumentException".

Before providing access, please ensure that this error actually occurs with the current date on the debug.log.

For the second error:
This is a site-specific error. It needs to be investigated on the live site.

Do you need this staging site to operate with automatic translation, or was this site only created for troubleshooting?

October 17, 2025 at 6:23 pm #17495026

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Regarding:
"Api error missing resource: No sitekey found for this website"

I do see the error, but I do not see any issue on our system, and the site seems to operate as expected. Do you have any issues with the usage of:

- Advanced Translation Editor
- Automatic translation
- Assignment or usage of credits
- Glossary or translation memory

Regarding:
"Uncaught InvalidArgumentException: Argument $language_code must be a non-empty string"

This error is usually found if the default language is not set in WPML:
https://wpml.org/errata/php-fatal-error-uncaught-invalidargumentexception-argument-language_code-must-be-a-non-empty-string/

Have you maybe switched the site's default language from German to English, or was the site maybe earlier using a different language that is no longer active on the site?

Would you agree if I install a plugin to take a closer look at the database?

About the error:
This error is triggered because WPML’s WPML_Translation_Element::get_translation() method is being called with an empty $language_code, which violates its contract and throws an InvalidArgumentException.

In this case, the call originates from:
WPML_Media_Attachments_Duplication->get_translated_attachment_id()

Which is used during Bricks media translation via translate_bricks_media()

Basically, it looks like there is some corrupted media on the original content, which might not have a language association inside WPML's database tables.

What I did:
1) Made use of WPML > Support > Troubleshooting to set language information for all contents, clearing WPML's cache, and deleting ghost entries.

2) Synced the media at WPML > Settings > Media Translation. To do this, I disabled "Automatically detect best options for translating image texts (alt, caption, title)", then clicked "Setup manually" and ran the sync option for existing content.

Sadly, this did not yet solve the issue. Once you edit the original homepage and save it, the error pops up again.

October 18, 2025 at 1:37 am #17495386

rhettY

Except the errors, I didn't find any issue in frontend or using your features yet.

I never changed the default language, but I have added 2 secondary languages and then gave up and used only 1 secondary language which was done before I started translation. Maybe this is the culprit.

You can install a plugin to check the database.

The topic ‘[Closed] PHP Fatal error: Uncaught InvalidArgumentException:’ is closed to new replies.