Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Help! Uploading Asset and Saving Entry Returns Page Not Found and Entry is Lost #4976
My client recently noticed that when an asset is uploaded during the creation of an entry, and when the entry is saved a Page Not Found Error appears. Also the entry is completely lost. I've been able to confirm this, it happens every time.
Obviously this is extremely frustrating for my client, and it seems to be system wide (not limited to one section or content type).
@jonlongnecker Just briefly tested this on 22.214.171.124, and couldn't reproduce. I wonder if this is specific to something with your install. I would contact support ASAP if this is a priority, as this may be not a bug with Craft itself (or if so, specific to something in your environment).
This has also happened on our environment as well, on both our local environment and production environment. (Only saving entry, haven't able to reproduce the asset uploading)
Also Entry save successfully if some required field is missing and returns to content entry screen and try to save while spinner is spinning.
Not sure if this issue applies to Singles, as Entry is already created when adding / editing content.
Our Environments are:
Below is Yii Error log from my local environment when this has happened while saving new Channel entry.
@ryotadialpad I've been working with Craft support on this via email, and we tracked down the issue to the fact that I was forcing trailing slashes via the NGNIX config on the live server for legacy SEO links. That trailing slash was causing certain URL's in the panel not to resolve correctly.
Currently testing this solution and it seems to be working so far: https://craftcms.stackexchange.com/questions/23870/trailing-slashes-with-nginx-and-craft
Not sure if you're forcing trailing slashes, too - but that's where I'm at. Also, I am using @khalwat 's NGINX Craft Scripts as my config base.
I agree something changed recently in the code that made this stop working, just not sure what.
@jonlongnecker thanks for the update and quick reply.
We are forcing trailing slash as well and that stack exchange answer you mentioned is solution we're using at the moment.
I think there's issue with AJAX saving with trailing slash URLs.
Had trouble with AJAX saving on one of the plugins (Translations plugin) which used AJAX to save certain thing and trailing slash was the cause of the issue (I think between extra redirect it lost data? not exactly sure why redirect to trailing slash would cause it, but removing that redicrect solved the issue).
I believe AJAX saving is issue since Craft added draft auto saving (via AJAX) recently?
Another weird thing is, it doesn't happen all the time... only on certain occasions to someone else, and not the devs...
@ryotadialpad interesting. For us, it wasn't that Assets weren't working, it was that uploading an asset and then saving a new entry broke the entry. The asset still uploaded just fine.
I was also seeing an error when trying to change a related entry field. Saving the entry would default back to the previously saved related entry. So I think you're on to something with the AJAX thing because the Assets window and related entry window both use AJAX.
I noticed, too - especially for the related entry thing that it wasn't consistent. Sometimes the save would work, and sometimes it wouldn't.