Factorio Update Helper (an aid for headless server owners)

Find multiplayer games.
Tools/scripts to run a dedicated server.
papayadog
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Sep 04, 2016 10:18 pm
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by papayadog »

I'm trying to understand why this script (which is great--thanks narc) won't update from the current stable version (0.13.20) to the latest experimental build.

If I run:

Code: Select all

python update_factorio.py -p core-linux_headless64 -f 0.13.20
 -x -d
I get this:

Code: Select all

No updates available for version 0.13.20 (latest experimental is 0.14.3).
However, if I do a dry run of an update from version 0.13.18 or below:

Code: Select all

python update_factorio.py -p core-linux_headless64 -f 0.13.18 -x -d
I get the following output, which is the desired effect:

Code: Select all

Dry run: would have fetched update from 0.13.18 to 0.14.0.
Dry run: would have fetched update from 0.14.0 to 0.14.1.
Dry run: would have fetched update from 0.14.1 to 0.14.2.
Dry run: would have fetched update from 0.14.2 to 0.14.3.
Poking around a little bit, I see in the JSON file that the script calls and parses that there is an entry to get from 0.13.18 to 0.14.0 (and from there to even more recent experimental versions):

Code: Select all

{
      "from": "0.13.18",
      "to": "0.14.0"
    }
No such pair exists to upgrade from 0.13.20 (or 0.13.19 for that matter) to 0.14.0 in the JSON file. So, I understand that this is why the script isn't figuring out how to update from 0.13.20 to 0.14.0. Is there a reason for this, though?
User avatar
Narc
Filter Inserter
Filter Inserter
Posts: 279
Joined: Mon Feb 11, 2013 7:25 am
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by Narc »

papayadog wrote:I'm trying to understand why this script (which is great--thanks narc) won't update from the current stable version (0.13.20) to the latest experimental build.
[...]
No such pair exists to upgrade from 0.13.20 (or 0.13.19 for that matter) to 0.14.0 in the JSON file. So, I understand that this is why the script isn't figuring out how to update from 0.13.20 to 0.14.0. Is there a reason for this, though?
Factorio devs have not provided an upgrade path from Factorio >= 0.13.19 to the 0.14 series. According to HanziQ, they will do so at an unspecified future date.
papayadog
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Sep 04, 2016 10:18 pm
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by papayadog »

Narc wrote:Factorio devs have not provided an upgrade path from Factorio >= 0.13.19 to the 0.14 series. According to HanziQ, they will do so at an unspecified future date.
Ah, well that explains it. Thanks! :)
geekthing
Burner Inserter
Burner Inserter
Posts: 6
Joined: Fri Sep 16, 2016 8:36 pm
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by geekthing »

Factorio Update Helper(Helper)

I wrote a script to automate calling the python Update Helper script because linux.
It's just a couple lines, but I don't want to have to type them twice a week to keep up with the experimental builds.

I call it update.sh and when there is an update all I have to do is stop the server, run update.sh and then copy the update string and add the path.
The reason I didn't fully automate it is because if it breaks I don't want to run bad update commands on my server.
The script is set to grab the latest experimental build.

I look forward to any feedback.

Code: Select all

#factorio update helper script

#Gets the current factorio version
#change the ~/factorio part to your factorio path
ver=$(~/factorio/bin/x64/factorio --version | grep -m 1 -o 0.1....)

#Gets the current experimental build based on the version returned above
#Change the ~/factorio-updater to your correct path
python ~/factorio-updater/update_factorio.py -p core-linux_headless64 -f $ver -x

User avatar
Narc
Filter Inserter
Filter Inserter
Posts: 279
Joined: Mon Feb 11, 2013 7:25 am
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by Narc »

geekthing wrote:Factorio Update Helper(Helper)

I wrote a script to automate calling the python Update Helper script because linux.[...]
Very nice! You may also be interested in this script supplied by @yukihyou on Github.

