Error creating users on 3.6

anyone having an error when creating a new user in 3.6?
I’m Getting this error: ‘Error: Please enter a valid language’

If someone knows what to try will be helpful, many thanks.

Is that in a fresh installation or an updated project?

It’s an updated project

I just tried this in one of my updated projects as well (from and it fails a bit differently but it fails. I used the same language (Español) as @isaactopo.

Once I press the create user button as admin, I get the panel error view with this error message:
The JSON response could not be parsed

When looking into the JSON response from users I get:
NaN null

The user isn’t actually created, fails before. Hope it helps, let me know if some of you need more information.

Interesting, because I tried also with Spanish in a fresh Starterkit and couldn’t reproduce the error.

Do you also get the error in a Starterkit? I guess you have done all the necessary steps needed for updating (remove cache, media folder)?

Hm. I tried it again now differently. On the local system (upgraded site, via composer) it does work seamlessly, without cleaning media or cache folder. On remote, production server it does not work, even after cleaning media/ and site/cache folder.

A bit off topic but does composer update clean both folders automatically? It’s unclear in the docs but suggests it does so.

For my updated project I tried a few things:

  • Deleted Cache
  • Deleted Media folder
  • Deleted previous Users
  • Tried a lot of different languages for the user (all languages fail)
  • Deleted Trevor Plugin (in case it could be related to the language issue)

Plugins I have installed:

  • afbora/kirby-minify-html
  • hashsandsalt/kirby3-schema
  • isaactopo/vcard-kirby3
  • medienbaecker/autofavicon
  • omz13/htmlsitemap
  • omz13/xmlsitemap
  • pedroborges/meta-tags
  • sylvainjule/locator
  • sylvainjule/pagetable

With a Fresh StarterKit is all working well.
Let me know if you need more information.

Are the plugins all up-to-date (although I don’t really see how they would be related to the issue)?

From which version did you try to update?

As which type of user are you trying to create the new user? As admin or as collaborator? Fishing in the dark here, just trying to rule things out.

In my case, yes.

As admin.

@helloanselm In your case I find it interesting that you have no issues locally but on the remote server only (different PHP version, server-side caching …). Question is what are the differences here apart from composer update/non-composer update.

composer update shouldn’t remove the media/cache/session folders.

I found another issue on another instance. When trying to create a new page via the Panel I get the popover but when trying to create/save, I get the Kirby panel error view stating

The JSON response could not be parsed
Failed to load resource: the server responded with a status of 403 () in

I’m not entirely sure it is related but it behaves very similar to the issue above and I could imagine it’s only a different error message but the same root cause?

@texnixe Any idea on this, I wonder why something would have changed only due to the upgrade. And now I’m not entirely sure which permissions to try to fix without breaking something else.

UPDATE: The JSON response itself when being called (without data from the form, just manually) returns well and without any errors.

Found the reason for this issue and solved this one as well as the other one (here, not sure it’s an universal solution).

The server Kirby is running on has mod_security enabled by default with the OWASP configuration as part of the firewall. This causes the 403 with the Kirby Panel payload with the error message:

[Tue Dec 07 10:19:25 2021] [error] [client …] ModSecurity: Access denied with code 403 (phase 2). Match of "within %{tx.allowed_request_content_type}" against "TX:0" required. [file "/usr/local/apache2/conf/modsecurity/base_rules/modsecurity_crs_30_http_policy.conf"] [line "63"] [id "960010"] [msg "Request content type is not allowed by policy"] [data "text/plain"] [severity "WARNING"] [tag "POLICY/ENCODING_NOT_ALLOWED"] [tag "WASCTC/WASC-20"] [tag "OWASP_TOP_10/A1"] [tag "OWASP_AppSensor/EE2"] [tag "PCI/12.1"] [hostname ""] [uri "/panel/dialogs/pages/create"] [unique_id "…"]

Disabling the firewall “solves” the issue, however I think the causing problem is that JSON is being served as text/plain here? Is that an issue that could be solved via Kirby or somehow differently?
Disabling the firewall isn’t what I actually intend to do because the firewall does way more than just that. Ideas?

I have solved the issue deleting the previous languages installed and starting from scratch. But I think this could be a real issue if you update to 3.6 a whole project with more than one language?

@texnixe If you add a new language to the Raw Starterkit (I have tried with Spanish) and then try to add a new User you can reproduce the initial error. I’m using MAMP with 7.4.21.
Let me know if you need more info.

I was now able to reproduce the error, when I add Spanish as the only language. Strangely doesn’t happen when I use English, German, or French as the only language, or if there is another language besides Spanish. Can you confirm these findings, @isaactopo?

Yes, i can confirm this behaviour. Curiously, the dialog to add a new language auto-completes the fields with other languages (English, French…) but not in Spanish.

I created an issue on GitHub:

Please feel free to add your comments or any further information.

1 Like

Thanks @texnixe hopefully is easy to solve!