" Unexpected end of input" after creating a course

" Unexpected end of input" after creating a course

by Bryan Smith -
Number of replies: 4

We are geting an "Unexpected end of input" or a "JSON.parse: unexpected end of data" error after creating new courses.

 

Version 2.0.3

Average of ratings: -
In reply to Bryan Smith

Re: " Unexpected end of input" after creating a course

by Colin Fraser -
Picture of Documentation writers Picture of Testers

OK, the question I would ask first is What version? What OS? What database? What PHP? and lastly, "If it was working, what have you done recently?" These things do not just happen, something has changed. So what has changed recently? Start there and my guess would be that you will find that someone has done something that may or may not be undone easily.

If worst comes to worst, download a new copy of Moodle, the same version as you are using if you can, unzip it and replace the code of your site, one folder at a time if you want to experiment a bit. Any additional or third-party blocks or filters you use will not be affected if you do it one folder at a time. The connectionless nature of php-based apps allows you to do this relatively easily, without bringing down your entire site. You can, alternatively, overwrite every file, but be careful to not delete your config.php file - that wil do the same thing. You can also update this way if you want without going through the Git repository.  Good luck..    

In reply to Colin Fraser

Re: " Unexpected end of input" after creating a course

by Bryan Smith -

Moodle version 2.0.3

Apache/2.2.14 (Ubuntu)

MySQL client version: 5.1.41

PHP 5.3.2-1ubuntu4.9

We just recently upgraded from Moodle 1.98 to 2.0.3

The error only seems to be on the enrollment page for a course.

In reply to Bryan Smith

Re: " Unexpected end of input" after creating a course

by Stefan Nychka -

Hi.

The problem's likely with JavaScript, probably AJAX.   Try turning off AJAX in Moodle.

If this "fixes" the problem, then it is an AJAX issue.  If you can live w/o AJAX, then maybe it's a workaround.

But that of course is not a true fix, even if it "works"

Others may be able to help further, or you may notice something, with more information.  Which browser are you using, and which version?  Try using Firebug to debug.  Turning on Moodle debugging may help, too, so give that a try.  Post any info. here. Keep in mind potential security issues when you turn on Moodle debuging, especially if it's a production server.

Good luck

In reply to Stefan Nychka

Re: " Unexpected end of input" after creating a course

by Rob L -

Hi Folks,

Was there any conclusion to this?  We're seeing precisely the same issue with a shiny new moodle 2.7.1+, on CentOs 7 and apache 2.4.

When trying to view enrollments, we get a "syntax error" PHP error box.  Same behaviour with Chrome, IE10 and Firefox.  Firefox is the most helpful with the following info:

SyntaxError (dialogue box title)

JSON.parse: unexpected end of data at line 1 column 1 of the JSON data

It isn't possible to view enrolled users or to manually enroll any until this is fixed.  feel a bit hamstrung.

Many thanks!

--Rob.

Average of ratings: Useful (1)