I'm always pleased that other folks find my things useful.
geekthing
Burner Inserter
Burner Inserter
Posts: 6
Joined: Fri Sep 16, 2016 8:36 pm
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by geekthing »

Narc wrote: Very nice! You may also be interested in this script supplied by @yukihyou on Github.
This is awesome!! Thanks!
mcgoff360
Burner Inserter
Burner Inserter
Posts: 18
Joined: Sat Dec 20, 2014 1:30 pm
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by mcgoff360 »

first of all, i love your script. it makes things so much easier for me using an amazon ec2 server.

i was wondering if there was any way to have factorio search for the updated mods via the command line and if you could implement that into your script. ingame, you can go into the mods tab and then click check for updates. im not sure what repository it searches but it would be nice if you could do it for the server itself.
User avatar
Narc
Filter Inserter
Filter Inserter
Posts: 279
Joined: Mon Feb 11, 2013 7:25 am
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by Narc »

I haven't looked into it, but it's definitely a nice-to-have.
GiddyRaccoon
Burner Inserter
Burner Inserter
Posts: 6
Joined: Mon Mar 04, 2019 6:27 pm
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by GiddyRaccoon »

Hi,
Wonderful script you have made but it is not seeing factorio 0.17 updates, that latest it can see it 0.16.51

As far as I can see the issue lies with this website: https://updater.factorio.com/get-available-versions the one where you get the current versions does not display any 0.17 versions. is this because they forgot to update it or they have depreciated the page.

Thanks in advance

Giddy
User avatar
Narc
Filter Inserter
Filter Inserter
Posts: 279
Joined: Mon Feb 11, 2013 7:25 am
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by Narc »

Hi,

Thanks for the interest! According to reports from github friends, and according to the change log in the 0.17.2 release and later ones, there's a problem with the auto-updater in Factorio and it is temporarily turned off while they work on fixing it. Given that this update helper uses the same endpoints as the Factorio built-in updater, it is also bound by the same rules.

Do watch the change logs, I'm sure the devs will fix the updater soon!

Thanks,
Narc
GiddyRaccoon
Burner Inserter
Burner Inserter
Posts: 6
Joined: Mon Mar 04, 2019 6:27 pm
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by GiddyRaccoon »

Hi,

Now it is finding 0.17 if you use --experimental but no longer detects the current version. also it doesn't install and asks you to run command apply with `factorio --apply-update /tmp/core-linux_headless64-0.17.10-0.17.11-update.zip` which is not an option. (should be --apply-to) and doesn't work as permission is denied, even with sudo.

Thanks

Giddy
usuka
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sun Mar 17, 2019 1:02 am
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by usuka »

I don't know if this is the place to post it, but I've thrown together a little updater script now that headless servers can be downloaded without authentication.

It just downloads the whole tar and overwrites so it's a lot less elegant than Narc's, but it gets the job done for me and works without the auto-updater. Just sharing it here if anybody needs something to hold them over 'till the auto-updater is fixed.

Github

Cheers
User avatar
Narc
Filter Inserter
Filter Inserter
Posts: 279
Joined: Mon Feb 11, 2013 7:25 am
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by Narc »

GiddyRaccoon wrote: Tue Mar 12, 2019 5:30 pm Hi,

Now it is finding 0.17 if you use --experimental but no longer detects the current version. also it doesn't install and asks you to run command apply with `factorio --apply-update /tmp/core-linux_headless64-0.17.10-0.17.11-update.zip` which is not an option. (should be --apply-to) and doesn't work as permission is denied, even with sudo.

Thanks

Giddy
Hi, thanks for the interest! Nothing's changed in the updater itself, but from the error you're referencing, I'd check if your bin/x64/factorio still has the executable flag set (might need to `chmod +x bin/x64/factorio`). I had to fix that on a failed update recently. As far as Linux is concerned, trying to execute a non-executable file is a permission error (because being executable is a permission).
usuka wrote: Sun Mar 17, 2019 3:26 am I don't know if this is the place to post it, but I've thrown together a little updater script now that headless servers can be downloaded without authentication.

