Page 1 of 1

[12.35] On update: JSON parser error server reply) (<unspecified file>(1): expected object or array

Posted: Sun Aug 21, 2016 12:35 pm
by Weresmilodon
So, i'm getting this error when i try to update now. It also comes up when trying to log in with a clean installation.

Code: Select all

JSON parser error server reply (<unspecified file>(1): expected object or array)
This is possibly caused by a firewall configuration
I know there is an old topic about this, and i think at that time it was a SSL certificate? Don't remember. Given that that was some time ago, and this is new, i figured i'd make a new topic. If nothing else, the title should be easily searchable in the future.

Log (fresh install) is below:

0.000 2016-08-21 14:21:14; Factorio 0.12.35 (Build 18124, win64, alpha)
0.000 Operating system: Windows 7 Service Pack 1
0.001 Program arguments: "D:\Program Files\Factorio\bin\x64\Factorio.exe"
0.001 Read data path: D:/Program Files/Factorio/data
0.001 Write data path: C:/Users/Replaced/AppData/Roaming/Factorio
0.001 Binaries path: D:/Program Files/Factorio/bin
0.011 Graphics options: [FullScreen: true] [VSync: true] [UIScale: 100%] [MultiSampling: OFF] [Graphics quality: normal] [Video memory usage: all] [Light scale: 20%] [Screen: 255]
0.012 Available display adapters: 1
0.012 [0]: \\.\DISPLAY1 - AMD Radeon HD 5800 Series {0x8080005, [0,0], 1680x1050, 32bit, 60Hz}
0.012 Create display on adapter 0. Size 1280x720 at position [190, 147].
0.060 Initialised Direct3D:[0] AMD Radeon HD 5800 Series; driver: aticfx64.dll 8.17.10.1404
0.087 Desktop composition is active.
0.144 Loading mod core 0.0.0 (data.lua)
0.147 Loading mod base 0.12.35 (data.lua)
0.246 Checksum for core: 3711505753
0.246 Checksum for mod base: 2829195351
6.398 Initial atlas bitmap size is 16384
6.399 Created atlas bitmap 16384x7754
10.619 Sprites loaded
11.045 Loading sounds...
12.189 Factorio initialised
82.886 Info Updater.cpp:752: Downloading https://www.factorio.com/updater/get-to ... iVersion=2
83.735 Warning Updater.cpp:774: JSON parser error server reply (<unspecified file>(1): expected object or array)
83.735 Info Updater.cpp:775: Full reply: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>Redirecting...</title>
<h1>Redirecting...</h1>
<p>You should be redirected automatically to target URL: <a href="https://updater.factorio.com/get-token? ... eplaced</a>. If not click the link.

(Names obviously Replaced)

Re: JSON parser error server reply (<unspecified file>(1):

Posted: Sun Aug 21, 2016 12:41 pm
by Loewchen
Try downloading the latest version from the website.

Re: JSON parser error server reply (<unspecified file>(1):

Posted: Sun Aug 21, 2016 1:42 pm
by Weresmilodon
I did. That's what i used for the clean install.

Re: JSON parser error server reply (<unspecified file>(1):

Posted: Sun Aug 21, 2016 1:55 pm
by Loewchen
Weresmilodon wrote:I did. That's what i used for the clean install.
You need to decide if you want to play the 0.12 or 0.13 version of the game. If you want to play the latest version, download the experimental release here: https://www.factorio.com/download/experimental

Re: [12.35] On update: JSON parser error server reply) (<unspecified file>(1): expected object or ar

Posted: Sun Aug 21, 2016 2:10 pm
by Weresmilodon
Yeah, latest experimental works fine.

Latest stable is still broken though.

Re: [12.35] On update: JSON parser error server reply) (<unspecified file>(1): expected object or ar

Posted: Sun Aug 21, 2016 6:28 pm
by TruePikachu
This would be a serverside bug, if anything; the client expected JSON, but got HTML instead.

Re: [12.35] On update: JSON parser error server reply) (<unspecified file>(1): expected object or ar

Posted: Sun Aug 21, 2016 9:35 pm
by Tynach
It appears that the server actually redirects, and spits out the HTML of a redirect page. I guess Factorio doesn't try to follow the redirect, instead just trying to parse the HTML as JSON. Hence the error:

Code: Select all

JSON parser error server reply (<unspecified file>(1): expected object or array)

This is possibly caused by a firewall configuration
This is what I get when I try to manually query the API (thanks to a similar bug posted a while back, I didn't have to figure out the right 'curl' command line arguments):

Code: Select all

$ curl -D- -d password=xxx 'https://www.factorio.com/updater/get-token?username=Tynach&apiVersion=2' 
HTTP/1.1 307 TEMPORARY REDIRECT
Connection: keep-alive
Server: gunicorn/19.6.0
Date: Sun, 21 Aug 2016 21:13:20 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 349
Location: https://updater.factorio.com/get-token?apiVersion=2&username=Tynach
Strict-Transport-Security: max-age=31536000
Set-Cookie: session=abunchofstuffthatiwontletyousee; HttpOnly; Path=/
Via: 1.1 vegur

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>Redirecting...</title>
<h1>Redirecting...</h1>
<p>You should be redirected automatically to target URL: <a href="https://updater.factorio.com/get-token?apiVersion=2&username=Tynach">https://updater.factorio.com/get-token?apiVersion=2&username=Tynach</a>.  If not click the link.
If I try the same thing on the URL that it tries to redirect to, it works:

Code: Select all

$ curl -D- -d password=xxx 'https://updater.factorio.com/get-token?apiVersion=2&username=Tynach'
HTTP/1.1 200 OK
Connection: keep-alive
Server: gunicorn/19.3.0
Date: Sun, 21 Aug 2016 21:14:07 GMT
Content-Type: application/json
Content-Length: 34
Via: 1.1 vegur
That's why it's getting HTML, but the experimental builds are not; the experimental builds must already be using the new address.

This probably shouldn't be configured as a 'temporary redirect', but instead there should be something like a mod_rewrite line in the server's config, so that both URLs work. Or perhaps at least 'permanent redirect' instead.

Re: [12.35] On update: JSON parser error server reply) (<unspecified file>(1): expected object or ar

Posted: Sun Aug 21, 2016 9:45 pm
by orzelek
Maybe remove your password from output? :)

Re: [12.35] On update: JSON parser error server reply) (<unspecified file>(1): expected object or ar

Posted: Mon Aug 22, 2016 11:19 am
by HanziQ
Should be working now.

Re: [12.35] On update: JSON parser error server reply) (<unspecified file>(1): expected object or ar

Posted: Mon Aug 22, 2016 9:21 pm
by Tynach
orzelek wrote:Maybe remove your password from output? :)
I.. Was pretty sure I did? I replaced it with 'hunter2', at least in the input, and didn't see it mentioned in the output anywhere.

Though while I'm typing this, I'm looking at the post and seeing 'xxx' used instead of hunter2. Is that what you guys meant? Because 'hunter2' is a reference to an Internet meme started on bash.org, not my actual password.

Re: [12.35] On update: JSON parser error server reply) (<unspecified file>(1): expected object or ar

Posted: Mon Aug 22, 2016 9:48 pm
by orzelek
For me hunter2 also looked like a password thats why I asked.