-
Notifications
You must be signed in to change notification settings - Fork 642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.x]: Axios call to /actions/matrix/create-entry failing with 400 #14618
Comments
|
That hasn't resolved the issue. Attaching a zip of In my local logs, I can see that the request body to
However when deployed to the Krystal host, the
The remote server is using Linux 4.18.0-477.21.1.lve.1.el8.x86_64 where as DDEV is locally using Linux 6.6.16-linuxkit if that could make a difference. Very much appreciate that this could be a hosting provider rather than a Craft CMS issue - but thought it was enough of a quirk to raise. |
|
Which environment is having the issue, Krystal? What are the PHP versions being used on each of those environments? |
Also, I take back that this is the same bug fixed in 5.0.0-beta.9. That had nothing to do with |
I think the fact that Can you make sure that the full |
OK good to know.
Everything looks correct to me. On the deployed example at ![]() Wondering whether there could be any kind of security protocol enforced by the host that, for whatever reason, has a problem with that one specific ajax request. I might spin up a fresh Krystal host package and see if I can replicate it elsewhere. I would just abandon Krystal and look at hosting the site elsewhere, except the client has an existing Krystal plan and wants to host there. |
Is there any chance we can get access to the server? If so you can send access credentials over to [email protected]. |
Absolutely, I've emailed over some credentials. |
I think I've figured it out. I deployed my little test install to another server that we have with Krystal and it worked as expected. So I then went through and compared the various configurations between the two boxes and noticed that in cPanel's 'PHP Selector' area, the host that was working was using the extension Out of my depth, but a quick google suggests that the Interestingly that GUI in cPanel has a big 'reset to default' button above the extension configurations, which will default back to using Might be an edge case, but that was 100% what the issue was. If I switch back to using |
Ah interesting! We’ll see if we can reproduce and whether there’s anything we can do about it. |
@jonnykates thank you for posting your solution! I've been tearing my hair out trying to fix this issue – also on Krystal hosting – and I can confirm that switching to |
Also just hit this issue (using Krystal). Thanks for the fix! |
Thanks so much for posting this solution - just had the same issue (not on krystal servers) - changed to |
I can confirm this issue. The environment was a cPanel/Cloudlinux server with pdo_mysql enabled. Switching to nd_pdo_mysql fixes the error. |
Not as a way to pile on, but to add info for others facing this : I had this with whc.ca's hosting and going in the PHP version's extensions and switch to nd_pdo_mysql instead of pdo_mysql did the trick. |
Can we get the docs updated to reflect this requirement? @brandonkelly |
I’ve been running Craft 5 with pdo_mysql locally without this issue, so I’m not sure it’s as simple as that. Maybe there’s a particular buggy version of pdo_mysql? |
I’m still unable to reproduce this even when explicitly typecasting The change was made for Craft 5.1. It would be great if any of you could give it a test with pdo_mysql installed, and see if it works. To test, change your |
Craft 5.1 is out with that fix. |
Just a warning: we've upgraded to 5.1 and not only is the issue not fixed, but it seems that any content with inline-editable Matrix fields is now throwing errors across our site. Lots of We're basically no longer able to access these entries at all. Even attempting to perform a database backup is throwing an internal server error. EDIT: Just to say if you are also in this situation, changing those Matrix fields to card view seems to remove the errors. We're tried with both EDIT: Okay, not quite so simple 😅 Reverting to card Matrix blocks has allowed us to access specific entries again, but we still cannot export database backups or make any edits to those entries. New entries seem possible to make, though we're running into caveats there as well. FINAL EDIT: Just to say that I've just rolled us back to 5.0.6 and all of the issues have gone away. We'll do some more testing locally as and when we can, but for now we're considering the 5.1 upgrade incompatible with something (our host? our field config?). What I can say in the interim is that the original issue raised in this post did not appear to be fixed. Before rolling back, we were able to create new content entries that included inline editable fields (obviously without any content). Switching back to |
Sorry, as I said it was a shot in the dark, as we’re unable to reproduce. I’m guessing whatever the underlying issue is, the 5.1 change is just exacerbating it further. The And the backup issue is also unrelated, and fixed for the next release (#14928). Could you write into [email protected] with server credentials, so we can dive in and see what’s going on? |
Okay, we've spent some time debugging and have now upgraded to 5.1.1. @brandonkelly was correct in that none of the new issues were related to this bug ticket. For anyone wondering:
Now that those are all cleared, we've confirmed that the issue with I'll see about providing direct access to the server, not sure how comfortable I feel about that. If there are any other logs or files, I should now have time to submit those, though, next week. |
It may not look like much, but this is a €150 commit.
Someone sent in server creds and we finally got to the bottom of this! I was on the right track with 74dc2ab after all, but there was a minor bug in the commit that prevented it from actually helping in this case. So it’s now fixed for the next release. If you’re experiencing this and want to get the fix early, change your |
Craft 5.1.6 is out now with that fix. Thanks everyone! |
What happened?
Description
Attempting to add a Matrix 'block' to an entry is resulting in an Axios call to
/actions/matrix/create-entry
failing with a 400 error, with the message 'Invalid Matrix field ID: x'. This is only causing an issue when I deploy the site to a hosting plan with shared host Krystal.uk - I'm unable to recreate locally with DDEV. This would obviously suggest that there is some kind of dependency or security shortcoming on the Krystal server, but the payload to the endpoint also potentially suggests that the Matrix field ID is perhaps being sent as a string rather than an int (see Craft web log output below).Steps to reproduce
To speed run seeing the error first hand, you can;
https://craft5matrixbug.jonnykates.com/admin/
with usernameadmin
and passwordpassword123
.You can clone the Craft config deployed above here. As I say, I can't recreate it locally; but I'm stumped. Obviously you can see the Craft system report page here and I can put that environment into allow admin changes if needed.
Expected behavior
An empty instance of the matrix block/field should be populated into the editor.
Actual behavior
The block doesn't appear.
Craft web log
Craft CMS version
Craft Solo 5.0.0-beta.9
PHP version
8.2.16
Operating system and version
Linux 4.18.0-477.21.1.lve.1.el8.x86_64
Database type and version
MariaDB 10.6.17
Image driver and version
Imagick 3.7.0 (ImageMagick 7.1.1-19)
Installed plugins and versions
The text was updated successfully, but these errors were encountered: