[0.13.12] Factorio errors on game.write_file

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
Afforess
Filter Inserter
Filter Inserter
Posts: 422
Joined: Tue May 05, 2015 6:07 pm
Contact:

[0.13.12] Factorio errors on game.write_file

Post by Afforess »

Bug: Factorio game.write_file('foo', 'bar') or any combination of API calls to game.write_file fails if the user has symlinked the script-output directory to another location. No mods are required to reproduce, console commands show the error as well.

Steps to reproduce:

1. Symlink (or Hardlink on Windows) factorio/script-output to another directory (say, /tmp)
2. Launch new Factorio map
3. In console, execute /c game.write_file('foo', 'bar')

Error:

Code: Select all

Cannot execute command. Error: [string "game.write_file('foo', 'bar')"]:1: Scripts can only use file space inside of /home/afforess/.factorio/script-output (requested path was /home/afforess/.factorio/script-output/foo)
Not sure what the best solution here is, but doing this generates a whole lot of errors when users try to run mods, and they blame it on mods, instead of themselves. ;)

Rseding91
Factorio Staff
Factorio Staff
Posts: 11923
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.13.12] Factorio errors on game.write_file

Post by Rseding91 »

The solution: don't symlink script-output to a different folder.

The actual solution: we don't have one yet. The file system library we use doesn't work correctly with symlinks. It's a known issue.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Afforess
Filter Inserter
Filter Inserter
Posts: 422
Joined: Tue May 05, 2015 6:07 pm
Contact:

Re: [0.13.12] Factorio errors on game.write_file

Post by Afforess »

Rseding91 wrote:The solution: don't symlink script-output to a different folder.
*Points at silly users.*

I agree completely.
Rseding91 wrote:The actual solution: we don't have one yet. The file system library we use doesn't work correctly with symlinks. It's a known issue.
Yeah. I've got no easy answers either.

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: [0.13.12] Factorio errors on game.write_file

Post by prg »

Afforess wrote:
Rseding91 wrote:The solution: don't symlink script-output to a different folder.
*Points at silly users.*
Tell them to use a bind mount instead.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

posila
Factorio Staff
Factorio Staff
Posts: 5071
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [0.13.12] Factorio errors on game.write_file

Post by posila »

This might be solved in 0.13.14. I know for sure it is solved on Windows ... don't know about other platforms.
Let us know, if it is still problem in 0.13.14

pond247
Manual Inserter
Manual Inserter
Posts: 1
Joined: Fri Feb 17, 2017 8:22 am
Contact:

Re: [0.13.12] Factorio errors on game.write_file

Post by pond247 »

For Linux (in my case Arch Linux 64bi) the issue still exists in 14.22.

User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: [0.13.12] Factorio errors on game.write_file

Post by cube »

I can't reproduce this on my machine. Could you please post complete log file?

Post Reply

Return to “Resolved Problems and Bugs”