Page 1 of 2

SyntaxError: JSON.parse: unexpected end of data at line 1 co

Posted: Tue Nov 04, 2014 5:05 am
by SXT
Cannot change or modify any orders. Gives syntax error. Happens on even clean install. Does that in local development server as well as hosted servers.

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

Couldn't find any solution. It is very frustrating. I would appreciate if someone could guide me to the right direction.

Re: SyntaxError: JSON.parse: unexpected end of data at line

Posted: Tue Nov 04, 2014 4:29 pm
by i2Paq
Have a read on our forums, the answer is there.

Re: SyntaxError: JSON.parse: unexpected end of data at line

Posted: Tue Nov 04, 2014 7:31 pm
by SXT
I searched the forum and also googled it but could not find a solution. Maybe I'm looking in the wrong direction. Can you guide me on what topic should I search? as search for this error doesn't bring any solution. I found one post where someone had the same issue but nobody gave a proper solution or a way to fix it.

Re: SyntaxError: JSON.parse: unexpected end of data at line

Posted: Wed Nov 05, 2014 8:54 pm
by marmax
It seems the error occurs when site is in maintenance mode When in live mode is seems to work!

Read http://forum.opencart.com/viewtopic.php?f=181&t=131683
for more info.

Mark as [SOLVED] in the title if it works for you.

Re: SyntaxError: JSON.parse: unexpected end of data at line

Posted: Sat Nov 08, 2014 2:31 am
by Nesster
In our case it was a DNS resolution problem:
http://forum.opencart.com/viewtopic.php ... 99#p522416

Frank

Re: SyntaxError: JSON.parse: unexpected end of data at line

Posted: Sat Jan 03, 2015 8:30 am
by SilverSaeeD
i have this problem too :( please help...

Re: SyntaxError: JSON.parse: unexpected end of data at line

Posted: Mon Jan 12, 2015 1:06 pm
by techtools
SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data

OK
I am also getting this error and tried all what was posted on google search using SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data

Has anyone found any luck. It was working fine and just happened?

Re: SyntaxError: JSON.parse: unexpected end of data at line

Posted: Fri Jan 16, 2015 8:51 pm
by cornernote
Another reason this can occur is if your host is running mod_security. If this is the case you will have to contact them and ask they disable it for your account.

Just spent the last few hours debugging to find this. Hope it helps someone.

Re: SyntaxError: JSON.parse: unexpected end of data at line

Posted: Sun Jan 18, 2015 8:54 am
by techtools
tried disabling and still get SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data

OK


when trying to change status on order

Re: SyntaxError: JSON.parse: unexpected end of data at line

Posted: Fri Jan 23, 2015 1:21 pm
by sophia15
hello! i'm having the same problem :( i tried all the suggestions here, and still no luck. i hope someone can help me.

Re: SyntaxError: JSON.parse: unexpected end of data at line

Posted: Thu Feb 05, 2015 4:59 pm
by scarlett007
getting the same problem.. changing a status on a order gives this error: SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data

OK

Re: SyntaxError: JSON.parse: unexpected end of data at line

Posted: Thu Feb 05, 2015 9:06 pm
by viethemes
Hi,
Could you provide your site url, a admin account and a FTP account via PM, so I can take a look at this problem closer?

Re: SyntaxError: JSON.parse: unexpected end of data at line

Posted: Thu Feb 05, 2015 10:17 pm
by scarlett007
This resolved my issue:

If you do this and you try to edit orders you get error like:
SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
If you modify admin/config.php and change this line:
define('HTTPS_CATALOG', 'http://domain.com/');
with:
define('HTTPS_CATALOG', 'http://htaccess-user:htaccess-password@domain.com/');
I don`t get that error anymore and edit order(for ex.) is working fine.

Re: SyntaxError: JSON.parse: unexpected end of data at line

Posted: Fri Feb 06, 2015 4:24 pm
by fido-x

Re: SyntaxError: JSON.parse: unexpected end of data at line

Posted: Tue Feb 10, 2015 9:47 am
by Andybaby1
you're taking up too much space!is it?

Re: SyntaxError: JSON.parse: unexpected end of data at line

Posted: Wed Feb 11, 2015 4:31 pm
by abin@opencart
I got the same error and i fixed it

go to Admin->System->users->Api

Add a new api generate password, and enable it

Then go to Admin->system->settings->Edit->Option(tab)

Select api user under Checkout section as your api user

Then save the changes

Then go to Sales->orders->edit

It will work fine :-)

Re: SyntaxError: JSON.parse: unexpected end of data at line

Posted: Thu Feb 12, 2015 11:35 pm
by smudge
Ive had a lot of issues upgrading from opencart 1.5.1 to 2.0.1

Exactly the same symptoms as yours

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

So I created a fresh database and a fresh install of opencart 2.0.1

Initially I had no issues with new orders but as more orders where added and history ammended I got the same eror intermittently.

The only way around this was to clear cookies, close browser , reboot the laptop i was using, use an alternative browser. or login to another computer to change the history status.

this message seems to just seem to come up randomly when opencart feels like it

Really I should have just stayed with old version i would have saved 3 days mucking about fixing 'issues' in a version thats obviously not ready for production yet.

Re: SyntaxError: JSON.parse: unexpected end of data at line

Posted: Sat Feb 14, 2015 12:31 am
by viethemes
smudge wrote:Ive had a lot of issues upgrading from opencart 1.5.1 to 2.0.1

Exactly the same symptoms as yours

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

So I created a fresh database and a fresh install of opencart 2.0.1

Initially I had no issues with new orders but as more orders where added and history ammended I got the same eror intermittently.

The only way around this was to clear cookies, close browser , reboot the laptop i was using, use an alternative browser. or login to another computer to change the history status.

this message seems to just seem to come up randomly when opencart feels like it

Really I should have just stayed with old version i would have saved 3 days mucking about fixing 'issues' in a version thats obviously not ready for production yet.
Could you provide your site url, a admin account and a FTP account via PM, so I can take a look at the problem closer?

Re: SyntaxError: JSON.parse: unexpected end of data at line

Posted: Fri Mar 13, 2015 2:29 am
by leaveyou
it seems opencart does this numerous times throughout the platform:

Code: Select all

				// Set SSL if required
				if (substr(HTTPS_CATALOG, 0, 5) == 'https') {
					curl_setopt($curl, CURLOPT_PORT, 443);
				}
Seing this, i deleted the "s" in 'https' so that admin/config.php

Code: Select all

// HTTPS
define('HTTPS_SERVER', 'https://' . $baseurl . 'admin/');
define('HTTPS_CATALOG', 'https://' . $baseurl );
became

Code: Select all

// HTTPS
define('HTTPS_SERVER', 'http://' . $baseurl . 'admin/');
define('HTTPS_CATALOG', 'http://' . $baseurl );
but the error itself is caused by the fact that the script in the page you're viewing fails when if $this->session->data['cookie'] is not set (which can be so because of many reasons. in my case incorrect config)

So if you don't have https on your server, make sure even HTTPS_SERVER contains the regular http url

Re: SyntaxError: JSON.parse: unexpected end of data at line

Posted: Fri Mar 27, 2015 5:08 pm
by loi
Hi all,
I get the same error "opencart 2.0 SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data OK" when I change Order Status. I also delete .htaccess file, api_id in oc_api table the same value in oc_setting table.
And also get the error: "Warning: No match for Username and/or Password." when I delete order

I hosted the source code on the internet and the function worked last two days and it is not working now. However when I copy the source code and run on my PC then it work.

Anyone can help me? Thanks a lots.