Page 1 of 6

Error decoding JSON data: Syntax error after update to 3.6.3

Posted: Tue Oct 18, 2016 4:38 pm
by CatfishPKR
I have updated a couple of sites, and one site is now showing Error decoding JSON data: Syntax error in the backend, frontend says: Error displaying the error page: Error decoding JSON data: Syntax error: Error decoding JSON data: Syntax error

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

Posted: Tue Oct 18, 2016 6:47 pm
by cybersholt
getting the same thing myself, here's a stack trace.

Code: Select all

An error has occurred.
 0 Error decoding JSON data: Syntax error
Call stack
#	Function	Location
1	JApplicationCms->execute()	/var/www/html/administrator/index.php:51
2	JApplicationAdministrator->doExecute()	/var/www/html/libraries/cms/application/cms.php:261
3	JApplicationAdministrator->dispatch()	/var/www/html/libraries/cms/application/administrator.php:152
4	JComponentHelper::renderComponent()	/var/www/html/libraries/cms/application/administrator.php:98
5	JComponentHelper::executeComponent()	/var/www/html/libraries/cms/component/helper.php:380
6	require_once()	/var/www/html/libraries/cms/component/helper.php:405
7	JControllerLegacy->execute()	/var/www/html/administrator/components/com_login/login.php:22
8	LoginController->display()	/var/www/html/libraries/legacy/controller/legacy.php:702
9	JControllerLegacy->display()	/var/www/html/administrator/components/com_login/controller.php:45
10	JViewLegacy->display()	/var/www/html/libraries/legacy/controller/legacy.php:664
11	JViewLegacy->loadTemplate()	/var/www/html/libraries/legacy/view/legacy.php:216
12	include()	/var/www/html/libraries/legacy/view/legacy.php:677
13	JModuleHelper::renderModule()	/var/www/html/administrator/components/com_login/views/login/tmpl/default.php:20
14	Joomla\Registry\Registry->loadString()	/var/www/html/libraries/cms/module/helper.php:170
15	Joomla\Registry\Format\Json->stringToObject()	/var/www/html/libraries/vendor/joomla/registry/src/Registry.php:366
Figured before someone mentions using forum post assistant, currently have no admin access to this one's admin section but it's a clone of another running instance.


OS: Centos 7
PHP 7.0.9
MySQLi 5.7.14
Joomla: 3.6.3

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

Posted: Tue Oct 18, 2016 7:10 pm
by cybersholt
@CatfishPKR if you need a quick fix to get back in, download the 3.6.2 full package, unzip and upload contents to server.

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

Posted: Tue Oct 18, 2016 7:15 pm
by mbabker
Your issue there is whatever column is trying to be processed by the Registry class has malformed JSON syntax. We found that to be an issue with some of the sample data and implemented a check in core in the place that directly affected. That path though isn't one that's affected.

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

Posted: Tue Oct 18, 2016 8:00 pm
by gigatech
i have the exact same problem ,i only have this error in the backend using k2, for now is there a fix beside downgrading (3.6.3 contains security fixes so....) :'(

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

Posted: Tue Oct 18, 2016 8:19 pm
by Aniceplace
Have the same problem here, but in the front end of the main site, which is now dead.
I have access to the admin area.

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

Posted: Tue Oct 18, 2016 8:23 pm
by PhilTaylor-Prazgod

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

Posted: Tue Oct 18, 2016 8:53 pm
by pesu_swe
I have a similar problem after upgrade from 3.6.2 to 3.6.3.
I can't edit any of my modules after upgrade. I also got a JSON error. My problem occurs only in backend. I have no problem in frontend.
I run all my sites with PHP 7.0.10.

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

Posted: Wed Oct 19, 2016 2:10 am
by infidean
Same problem here

Disabling the JB Library plugin brought my site back up, but I don't think that is a fix.

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

Posted: Wed Oct 19, 2016 6:28 am
by high123456789
same here from 3.6.2 to 3.6.3

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

Posted: Wed Oct 19, 2016 7:57 am
by Per Yngve Berg
Upgrade php. There is a bug in 7.0.9

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

Posted: Wed Oct 19, 2016 8:42 am
by muskbh
Hi
Can any of you explain in details how to fix this problem with backend error:

Error decoding JSON data: object property name separator ':' expected

