Error decoding JSON data: Syntax error after update to 3.6.3

Need help upgrading your Joomla! website or converting to Joomla! 3.x? Please consider the availability of third-party templates and extensions when deciding which Joomla version to use.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
User avatar
ausnets
Joomla! Intern
Joomla! Intern
Posts: 59
Joined: Fri Jun 29, 2007 12:28 am
Location: Queensland, Australia
Contact:

Re: Error decoding JSON data: Syntax error after update to 3.6.3

Postby ausnets » Thu Mar 09, 2017 2:49 am

Rob Went, I salute you.
To others, here's what fixed it for me.

1. Stay Calm.Remember you have a backup as a last resort (you DO have a backup right ?)
2. Upload Rob's script (not the zip file, just json-db-check.php) to your site's public_html directory.
3. In a browser go to www.yoursite.com/json-db-check.php
4. It will auto-fix a load of db errors for you.
5. If your site is still broken, click the blue button to do a full check.
6. Now you'll see a list of tables, one or more may have 'not valid JSON' code reported, our site had this:
Checking table: xyz_extensions, column params
Row 11 is not valid JSON. Error: (Syntax error)
Content: {"administrator":"\"en-GB\"","site":"\"en-GB\""}

7. Via cPanel use phpAdmin (or find someone confident to do so). Our error was in line 11 (com_languages) so we clicked Edit on that line.
8. Once it's open for editing, scroll down to the params field. Note exactly what is there so you can add it back in if required.
9. There is advice here about copy / pasting whatever is in params to a JSON validator like jsonlint.com. Our code returned as valid. <shrugs> So we just removed everything except the { } open & close braces.
10. Scroll down and press Go.

That resolved our issues, both site & admin now ok.

I-MAG
Joomla! Guru
Joomla! Guru
Posts: 953
Joined: Sat Oct 14, 2006 5:25 pm
Location: Kuwait

Re: Error decoding JSON data: Syntax error after update to 3.6.3

Postby I-MAG » Sun May 21, 2017 3:04 pm

I've been having this issue with my sites. I managed to overcome it by uploading the "Libraries" folder from an old version of Joomla.
But now with Joomla 3.7 out, I'm not sure what to do.
I tried to update one of the site, and this trick did not work! So I had to revert to an old backup that I had.

Any help will be appreciated.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 24302
Joined: Mon Oct 27, 2008 9:27 pm
Location: Akershus, Norway

Re: Error decoding JSON data: Syntax error after update to 3.6.3

Postby Per Yngve Berg » Sun May 21, 2017 7:34 pm

You have to fix the corrupted JSON data in your database.

I-MAG
Joomla! Guru
Joomla! Guru
Posts: 953
Joined: Sat Oct 14, 2006 5:25 pm
Location: Kuwait

Re: Error decoding JSON data: Syntax error after update to 3.6.3

Postby I-MAG » Tue May 23, 2017 1:09 pm

Per Yngve Berg wrote:You have to fix the corrupted JSON data in your database.

It worked. Many thanks. :)

wild_horse
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sun May 21, 2017 9:11 pm

Re: Error decoding JSON data: Syntax error after update to 3.6.3

Postby wild_horse » Wed May 24, 2017 8:28 pm

How do you go about fixing the corrupted JSON data in a database? You mention a script but not where I can locate it at.

User avatar
ausnets
Joomla! Intern
Joomla! Intern
Posts: 59
Joined: Fri Jun 29, 2007 12:28 am
Location: Queensland, Australia
Contact:

Re: Error decoding JSON data: Syntax error after update to 3.6.3

Postby ausnets » Wed May 24, 2017 10:09 pm

Just look for robwent's posts, previous page of this thread.

Aniceplace
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Tue Oct 18, 2016 8:14 pm

Re: Error decoding JSON data: Syntax error after update to 3.6.3

Postby Aniceplace » Wed May 24, 2017 10:22 pm

In the end my fix for this was to disable the ComBrite plugin

Evopro
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Tue Jan 03, 2012 9:53 am

Re: Error decoding JSON data: Syntax error after update to 3.6.3

Postby Evopro » Fri Jun 30, 2017 4:47 am

First of all, thanks to Robert Went for offering the script we all can use to troubleshoot this! Then thanks to all others that offers help. Many who use Joomla are not trained in PHP and find issue like these absolutely impossible to deal with.

We run two sites on Joomla 3.7.2, PHP 7.0.20 and MySQLi 5.5.5-10.1.24-MariaDB. We have updated both consistently since they were built and only now we discover this issue. Whenever trying to save a change or a new module/article or attempt navigating to Global Configuration we get the "Error decoding JSON data: Syntax error".

