SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON dat

Konsider
Topic Author
Posts: 7
3 years 1 month ago #4523 by Konsider
As another person mentioned 6 months ago, I got this error:

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

Everything was working fine, then all of a sudden no comment could be posted. I went into the admin section and deleted all the comments, and then things were working again.

Please Log in or Create an account to join the conversation.

Lodder
Lodder's Avatar
Posts: 1264
3 years 1 month ago #4525 by Lodder
Does this occur with a normal post?
Or are you trying to upload an image?

Regards,
Lodder

Please Log in or Create an account to join the conversation.

Konsider
Topic Author
Posts: 7
3 years 1 month ago #4528 by Konsider
I was just trying to post normally when I got the error. There was nothing I could do to get things working again, other than deleting all the comments. Still, it hasn't happened again, so it was maybe just a freak incident, but thought you should know :)

Please Log in or Create an account to join the conversation.

zmx
Posts: 18
2 years 11 months ago - 2 years 11 months ago #4535 by zmx
any solution yet?
I stuck with this error on v11.1 - joomla 5

in addition I have this situation:
along with the JSON error, if I reload the page I get:
error 500 Server error

after deleting the actual session everthings is ok
AND
the shout posted, which throws the problem
is added to the shout list.

after tests with console.log I can say:

1. the submitAjax JS works fine till the (refresh) getPost command

