ECONNREFUSED server startup happens twice

I’m going to toss my two cents in as well, since I’m having similar issues:
Error communicating with Foundry VTT: connect ECONNREFUSED 10.10.254.119:15329
I can connect afterwards, but this issue appeared seemingly out of nowhere. I updated from v11 to v12 thinking it would fix the issue, but it did not.

I checked the Foundry logs, and noticed that the server performs its start-up procedure twice before it begins listening for clients to connect. Is that intended behaviour?
I am running Pathfinder 2e on Safe Configuration, v12 Stable 5, can provide log if needed.

If the world startup time is longer than 30 seconds, that message can be returned. That can happen for very large worlds or worlds that reference lots of compendiums, or worlds undergoing a migration on startup.

As mentioned here, we’re improving the feedback and extending the time waited for the server to startup and become ready, which should remove the disruption that the error causes.

You mention that the logs show that the startup happens twice before it begins listening for clients to connect, which isn’t intended behaviour to my understanding. Could I please ask you to provide logs detailing the timestamps and confirm whether you currently see the same happening on new start-ups?
Thank you!

Hi!
The log has been put into a pastebin and is linked below.

This is a brand-new log, detailing only the startup of the server that is already in Safe Configuration.
No modules aside from the mandatory Forge module is running.
Server was started from a completely offline state, not idle.
Server restarts at line 693. No errors were listed.

This is a brand-new log, after I re-enabled all used modules, closed down the server, and activated Safe Configuration before opening the server again.
Error was thrown at line 713, server restarts immediately afterwards.

This error exists solely on the current world.
I created a brand new PF2e server, and the server starts up only once, so the issue is limited to that particular server.

Interesting! Could I perhaps ask if you’d be willing to DM me a link to an export of that world? That might help us replicate the issue and find out exactly what is going on so that we can address it :pray:

I’m seeing the same thing with my world. Runs all the way through startup, then throws the same error and starts over again:

2024-07-23 19:50:02 [error] Cannot destructure property ‘pack’ of ‘n’ as it is undefined.
TypeError: Cannot destructure property ‘pack’ of ‘n’ as it is undefined.
at ServerDatabaseBackend.modifyDocument (file:///opt/foundryvtt/dist/database/backend/server-backend.mjs:1:1108)
at #e (file:///opt/foundryvtt/dist/database/backend/server-backend.mjs:1:834)
at Socket.emit (node:events:513:28)
at Socket.emitUntyped (/opt/foundryvtt/node_modules/socket.io/dist/typed-events.js:69:22)
at /opt/foundryvtt/node_modules/socket.io/dist/socket.js:704:39
at process.processTicksAndRejections (node:internal/process/task_queues:77:11)

Update to my last post, looks like it doesn’t always throw an error. Sometimes, it just restarts the process midway through the launch:

2024-07-26 02:41:43 [info] Foundry Virtual Tabletop - Version 12 Build 330
2024-07-26 02:41:43 [info] Running on Node.js - Version 18.16.0
2024-07-26 02:41:40 [info] Launching World | Migrating Package Data - 27%
2024-07-26 02:41:40 [info] Launching World | Migrating Package Data - 26%

Hey there :wave:

That’s very interesting. If you’re willing, could I please ask you to PM a link to an export of your world to me as well? If there is a recurring an uncaught error during startup that surfaces with this specific world data I would be able to funnel that report through to Foundry so that they could catch it