It just downloads the whole tar and overwrites so it's a lot less elegant than Narc's, but it gets the job done for me and works without the auto-updater. Just sharing it here if anybody needs something to hold them over 'till the auto-updater is fixed.

Github

Cheers
Hey, that's awesome, thank you! However, I'm not sure what you mean about the updater needing fixed -- it works just fine, but there are no update packages for 0.17.0 to 0.17.6. I assume the devs will provide an update path when the big list of more pressing issues get resolved.
GiddyRaccoon
Burner Inserter
Burner Inserter
Posts: 6
Joined: Mon Mar 04, 2019 6:27 pm
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by GiddyRaccoon »

Hi, the chmod thing worked, but it doesn't install the files for you, is it supposed to do this or can I mod it so that it does this. also it would be cool if you can add this to the startup of the factorio server, I am using systemd service.

Giddy
User avatar
Narc
Filter Inserter
Filter Inserter
Posts: 279
Joined: Mon Feb 11, 2013 7:25 am
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by Narc »

GiddyRaccoon wrote: Tue Mar 26, 2019 6:57 pm Hi, the chmod thing worked, but it doesn't install the files for you, is it supposed to do this or can I mod it so that it does this. also it would be cool if you can add this to the startup of the factorio server, I am using systemd service.

Giddy
It is supposed to do exactly what you tell it to do, using what is available. My usual invocation is `update_factorio.py -xDa bin/x64/factorio` (experimental, delete after applying, apply to "bin/x64/factorio"), which updates my Factorio with any experimental update packages available automatically. Note that currently there is no upgrade path from 0.16.51 or from 0.17.0 to .6 -- you must have 0.17.7 or higher to benefit from automatic updates.

If it's not automatically updating for you, you'll have to tell me more:
- what is your command line?
- what output do you get?

Regarding integrating with your systemd script, that's something you'll have to work out on your own; I personally wouldn't recommend it -- sometimes experimental updates can have some unhappy issues (withness the crash-on-research-screen 0.17.19), so for my own server, I prefer manually updating.

That said, I also don't like having Factorio run as a service; I prefer having it live inside my near-permanent tmux session where I can see it and interact with it as needed.

Hope this helps.
GiddyRaccoon
Burner Inserter
Burner Inserter
Posts: 6
Joined: Mon Mar 04, 2019 6:27 pm
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by GiddyRaccoon »

Hi, quick question, where do you have the script installed / where do you run it from?

Giddy
FIXED - had to put it in factorio, not factorio/bin/x64/

how would you suggest running the server so that you can interact with it, but I want it to start on boot.
User avatar
Narc
Filter Inserter
Filter Inserter
Posts: 279
Joined: Mon Feb 11, 2013 7:25 am
Contact:

Re: Factorio Update Helper (an aid for headless server owners)

Post by Narc »

GiddyRaccoon wrote: Sat Mar 30, 2019 4:33 pm Hi, quick question, where do you have the script installed / where do you run it from?

Giddy
FIXED - had to put it in factorio, not factorio/bin/x64/
Looks like you got it resolved. It doesn't matter where the script is, only that you give it the path to the Factorio executable. I tend to run it from the Factorio base foldee, as you correctly determined.
GiddyRaccoon wrote: Sat Mar 30, 2019 4:33 pmhow would you suggest running the server so that you can interact with it, but I want it to start on boot.
Yeah, I don't really know, I don't use it that way, so no recommendation from me. The systemd setup is probably fine, and you could maybe set up rcon for interacting with the running server. I know that's a thing, but it's also not something I've ever used. Ask around, I'm sure folks have done it.
Post Reply

Return to “Multiplayer / Dedicated Server”