(I'm in the respone.success, got a correct JSON.strinify string and output for respone.data)

just with the getPosts command the JSON error is thrown.

maybe there is an error in the session param string after posting.




1. JSON.stringify
{"id":"0","type":"insert","name":"zi2000","message":"test100","shout":"Shout!","6330b81f061dc2b7e2200936ef3523b7":1,"Itemid":101}
returns response.data
Object { html: '<div class="shout-wrapper" data-shout-id="23" data-shout-name="zi2000" data-shout-user-id="126">\r\n\t<div class="shout-header jj-flex jj-flex-middle jj-flex-space-between">\r\n\t\t<div class="jj-flex jj-flex-middle">\r\n\t\t\t\t\t\t<span class="avatar">\r\n\t\t\t\t<img src="http://j5.breastguide.org/images/comprofiler/tn126_653a54c6de16b.gif" height="30" width="30"><span id="user-state" class="user-state online"></span>\t\t\t</span>\r\n\t\t\t\t\t\t<span class="shout-user">zi2000</span>\r\n\t\t</div>\r\n\t\t<div class="jj-flex-right jj-flex-middle">\r\n\t\t\t<div class="jj-flex jj-flex-middle">\r\n\t\t\t\t\t\t\t\t\t<button class="btn btn-sm btn-link" title="mit Zitat antworten" aria-label="mit Zitat antworten" onclick="shoutbox.replyShoutWrapper(event, this)"><svg xmlns="http://www.w3.org/2000/svg" width="1.2em" fill="var(--shoutbox-reply-icon-color)" viewBox="0 0 16 16"><path d="M5.921 11.9 1.353 8.62a.719.719 0 0 1 0-1.238L5.921 4.1A.716.716 0 0 1 7 4.719V6c1.5 0 6 0 7 8-2.5-4.5-7-4-7-4v1.281c0 .56-.606.898-1.079.62z"/></svg></button>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<button class="btn btn-sm btn-link" title="ändern" aria-label="ändern" onclick="shoutbox.editShoutWrapper(event, this)"><svg xmlns="http://www.w3.org/2000/svg" width="1.2em" fill="var(--shoutbox-edit-icon-color)" viewBox="0 0 16 16"><path d="M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325z"/></svg></button>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<button class="btn btn-sm btn-link" title="löschen" aria-label="löschen" onclick="shoutbox.shoutRemoveWrapper(event, this)"><svg xmlns="http://www.w3.org/2000/svg" width="1.2em" fill="var(--shoutbox-delete-icon-color)" viewBox="0 0 16 16"><path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/></svg></button>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t</div>\r\n\t</div>\r\n\t<div class="shout-message">versuch</div>\r\n\t<div class="jj-shout-date jj-flex jj-flex-right jj-flex-middle">\r\n\t\t<span class="jj-shout-date-text">\r\n\t\t\tgerade eben\t\t\t\t\t</span>\r\n\t\t\t\t\t<button class="btn btn-sm btn-link jj-thumbs-up-trigger" title="Daumen-Hoch" aria-label="Daumen-Hoch" onclick="shoutbox.thumbsUpWrapper(event, this)"><svg width="1.2em" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path fill="var(--shoutbox-thumbs-icon-color)" d="M320 1344q0-26-19-45t-45-19q-27 0-45.5 19t-18.5 45q0 27 18.5 45.5t45.5 18.5q26 0 45-18.5t19-45.5zm160-512v640q0 26-19 45t-45 19h-288q-26 0-45-19t-19-45v-640q0-26 19-45t45-19h288q26 0 45 19t19 45zm1184 0q0 86-55 149 15 44 15 76 3 76-43 137 17 56 0 117-15 57-54 94 9 112-49 181-64 76-197 78h-129q-66 0-144-15.5t-121.5-29-120.5-39.5q-123-43-158-44-26-1-45-19.5t-19-44.5v-641q0-25 18-43.5t43-20.5q24-2 76-59t101-121q68-87 101-120 18-18 31-48t17.5-48.5 13.5-60.5q7-39 12.5-61t19.5-52 34-50q19-19 45-19 46 0 82.5 10.5t60 26 40 40.5 24 45 12 50 5 45 .5 39q0 38-9.5 76t-19 60-27.5 56q-3 6-10 18t-11 22-8 24h277q78 0 135 57t57 135z"/></svg></button>\r\n\t\t\t<span class="jj-thumbs-up">\r\n\t\t\t\t<span class="jj-thumbs-up-count" title=""></span>\r\n\t\t\t</span>\r\n\t\t \t</div>\r\n</div>\r\n', id: 23, message: "versuch" }


2. session param before posting
joomla|s:856:"TzoyNDoiSm9vbWxhXFJlZ2lzdHJ5XFJlZ2lzdHJ5IjozOntzOjc6IgAqAGRhdGEiO086ODoic3RkQ2xhc3MiOjU6e3M6Nzoic2Vzc2lvbiI7Tzo4OiJzdGRDbGFzcyI6Mzp7czo1OiJ0aW1lciI7Tzo4OiJzdGRDbGFzcyI6Mzp7czo1OiJzdGFydCI7aToxNjk5OTk5NzQzO3M6NDoibGFzdCI7aToxNzAwMDAxNjQ0O3M6Mzoibm93IjtpOjE3MDAwMDE2NDU7fXM6NToidG9rZW4iO3M6MzI6IjdhMTVmODIyNjBjNTcxYjZjOWRhZTI3NDlmMDM1YjNhIjtzOjc6ImNvdW50ZXIiO2k6Mjk7fXM6ODoicmVnaXN0cnkiO086MjQ6Ikpvb21sYVxSZWdpc3RyeVxSZWdpc3RyeSI6Mzp7czo3OiIAKgBkYXRhIjtPOjg6InN0ZENsYXNzIjowOnt9czoxNDoiACoAaW5pdGlhbGl6ZWQiO2I6MDtzOjEyOiIAKgBzZXBhcmF0b3IiO3M6MToiLiI7fXM6NDoidXNlciI7TzoyMDoiSm9vbWxhXENNU1xVc2VyXFVzZXIiOjE6e3M6MjoiaWQiO2k6MTI2O31zOjExOiJhcHBsaWNhdGlvbiI7Tzo4OiJzdGRDbGFzcyI6MTp7czo1OiJxdWV1ZSI7YTowOnt9fXM6OToiY29tX3VzZXJzIjtPOjg6InN0ZENsYXNzIjoxOntzOjExOiJtZmFfY2hlY2tlZCI7aToxO319czoxNDoiACoAaW5pdGlhbGl6ZWQiO2I6MDtzOjEyOiIAKgBzZXBhcmF0b3IiO3M6MToiLiI7fQ==";
decoded:
O:24:"Joomla\Registry\Registry":3:{s:7:"�*�data";O:8:"stdClass":5:{s:7:"session";O:8:"stdClass":3:{s:5:"timer";O:8:"stdClass":3:{s:5:"start";i:1699999743;s:4:"last";i:1700001644;s:3:"now";i:1700001645;}s:5:"token";s:32:"7a15f82260c571b6c9dae2749f035b3a";s:7:"counter";i:29;}s:8:"registry";O:24:"Joomla\Registry\Registry":3:{s:7:"�*�data";O:8:"stdClass":0:{}s:14:"�*�initialized";b:0;s:12:"�*�separator";s:1:".";}s:4:"user";O:20:"Joomla\CMS\User\User":1:{s:2:"id";i:126;}s:11:"application";O:8:"stdClass":1:{s:5:"queue";a:0:{}}s:9:"com_users";O:8:"stdClass":1:{s:11:"mfa_checked";i:1;}}s:14:"�*�initialized";b:0;s:12:"�*�separator";s:1:".";}

3. session param after posting:
joomla|s:1168:"TzoyNDoiSm9vbWxhXFJlZ2lzdHJ5XFJlZ2lzdHJ5IjozOntzOjc6IgAqAGRhdGEiO086ODoic3RkQ2xhc3MiOjY6e3M6Nzoic2Vzc2lvbiI7Tzo4OiJzdGRDbGFzcyI6Mzp7czo1OiJ0aW1lciI7Tzo4OiJzdGRDbGFzcyI6Mzp7czo1OiJzdGFydCI7aToxNjk5OTk5NzQzO3M6NDoibGFzdCI7aToxNzAwMDAxNzE5O3M6Mzoibm93IjtpOjE3MDAwMDE3MTk7fXM6NToidG9rZW4iO3M6MzI6IjdhMTVmODIyNjBjNTcxYjZjOWRhZTI3NDlmMDM1YjNhIjtzOjc6ImNvdW50ZXIiO2k6MzI7fXM6ODoicmVnaXN0cnkiO086MjQ6Ikpvb21sYVxSZWdpc3RyeVxSZWdpc3RyeSI6Mzp7czo3OiIAKgBkYXRhIjtPOjg6InN0ZENsYXNzIjowOnt9czoxNDoiACoAaW5pdGlhbGl6ZWQiO2I6MDtzOjEyOiIAKgBzZXBhcmF0b3IiO3M6MToiLiI7fXM6NDoidXNlciI7TzoyMDoiSm9vbWxhXENNU1xVc2VyXFVzZXIiOjE6e3M6MjoiaWQiO2k6MTI2O31zOjExOiJhcHBsaWNhdGlvbiI7Tzo4OiJzdGRDbGFzcyI6MTp7czo1OiJxdWV1ZSI7YTowOnt9fXM6OToiY29tX3VzZXJzIjtPOjg6InN0ZENsYXNzIjoxOntzOjExOiJtZmFfY2hlY2tlZCI7aToxO31zOjE0OiJqanNob3V0Ym94XzEyNiI7TzoyMDoiSm9vbWxhXENNU1xEYXRlXERhdGUiOjQ6e3M6NDoiZGF0ZSI7czoyNjoiMjAyMy0xMS0xNCAyMjo0MTo1OS44NTkxMjEiO3M6MTM6InRpbWV6b25lX3R5cGUiO2k6MztzOjg6InRpbWV6b25lIjtzOjM6IlVUQyI7czo1OiIAKgB0eiI7TzoxMjoiRGF0ZVRpbWVab25lIjoyOntzOjEzOiJ0aW1lem9uZV90eXBlIjtpOjM7czo4OiJ0aW1lem9uZSI7czozOiJVVEMiO319fXM6MTQ6IgAqAGluaXRpYWxpemVkIjtiOjA7czoxMjoiACoAc2VwYXJhdG9yIjtzOjE6Ii4iO30=";
decoded:
O:24:"Joomla\Registry\Registry":3:{s:7:"�*�data";O:8:"stdClass":6:{s:7:"session";O:8:"stdClass":3:{s:5:"timer";O:8:"stdClass":3:{s:5:"start";i:1699999743;s:4:"last";i:1700001719;s:3:"now";i:1700001719;}s:5:"token";s:32:"7a15f82260c571b6c9dae2749f035b3a";s:7:"counter";i:32;}s:8:"registry";O:24:"Joomla\Registry\Registry":3:{s:7:"�*�data";O:8:"stdClass":0:{}s:14:"�*�initialized";b:0;s:12:"�*�separator";s:1:".";}s:4:"user";O:20:"Joomla\CMS\User\User":1:{s:2:"id";i:126;}s:11:"application";O:8:"stdClass":1:{s:5:"queue";a:0:{}}s:9:"com_users";O:8:"stdClass":1:{s:11:"mfa_checked";i:1;}s:14:"jjshoutbox_126";O:20:"Joomla\CMS\Date\Date":4:{s:4:"date";s:26:"2023-11-14 22:41:59.859121";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";s:5:"�*�tz";O:12:"DateTimeZone":2:{s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}}}s:14:"�*�initialized";b:0;s:12:"�*�separator";s:1:".";}
(this session is invalid = 500 server error)

maybe this can help
Last edit: 2 years 11 months ago by zmx.

Please Log in or Create an account to join the conversation.

Lodder
Lodder's Avatar
Posts: 1264
2 years 11 months ago #4537 by Lodder
@zmx - would you mind sending me an email (This email address is being protected from spambots. You need JavaScript enabled to view it.) with a link to your site and a super admin account so I can look further into the issue.

I've not seen or heard of this error before, so it might need some debugging.

Regards,
Lodder

Please Log in or Create an account to join the conversation.

zmx
Posts: 18
2 years 11 months ago - 2 years 11 months ago #4538 by zmx
thanks, no problem will send.

btw. you have reacted to the (similar) error a few month ago :)
joomjunk.co.uk/forum-index/jj-shoutbox/1...1-column-1.html#4477
Last edit: 2 years 11 months ago by zmx.

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum