Binary exit code 0 on failed --apply-update

This subforum contains all the issues which we already resolved.
Post Reply
Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Binary exit code 0 on failed --apply-update

Post by Bisa »

I'm tinkering with scripting the update process (mainly for headless clients) and ran into an odd behaviour:
I'm running the core-linux64 package

Code: Select all

$ #Bash prompt
$ /opt/factorio/bin/x64/factorio --apply-update /tmp/nonexisting.zip
   0.000  Info Main.cpp:150: Program arguments: "/opt/factorio/bin/x64/factorio" "--apply-update" "/tmp/nonexisting.zip"
   0.000 2015-08-09 22:41:27; Factorio 0.12.2 (Build 16229, linux64)
   0.000 Operating system: Linux
   0.000 Read data path: /opt/factorio/data
   0.000 Write data path: /opt/factorio
   0.000 Binaries path: /opt/factorio/bin
   0.030 Running in headless mode
   0.035 Loading mod core 0.0.0 (data.lua)
   0.041 Loading mod base 0.12.2 (data.lua)
   0.979 Factorio initialised
   0.980 Info Updater.cpp:358: Applying update /tmp/factorio-update*.zip
   0.982 Error Util.cpp:46: Error opening update package: Opening zip /tmp/nonexisting.zip failed
   1.006 Goodbye

$ echo $?
   0
Despite the Error from Util.cpp:46 the binary exits with code 0 indicating "everything went well during my execution"

I'm not sure if you would consider this a bug but if the binary would give a proper exit code we could get around having to parse the output for errors which seems kinda hackish :D
Hosting a factorio server? Take a look at this || init script ||.

Oxyd
Former Staff
Former Staff
Posts: 1428
Joined: Thu May 07, 2015 8:42 am
Contact:

Re: Binary exit code 0 on failed --apply-update

Post by Oxyd »

Yeah, sure. Factorio should return 1 on error everywhere else already, this seems to be the only case that was forgotten. Fixed in 0.12.4.

Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: Binary exit code 0 on failed --apply-update

Post by Bisa »

Cheers =)
Hosting a factorio server? Take a look at this || init script ||.

Post Reply

Return to “Resolved Problems and Bugs”