I get a little confused reading the answers in this thread - and me being a novice need a what to do list to sort this out.
I would appreciate it a lot.

/Kasper

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

Posted: Wed Oct 19, 2016 9:55 am
by muskbh
I solved it for now.
I copied the library folder from joomla 3.6.2, overwriting the one from 3.6.3
/kasper

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

Posted: Wed Oct 19, 2016 2:09 pm
by rswebmaster
muskbh wrote:I solved it for now.
I copied the library folder from joomla 3.6.2, overwriting the one from 3.6.3
/kasper
have you done this with a copy of your backup ore the map library from a new joomla installation? i have try several library maps and no one is with succes. i'll hope someone will find quick a solution ore a fix. greatings from the netherlands

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

Posted: Wed Oct 19, 2016 2:12 pm
by Marijke
@rswebmaster I downloaded a clean 3.6.2. joomla package from: https://www.joomla.org/announcements/re ... eased.html
Then I took the library/vendor files and copied them over the broken 3.6.3. library/vendor files. This worked like a charm for me...

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

Posted: Wed Oct 19, 2016 3:01 pm
by tapiochre
@rswebmaster

I also did as @marijke described and all was well. I renamed the /libraries/vendor folder to /libraries/_vendor before copying in the /libraries/vendor folder from the 3.6.2 Stable Fill Package found here:

https://github.com/joomla/joomla-cms/releases/tag/3.6.2

Hope this helps but I sure won't be upgrading to 3.6.3 anytime soon!

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

Posted: Wed Oct 19, 2016 3:08 pm
by mbabker
Please do not spread misinformation that the libraries/vendor directory contains broken code in 3.6.3. It doesn't.

The issue that is being run into is that an additional error check was added to the JSON formatter in the Registry API. So specifically what is the common issue here is that data sources which are supposed to contain valid JSON formatted data do not. This added error check looks to see if there was an error converting the string it was given (which is supposed to be valid JSON) into an object readable by the PHP code, and if there was an error with that process it throws an Exception indicating the error.

The common culprit I'm seeing for this is reading data from either the extensions or modules database tables. Both of them have `params` columns which have data stored in JSON format. To hit the line that tries to decode the JSON string to an object, the column has to have either a "{" as its first character or a "}" as its last character. If the column has a null or empty value, it won't reach this line.

Basically what this is indicating is there is improperly structured data being given into the API to decode and the API hits an error with it (correctly so). What changed between 3.6.2 and 3.6.3 is that the error was silently ignored.

Sorry for the highly technical explanation before this point, but there's really no other way to get around that.

As for the fact that things work if you restore the 3.6.2 version of this directory, what it was doing there was basically receiving a null or false return value versus the decoded data object. So ultimately the data that the code was looking for isn't actually getting loaded into memory. Now in a lot of places this really isn't an issue because the PHP code will use sensible default values when this data doesn't exist. It does become an issue if you've customized parameter values though and will cause your custom values to not be used.

Long and short, restoring the 3.6.2 code "works", but it's not addressing the underlying issue of invalid data being fed into the code to be processed. How that data got there, I can't say, I can just diagnose the symptoms.

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

Posted: Wed Oct 19, 2016 3:19 pm
by cybersholt
Thanks for the info mbaker, I plan on debugging this before the end of week, in an effort to help. Would it be best to post which component, module, plugin etc... is the issue here or on github?

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

Posted: Wed Oct 19, 2016 3:24 pm
by Marijke
Thanks for your thourough information mbabker. I have no idea what to do now. Maybe we'll revert the site with a backup to 3.6.2. Hopefully someone will find the needle in the haystack so we can all smell the flowers again...

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

Posted: Wed Oct 19, 2016 4:05 pm
by Per Yngve Berg
Unpublish modules and pluhins one by one until the error goes away. Then you know which one is causing it. Examine the params field.

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

Posted: Wed Oct 19, 2016 8:00 pm
by Buldre
I disabled the Ā«Akeeba Backup Notification ModuleĀ» version 3.4.3, and then everything worked as normal. Said module is probably an outdated module, which not were deleted when I updated to a new version.

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