I have spent a day researching this issue and have now used the https://github.com/robwent/joomla-json-db-check script. It did not find any empty spaces to start with but reported a series of one type of error and one instance of another. Since I am not trained in PHP, even when looking at the code in https://jsonlint.com I still cannot understand what is wrong with it.

I am posting the code here asking for help to find out what is wrong with it.

The first error shown is in _acymailing_mail:

Code: Select all

Row 5 is not valid JSON. Error: (Syntax error)
Content: a:3:{s:6:"action";s:7:"confirm";s:13:"actionbtntext";s:28:"{trans:CONFIRM_SUBSCRIPTION}";s:9:"actionurl";s:19:"{confirm}{/confirm}";}


Next comes 54 errors that all look to be very similar:

Code: Select all

Row 77 is not valid JSON. Error: (Syntax error)
Content: a:3:{s:6:"action";s:4:"none";s:13:"actionbtntext";s:0:"";s:9:"actionurl";s:0:"";}


The second one is shown in _extensions:

Code: Select all

Row 23 is not valid JSON. Error: (Syntax error)
Content: {"filters":{"1":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"9":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"6":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"7":{"filter_type":"NONE","filter_tags":"","filter_attributes":""},"2":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"3":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"4":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"5":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"8":{"filter_type":"NONE","filter_tags":"","filter_attributes":""}},}},}}}


If anyone could point out what needs to be corrected, I would be very grateful.

I do not like to run into things like this on live sites which runs web shops - every downtime means we lose money. This issue only shows in the admin area but stops us from making needed development. As much as things like these are dreadful with Joomla, I do appreciate the higher level of error checking as it improves the platform as such.

So please, if anyone can point out what is wrong with the syntax in these examples...

Best Regards
Johan Niklasson

JDevOnline
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Sat Aug 29, 2009 8:47 pm

Re: Error decoding JSON data: Syntax error after update to 3.6.3

Postby JDevOnline » Sun Jan 07, 2018 4:27 pm

I downloaded the current version of Joomla, 3.8.3 and created a category and few articles in the content module. The error started appearing when I try to edit the article imported from joomla content to K2. However, when I created an item in K2 and then tried to edit it, it worked fine. But still I am unable to edit those imported from Joomla content component to K2.
You do not have the required permissions to view the files attached to this post.

bggann
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed Apr 28, 2010 12:11 am

Re: Error decoding JSON data: Syntax error after update to 3.6.3

Postby bggann » Wed Feb 14, 2018 3:26 pm

This error occurred on one of my sites recently. I wanted to share the results here to validate the fine work by robwent.

I was getting a JSON error when trying to access site configuration.

Ran json-db-check per instructions.

It fixed a number of errors, but the problem was not resolved.

Ran the advanced analysis and found a params value in com_config that was bad.
The value stored was:
{"filters":{"1":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"9":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"6":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"7":{"filter_type":"NONE","filter_tags":"","filter_attributes":""},"2":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"3":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"4":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"5":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"8":{"filter_type":"NONE","filter_tags":"","filter_attributes":""}},}},}},}}}

Notice the structure at the end }},}},}},}}}
The last valid } was the 3rd one. In addition there was an extra ','
Revised to:
{"filters":{"1":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"9":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"6":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"7":{"filter_type":"NONE","filter_tags":"","filter_attributes":""},"2":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"3":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"4":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"5":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"8":{"filter_type":"NONE","filter_tags":"","filter_attributes":""}}}

and the site is repaired.

While I understand the update that caused this and that strict JSON enforcement makes sense, I would suggest better error messages. With this particular com_config error, I could not even turn on debugging to find the problem. Without the json-db-check program, I would have been in a bad way.

User avatar
modernmagic
Joomla! Explorer
Joomla! Explorer
Posts: 323
Joined: Mon Aug 10, 2009 3:58 pm
Location: Laguna Beach
Contact:

Re: Error decoding JSON data: Syntax error after update to 3.6.3

Postby modernmagic » Mon May 14, 2018 6:56 pm

I found another way to resolve the issue even though it was unrelated to j2store: https://www.j2store.org/support/user-gu ... -data.html

In my case it was a trashed article that has a json error.
Joomla! Website Designer http://www.modernmagic.com
Joomla! User Group Leadership Team http://www.ocjoomlausergroup.org/


Return to “Migrating and Upgrading to Joomla! 3.x”

Who is online

Users browsing this forum: No registered users and 6 guests