“An unexpected error occurred” when editing+saving content, even as Admin

I’ve recently put a site online and made some changes to the content while it was online. I have come back to find that the content is no longer able to save changes to some fields — I get “An unexpected error occurred” when trying to do so.

I am stumped as to why this is all of a sudden happening. I can edit content in the Site options panel, but not in the single page which I have put together.

Did you check all points at Installation issues and Debugging from the docs?
Have you checked the permissions and the groups on your websever?

Good luck!

a broken field or some other error with the panels js? try uploading panel and fields again.

field labels might need "Hell:o" if using colon.

or broken hook could also cause this error.

For some unknown reason, I’ve come back to the issue a week later and it’s fixed itself! I honestly have no idea why, but I would be sharing a screenshot of the dialogue box otherwise. I haven’t made any changes to the site since I lodged this question, so that’s peculiar.

I had checked permissions and installation issues, but I have another occurrence of Kirby running on another web-server from the same provider with no issues. Again, it was an error that was only occurring on some back-end pages and not others.

I will come back if it occurs again. Thanks for your suggestions thus far!

I’m marking this as solved, thanks for reporting back.

Maybe it was some sort of caching problem after all.

Things you could try/check:

  • Clear the browser cache
  • re-upload the Panel folder
  • are there any empty field folders in site/fields?
  • does the error persist if you remove the plugin?
  • are you using any hooks?

Has this come up after an update or did this exist all the time? Have you made any changes to any blueprints?

Personally, I haven’t had problems with underscores or camelCase, but that may depend.

I have come across this kind of error quite a few times, usually caused by errors when developing custom fields or when something is wrong in a hook. But if you don’t use plugins or hooks, then that obviously can’t be the cause.

Have you had a chance to test the site on localhost?

I can confirm my website have this issue too. Strange thing is, when I dump my live site and install it in localhost, editing work like a charm. No error.

1 Like

@tlb maybe it’s the spamfilter

I have the same issue too my client report this after several months…

  1. I’ve have the same JS alert message
  2. I’ve got 2 console 404 errors for edit and keep
  3. This is my server error log:
[21-Sep-2017 20:11:25 UTC] PHP Stack trace:
[21-Sep-2017 20:11:25 UTC] PHP   1. {main}() /home/gieffevr/public_html/index.php:0
[21-Sep-2017 20:11:25 UTC] PHP   2. require() /home/gieffevr/public_html/index.php:6
[21-Sep-2017 20:11:25 UTC] PHP Warning:  include(): Failed opening '/home/gieffevr/public_html/kirby/vendor/autoload.php' for inclusion (include_path='.:/opt/alt/php56/usr/share/pear:/opt/alt/php56/usr/share/php') in /home/gieffevr/public_html/kirby/bootstrap.php on line 7
[21-Sep-2017 20:11:25 UTC] PHP Stack trace:
[21-Sep-2017 20:11:25 UTC] PHP   1. {main}() /home/gieffevr/public_html/index.php:0
[21-Sep-2017 20:11:25 UTC] PHP   2. require() /home/gieffevr/public_html/index.php:6
[21-Sep-2017 20:11:25 UTC] PHP Fatal error:  Call to undefined function load() in /home/gieffevr/public_html/kirby/bootstrap.php on line 10

Update 2:

Ok in my case it is happening only on the url field type when the content begins with http:// or https:// it gives me an error and it breaks save state completely…

Same problem for me on my live environment, localhost works fine. I tried to update to Kirby 2.5.7 but the error is still there. I don’t have any plugins or hooks.

The Console in Chrome Dev Tools give me

Uncaught SyntaxError: Unexpected token <

from js?v=2.5.7:1

The content of the file if I click on it in Dev Tool is:

A file which looks in the dev tools to exist at panel/plugins/js?v=2.5.7 but that file does not exist and what is it?

I’m experiencing the same issue, with a current client. The site has been up and running fine for a few months. Then today we received a call from the client, stating that they were being unable to update some of the information on the site.

The client has multiple locations, so we setup a structure field, where the client can copy+paste google map ‘embed’ code, which then gets displayed on the site. Should be pretty simple - and it has been working fine so far. The client had accidentally deleted the google embed code, and was trying to copy+paste them back into the structure field - but it wouldn’t let him… Here is what happens:

In Safari’s console, we get the following error:

I’m guessing that the Panel is trying to update info via AJAX, and it’s failing because of some kind of server configuration.

I’ve downloaded a complete copy of the client’s site to my local computer, and also uploaded it to our staging server. Both on my local computer AND on the staging server the site works flawlessly - I can save the google embed code without any errors.

I then tried comparing the PHP setup on the client’s production server, and on our staging server - there doesn’t seem to be any disparity between PHP extensions or options.

Everything seems to point out to a server issue, but it would be easier to convince the client if we actually knew what the issue was… :frowning:

Any solution found for this bug ? My client reports it to me from time to time.
It’s often due to just one word in the texte, when I replace this word, I’m able to update the page.

I’ve created an issue on GitHub: https://github.com/getkirby/panel/issues/1150

1 Like

@luxlogica @gillesvauvarin Could you please post your PHP error log? The error message itself could point to anything as it’s not thrown by Kirby itself.

Unfortunately, I don’t have access to my customer web server but I will send him an email to know if he can send me its php error log

By the way, if you don’t want to post the logs publically, you can also send them to me via email at lukas@.