Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Internal Server Error (500) with UploadField


Go to End


17 Posts   10052 Views

Avatar
goe

Community Member, 5 Posts

6 January 2014 at 6:56am

Hi,
I have added a Team Page like the Stuff page in the Tutorial.
Offline this works great but online on uberspace i get an internal server error every time i try to switch between pages in the admin panel. Accessing the same page direct works without a problem.

The Code: https://gist.github.com/glektrik/8b8f455a6892f19fb5e7
Screenshot: https://www.dropbox.com/s/rsnipt2siwl7dw2/Screenshot%202014-01-05%2017.59.47.png
The failed ajax request: https://www.dropbox.com/s/p68y361i5d6ygcu/Screenshot%202014-01-05%2018.00.59.png

I enabled the dev mode and php error logging but no errors get logged, my Apache error_log is also empty.

I made a clean install and only added the TeamPage.php file.
When i comment out the line with new UploadField everything works.

Avatar
martimiz

Forum Moderator, 1391 Posts

6 January 2014 at 11:15pm

I don't see anything wrong with your code. Sometimes the FireBug extension in FireFox can give a better clue of what is going on.

Avatar
swaiba

Forum Moderator, 1899 Posts

7 January 2014 at 1:14am

Server Error 500 = some php error

turn on dev mode and then you will get the actual PHP error and that is the only relevant information to help solve your problem

Avatar
martimiz

Forum Moderator, 1391 Posts

7 January 2014 at 2:29am

@swaiba - dev mode is said to be turned on already :)

Avatar
swaiba

Forum Moderator, 1899 Posts

7 January 2014 at 2:45am

@martimiz - then why is the ticket "500" error - if dev mode is on where is the stack trace?

@goe - if you use chrome please open the dev tools, switch to the "network" tab and then see the response if that syas "500 error" then dev mode is not on

Avatar
goe

Community Member, 5 Posts

7 January 2014 at 7:58am

Edited: 07/01/2014 8:07am

I've added this lines to my _config.php file so i assume i am in devmode.

ini_set('display_errors', 1);
error_reporting(E_ALL);
Director::set_environment_type('dev');
SS_Log::add_writer(new SS_LogFileWriter('/home/imdsite/errorlogs/ss_warn_log'), SS_Log::WARN, '<=');

I've also tried appending ?dev=1 to the URL with the same result.
There are no apache or php error logs written so i thinks its not an php error.

This is a Screenshot from the Networks Tab in Chrome:
https://www.dropbox.com/s/zgh4o0ijr1jqu2a/Screenshot%202014-01-06%2020.06.44.png

Now i get the same error in safari two. For me this seems to be something timing related.

Avatar
martimiz

Forum Moderator, 1391 Posts

7 January 2014 at 8:52am

@Swaiba: sometimes SilverStripe will report a 500 error on an Ajax requests in the CMS. The link in FireBug will also say 500 error, but often you can find the actual error in the response section of the request, if dev mode is set. I don't know why such an error wouldn't be logged though. A 500 error would also be logged, would it? I don't usually have to check the logs...

@goe: sorry I can't be of more help... I would try FireBug though :)

Avatar
goe

Community Member, 5 Posts

7 January 2014 at 9:30am

After updating my Firefox i get the same error there two.
Thanks for the Firebug tip, this is the Response:

An internal server error occurred. Please try again later.

Go to Top