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


#1

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.


HTTP 403 error without plugins
#2

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!


#3

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.


#4

or broken hook could also cause this error.


#5

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!


#6

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

Maybe it was some sort of caching problem after all.


#7

Hi all,

I’m experiencing the same issue when trying to save panel edits on my self hosted site. I’m running Apache 2.4.18 on Ubuntu 16.04.2. There seems to be no logic to which pages aren’t saving. The debug info is very poor, it gives no indication of why. Looking at the browser console it gives me a 403 error.

  • The only plugin installed is detect.
  • The site isn’t stored in a subdirectory.
  • I’ve set the owner of the entire /var/www/html/ directory to the apache user www-data.
  • I’ve re-installed the default .htaccess
  • I’ve checked apache2 config
  • I’ve set permissions to 775 using sudo chmod -R etc

Below is a screenshot of the permissions of some of the directories and files affected.

Any help would be appreciated.


#8

In addition, here is a screenshot of the panel error (I could only upload one image per post).


#9

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?

#10

Hi, thanks for the advice.

  • I’ve cleared the browser cache to no effect.
    • The issue’s been reported across several devices. So I think browser cache is unlikely.
  • I’ve reuploaded the panel folder with a fresh one from Github.
  • The site doesn’t use any hooks
  • The error does persist if I remove the plugin.

The only item on that list that I can’t check is the site/fields directory. That directory doesn’t exist on the site, and apparently never has. For reference, I didn’t code the site, I’ve just taken over back-end management.


#11

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


#12

I’m clarifying with the developers and editors whether they’ve made any recent changes, but this isn’t a Kirby update, the installation is a fresh copy of the latest Kirby, uploaded about a month ago.

I haven’t made any changes to the developers’ original blueprints, I’m taking a look through them now to check if there’s any mistakes. Though I’m reading comments that hyphens, underscores, and even camelCase can cause problems with blueprint files.


#13

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?


Unexpected error after update
#14
  1. I’ve installed a fresh Kirby Plainkit on my staging server, a Raspbian Raspberry Pi running Apache 2.4.10 with PHP 5.6.30.
  2. I copied over the the content, assets, and site directories as well as the .htaccess from the production site backups.
  3. It turns out some files had been manually added that conflicted with existing filenames.
  • I removed and renamed the files and set permissions etc.
  1. I tested the panel on the staging server - everything works.
  2. I wiped the live production site
  3. I completely copied over the staging directory to the production site.
  • Set permissions etc.

The production site remains broken.

I can open the same edit pages on my staging server and my production server and attempt to make the same edits and it works on the staging while refusing to on the production.

I’m starting to think it’s server user permissions, but as I’m running both sites as the www-data user with the same 775 permissions I can’t see why this isn’t working in production. The only difference is the production uses PHP 7.0.15. Could it be this?


#15

Just for reference, the issue remains undiagnosed. My solution was to completely wipe the public directory and reinstall everything from backups.


#16

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.


#17

@tlb maybe it’s the spamfilter


#18

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

#19

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…


#20

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:
<?php

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?