Posted: Wed Oct 19, 2016 9:56 pm
by ibrentlam
The error is pulled in the file:
/libraries/vendor/joomla/registry/src/Format/Json.php
line 72
I changed it to:
throw new \RuntimeException(sprintf('Error decoding JSON data: %s the bad data is: %s', json_last_error_msg(), $data));

so I could actually see the data.
what I saw was:
Error decoding JSON data: object property name separator ':' expected the bad data is: {""}
ok, so it looks like the bad data is {""}. Is this really invalid JSON? I checked via:
http://jsonlint.com/#
and it sure enough is. Valid would be something like:
{
"": ""
}
So off to find the culprit.
Did a sql query on extensions and came up dry, then:
select id, title, module, params from efzkh_modules where params like '%{""}%';
+----+---------------+-------------------+--------+
| id | title | module | params |
+----+---------------+-------------------+--------+
| 2 | Login | mod_login | {""} |
| 5 | Menu Stats | mod_stats | {""} |
| 11 | Footer | mod_footer | {""} |
| 14 | User Status | mod_status | {""} |
| 26 | Related Items | mod_related_items | {""} |
| 32 | Wrapper | mod_wrapper | {""} |
| 34 | Feed Display | mod_feed | {""} |
| 36 | Syndication | mod_syndicate | {""} |
+----+---------------+-------------------+--------+

found 8 modules.
so we nuke them:
update efzkh_modules set params = '' where params like '%{""}%';

and the blue screen of death has been banished. I can successfully log in to the admin side now.

Brent Laminack

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

Posted: Thu Oct 20, 2016 12:46 am
by maestro3229
The {""} in the params column seems to be what was causing my problems as well. I did a search through several sites and found that was common in my sites that have been migrated from J! 1.5 or older, but not in any sites that were initially created in 3.x. In every case, the bad parameters were in core Joomla modules login, menu stats, footer and user status, just as reported above.

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

Posted: Thu Oct 20, 2016 3:37 am
by DreamlessDancer
I got this issue, but it's really, really, peculiar in how it's manifesting.

On one machine, selecting a module for editing will show the module editing screen for a brief few seconds, if I'm lucky, then it jumps to the following (according to Live HTTP Headers):

GET /administrator/index.php?option=com_modules&task=module.orderPosition&aa4c3a2860f8534088760d805ceaa19d=1&client_id=0&position=talent-8

And never does anything after that, I get a blank page.

But the darn thing works just fine and dandy when editing modules on other computers, ...

Now, I should also point out that the particular machine in which the above error manifests also cannot log into Disqus boards attached to most websites, it's always throwing an "Exception: e. is undefined".

P.S. the upgrade was from 3.6.0 to 3.6.3 and the 3.6.0 was fresh install.

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

Posted: Thu Oct 20, 2016 7:51 am
by apsilva
That's another issue not related to this topic. To solve that clear the browser cache.

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

Posted: Thu Oct 20, 2016 1:33 pm
by strix6
I got the json blue screen error in the back-end after updating 3.6.2. to 3.6.3. The front-end is working fine.
So its hard to check what plugin/module is causing the error.

I know that using the 3.6.2. vendor map is not the way to go, but its the only way to get access to the back-end again.

Im not that technical, what is the best way to fix this problem?

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

Posted: Thu Oct 20, 2016 2:23 pm
by ashleygonzalez
I have something similar going on but not quite the same as the accounts above. I updated 10 Joomla sites to 3.6.3. All are on the same server. Only one is throwing this JSON error on EDITING an article. Adding a new article works just fine. We cannot edit any articles. I have tried disabling the different admin modules and I've run some sql searches for {""} as well. I'm not finding anything. Any ideas? I'm at a loss.

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

Posted: Thu Oct 20, 2016 6:20 pm
by HK66
Same error after update 3.6.3
0 - Error decoding JSON data: Syntax error

any Idea?? :'(

Thank you for help!

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

Posted: Thu Oct 20, 2016 8:25 pm
by rbuelund
I get this error when trying to edit a specific user in backend through Community Builder or through the Joomla user admin, other users I can edit without problems - how come ?

The params field of the user i cannot edit contains loads of \\\\ signs please see attached !!?? - what is going on here ??
params.jpg

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

Posted: Thu Oct 20, 2016 8:31 pm
by Per Yngve Berg
Check the params filed for that user in the #__users table with phpmyadmin.