[0.18.22] Will not start a new game when the save directory is a symlink

Things that we don't consider worth fixing at this moment.
Zim415
Burner Inserter
Burner Inserter
Posts: 8
Joined: Thu Mar 10, 2016 11:36 pm
Contact:

[0.18.22] Will not start a new game when the save directory is a symlink

Post by Zim415 »

Hello; first off I love your game and have thousands of hours of play time - so just wanted to start off by saying thank you for all your hard work.

I am using the goofball222/factorio docker container (experimental factorio) and have been for some time. I've been working on a mod similar to clusterio for many months now on and off in my spare time. After taking a break for several months I am now encountering an issue where the factorio headless server fails to start when creating a new map because it apparently takes issue with the saves directory being a symlink.

The dockerfile for the container has you mount a volume to /factorio in the container and then symlinks the various paths (i.e. mods, saves, config, etc) over to /opt/factorio. I've tried every combination I can think of included not even mounting a volume - all to no avail. Previously this all worked without issue. Just to note everything works fine when a save file is present and auto saving works as well - this only seems to be an issue when it tries to create a new map and do an initial save which seems to be tripping this create directory logic.

https://github.com/goofball222/factorio ... Dockerfile

I debated opening an issue on the container itself; personally I'm not fond of the symlink approach goofball uses. As a programmer and infrastructure engineer for over 30 years (currently a "DevOps Architect") this container logic smacks of trying to be too clever and having it cause issues when the simpler approach (KISS principle) would be to just let people mount volumes as they need and not try to force everyone into a box.

That being said the programmer in me feels like factorio should not care if this path is a symlink; only that it is a valid path to which it can write a save file to.

I've added some of the output below; please let me know if you would like any more information/details. Also please let me know if I am missing something obvious here. I did double check the git history for the container and as far as I can tell the docker container has always worked this way so it seems to me at some point the create new map logic changed in factorio at some point in the past few months since my hiatus working on my mod. Also I suppose this could possibly be caused by a change in the docker overlay filesystem and how it looks to factorio in the container.

Bottom line for me; could you confirm if something changed here in factorio?

Code: Select all

   0.000 2020-05-02 01:30:57; Factorio 0.18.22 (build 51330, linux64, headless)
   0.000 Operating system: Linux
   0.000 Program arguments: "/opt/factorio/bin/x64/factorio" "--create" "/opt/factorio/saves/save.zip" "--map-gen-settings" "/opt/factorio/config/map-gen-settings.json"
   0.000 Read data path: /opt/factorio/data
   0.000 Write data path: /opt/factorio [33196/51175MB]
   0.000 Binaries path: /opt/factorio/bin
   0.007 System info: [CPU: Intel(R) Xeon(R) CPU D-1541 @ 2.10GHz, 8 cores, RAM: 64265 MB]
   0.007 Environment: DISPLAY=<unset> WAYLAND_DISPLAY=<unset> DESKTOP_SESSION=<unset> XDG_SESSION_DESKTOP=<unset> XDG_CURRENT_DESKTOP=<unset> __GL_FSAA_MODE=<unset> __GL_LOG_MAX_ANISO=<unset> __GL_SYNC_TO_VBLANK=<unset> __GL_SORT_FBCONFIGS=<unset> __GL_YIELD=<unset>
   0.007 Running in headless mode

Code: Select all

   2.977 Factorio initialised
   2.977 Info Main.cpp:717: Creating new map /opt/factorio/saves/save.zip
   3.699 Goodbye
   0.000 Error Util.cpp:83: filesystem error: create_directories "/opt/factorio/saves" failed: Not a directory [/opt/factorio/saves]
User avatar
invisus
Filter Inserter
Filter Inserter
Posts: 284
Joined: Fri Sep 21, 2018 5:33 pm
Contact:

Re: [0.18.22] Will not start a new game when the save directory is a symlink

Post by invisus »

This might be another similar to 68499

A forum search for 'symlink' turns up quite a few similar reports. But in broad strokes, it sounds like this kind of behavior is intentional.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14339
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.18.22] Will not start a new game when the save directory is a symlink

Post by Rseding91 »

invisus wrote: Sat May 02, 2020 5:14 am This might be another similar to 68499

A forum search for 'symlink' turns up quite a few similar reports. But in broad strokes, it sounds like this kind of behavior is intentional.
It's just a side effect of us calling std::filesystem::create_directories(). It gives that error for symlinks because that's just how the standard said it behaves. And mostly, we don't care and don't want to support symlinks.
If you want to get ahold of me I'm almost always on Discord.
Zim415
Burner Inserter
Burner Inserter
Posts: 8
Joined: Thu Mar 10, 2016 11:36 pm
Contact:

Re: [0.18.22] Will not start a new game when the save directory is a symlink

Post by Zim415 »

Rseding91 wrote: Sat May 02, 2020 5:58 am
invisus wrote: Sat May 02, 2020 5:14 am This might be another similar to 68499

A forum search for 'symlink' turns up quite a few similar reports. But in broad strokes, it sounds like this kind of behavior is intentional.
It's just a side effect of us calling std::filesystem::create_directories(). It gives that error for symlinks because that's just how the standard said it behaves. And mostly, we don't care and don't want to support symlinks.
Fair enough; thanks for the confirmation at least. I can't say I disagree with your position on this however it would be nice if you did support it and seems like a trivial and quick code change from my experience. Anyways I'll open an issue with the docker containers maintainer then.
Zim415
Burner Inserter
Burner Inserter
Posts: 8
Joined: Thu Mar 10, 2016 11:36 pm
Contact:

Re: [0.18.22] Will not start a new game when the save directory is a symlink

Post by Zim415 »

Just for reference for others who come across this thread; I have opened a pull-request with the docker container maintainer to resolve this issue.

https://github.com/goofball222/factorio/pull/18
Rseding91
Factorio Staff
Factorio Staff
Posts: 14339
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.18.22] Will not start a new game when the save directory is a symlink

Post by Rseding91 »

Zim415 wrote: Sat May 02, 2020 12:14 pm Fair enough; thanks for the confirmation at least. I can't say I disagree with your position on this however it would be nice if you did support it and seems like a trivial and quick code change from my experience. Anyways I'll open an issue with the docker containers maintainer then.
I don't personally have anything against symlinks, I just don't want to sprinkle random bits of code throughout the game to handle issues with them as we find them. We both know, it's not *just* this one place that will have issues with symlinks - and that's the problem. It will be random, and then we have to go patch some piece of code somewhere but it's not just that one place and then somewhere else and somewhere else and it just doesn't stop.

It's just not worth our time.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Won't fix.”