Invalid JSON String Error

Invalid JSON String Error

by Karen Marshall -
Number of replies: 9

We just installed Moodle version 2.1.  I backed up a course from our Moodle 1.9 server and saved it to my computer.  When I log in to Moodle 2.1 and try and do a restore (so that I can move the course to Moodle 2.1) I get the following error below.  I was able to upload a word document to my private files without any error.  Have tried to change settings on file size upload but still getting the same error message.  Any help is appreciated!

 

ERROR: Invalid JSON string

Server Error

 
  404 - File or directory not found.
  The resource you are looking for might have been removed, 
had its name changed, or is temporarily unavailable.
 

Thanks so much,

Karen

 

Average of ratings: -
In reply to Karen Marshall

Re: Invalid JSON String Error

by Melinda Kraft -

When this happened to me it was a very large file I was trying to upload into the site. I suspect a combination of my bandwidth (I was off campus) and/or settings in my php.ini that limit the size of the upload and/or timeouts on the mysql server connection.  Check your php.ini for post_max_size and upload_max_filesize and make sure they are large enough to accomdate the file you are uploading (set them to the same value)

Also related to 1.9 restores, if the 1.9  is very old (2008) that can cause problems, too. We have a current 1.9.13 install we use only for restoring older course webs and creating a new backup file to import into 2.1.

Good luck!

In reply to Melinda Kraft

Re: Invalid JSON String Error

by Karen Marshall -

Thanks Melinda - we did try to change the php.ini to accomadate the file size.  Do you know exactly where that is located?  I'll check it again.  

I'm not quite sure what you mean by the 1.9 being very old.  I do think our server is 1.9.13. I just did a backup this morning of the course I wanted from our older Moodle server.  But I'll check all this out again.

Thanks again

In reply to Karen Marshall

Re: Invalid JSON String Error

by Melinda Kraft -

In regards to "old" - I was referring to the age of the archive. We archive everything for our faculty as a service. Sometimes they will request us to restore an older 1.9 site and that's where we had challenges and use the 1.9.13 install to create a fresh backup.

Regarding your php.ini, in your Moodle install, you can go into Site Admin, Server, PhpInfo and it will tell you the settings. Just do a ctrl-F to search for the post and file size settings and it will tell you right there what they are set for.

In reply to Melinda Kraft

Re: Invalid JSON String Error

by Karen Marshall -
Thanks again Melinda for responding - I checked with our tech director and he said he increased the file size. I also tried to upload a smaller video and got the same error. The only thing I was able to upload was a word doc. I think he is just going to try and rebuild the server. I'll have to wait and see what happens. Thanks again Karen
In reply to Karen Marshall

Re: Invalid JSON String Error

by Melinda Kraft -

Oddly, when I got that error it was when uploading a video file from off site. It had an m4v extension. When I tried again onsite it went fine. As I think about it, my adverture might have been related to systems backups going off (not Moodle backups, but server backups).  Whatever video you are uploading, see if you can upload one with a different file extension. Also have your sysAdmin check server mime-types. Maybe there's something configured server side that is causing problems. You could also try downloading and installing the Windows or Mac standalone Moodle install to your desktop and running that to try and replicate the problem. It's a self contained Apache server that will run Moodle for you and is available on the main downloads page. It might prove helpful in comapring some server settings, too.

Good luck!

In reply to Karen Marshall

Re: Invalid JSON String Error

by Marcus Sugden -

Hi

I found I was having the same issues when tryini got add a folder. Managed to solve it though!


It was actually to do with Apache's Mod Security. Sepcifically the pattern match of "mkdir" which is what your trying to when adding folders/restores

You can comment out this pattern match in: /usr/local/apache/conf/modsec2.user.conf

It's line 212 you need to comment out ("mkdir\\x20")


Resart Apache after that and now it works smile

 

 

 

In reply to Karen Marshall

Re: Invalid JSON String Error

by Jessica Cornelius -

I have parents complaining of getting this error at home when trying to open the files. Anyone know why?