Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to restart instance after a patched in file is deleted #611

Closed
Danielv123 opened this issue Apr 18, 2024 · 6 comments · Fixed by #613
Closed

Unable to restart instance after a patched in file is deleted #611

Danielv123 opened this issue Apr 18, 2024 · 6 comments · Fixed by #613
Labels

Comments

@Danielv123
Copy link
Member

I updated factorio from 1.1.104 to 1.1.107 using the ingame updater. After updating, I get the following error both on the host and in the web interface developer tools when attempting to restart the running instance to apply the update:

[error] TypeError: Cannot read properties of null (reading 'async')
at /Users/danielv/project_files/clusterio/packages/host/dist/node/src/patch.js:98:100
at Array.map ()
at SaveModule.fromSave (/Users/danielv/project_files/clusterio/packages/host/dist/node/src/patch.js:98:61)
at /Users/danielv/project_files/clusterio/packages/host/dist/node/src/patch.js:182:135
at Array.map ()
at PatchInfo.fromSave (/Users/danielv/project_files/clusterio/packages/host/dist/node/src/patch.js:182:115)
at patch (/Users/danielv/project_files/clusterio/packages/host/dist/node/src/patch.js:330:37)
at async Instance.prepareSave (/Users/danielv/project_files/clusterio/packages/host/dist/node/src/Instance.js:661:9)
at async Instance.handleInstanceStartRequest (/Users/danielv/project_files/clusterio/packages/host/dist/node/src/Instance.js:823:24)

The issue remains after restarting the host and controller, however does not apply to newly created instances.

@Danielv123 Danielv123 added the bug label Apr 18, 2024
@Hornwitser
Copy link
Member

In a patched save the clusterio.json file contains a list of all modules put into the save, and each modules have a "files" array with every file that was written into the save for that module. Error is thrown at

await Promise.all(json.files.map(async f => [f, await root.file(f)!.async("nodebuffer")] as const))
and indicates a file that was written into the save no longer exists. I guess Factorio didn't like the file and deleted it.

@Danielv123
Copy link
Member Author

Well thats interesting. Let me investigate what file it deleted

@Danielv123
Copy link
Member Author

Hm, looks like it got rid of the .gitignore in my module folder. Interesting. Guess I won't put it in there.

@Hornwitser
Copy link
Member

The error condition of a file being missing should be handled gracefully instead of giving a cryptic error.

@Hornwitser Hornwitser reopened this Apr 22, 2024
@Hornwitser Hornwitser changed the title Unable to restart instance after updating factorio Unable to restart instance after a patched in file is deleted Apr 22, 2024
@Danielv123
Copy link
Member Author

What would be the graceful way of handling this? Logging the missing file? Re-patching the save to include all the files?

@Hornwitser
Copy link
Member

Log a warning that the file went missing. The current patch logic already replaces all patched in files with files from the modules to patch in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants