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

Discord Round Winner plugin error #391

Open
pavelhoral opened this issue Nov 21, 2024 · 12 comments
Open

Discord Round Winner plugin error #391

pavelhoral opened this issue Nov 21, 2024 · 12 comments
Labels
core bug Bug related to the core SquadJS API

Comments

@pavelhoral
Copy link
Contributor

Description of Issue

SquadJS very often crashes in discord-round-winner plugin (see bellow).

Errors or Screenshots of Issue

Squad Information

  • SquadJS Version: 4.1.0
  • Squad Version: the most recent

This is the SquadJS log before the crash (it happens quite often):

[2024-11-17T18:26:07.691Z][SquadServer][1] Updated layer information.
[2024-11-17T18:26:09.309Z][SquadServer][1] Updating squad list...
[2024-11-17T18:26:09.340Z][SquadServer][1] Updated squad list.
[2024-11-17T18:26:20.555Z][SquadServer][1] Fetching Admin Lists...
[2024-11-17T18:26:20.591Z][SquadServer][1] 386 admins loaded...
file:///home/container/squad-server/plugins/discord-round-winner.js:51
            value: `${info.winner} won on ${this.server.layerHistory[1].layer.name}.`
                                                                              ^

TypeError: Cannot read properties of null (reading 'name')
    at DiscordRoundWinner.onNewGame (file:///home/container/squad-server/plugins/discord-round-winner.js:51:79)
    at SquadServer.emit (node:events:531:35)
    at SquadLogParser.<anonymous> (file:///home/container/squad-server/index.js:208:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

This specific crash appeared after Manicouagan RAAS v2 - Manicouagan map ended.

System Information

  • Operating System: Linux with Squad and SquadJS in Docker containers (Pterodactyl)
  • NodeJS Version: 21 (Pterodactyl egg)
  • Yarn Version: (whatever Pterodactyl egg uses)
@pavelhoral pavelhoral added the core bug Bug related to the core SquadJS API label Nov 21, 2024
@pavelhoral
Copy link
Contributor Author

This is contents of the layerHistory just before a different crash:

[
    {
        "layer": {
            "name": "Gorodok Invasion v2",
            "classname": "Gorodok_Invasion_v2",
            "layerid": "Gorodok_Invasion_v2",
            "map": {
                "name": "Gorodok"
            },
            "gamemode": "Invasion",
            "version": "v2",
            "size": "4.0x4.0 km",
            "sizeType": "spline",
            "numberOfCapturePoints": null,
            "lighting": {
                "name": "Overcast",
                "classname": "LL_Gorodok_Overcast"
            },
            "teams": [
                {
                    "faction": "Russian Airborne Forces",
                    "name": "108th Guards Air Assault Regiment",
                    "tickets": 200,
                    "commander": true,
                    "vehicles": [
                        {
                            "name": "KamAZ 5350 Transport",
                            "classname": "BP_Kamaz_5350_C",
                            "count": 1,
                            "spawnDelay": 6,
                            "respawnDelay": 3
                        },
                        {
                            "name": "KamAZ 5350 Logistics",
                            "classname": "BP_Kamaz_5350_Logi_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "BTR-DG Logistics",
                            "classname": "BP_BTR-DG_Logistics_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "BTR-DG Logistics",
                            "classname": "BP_BTR-DG_Logistics_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "BTR-MDM",
                            "classname": "BP_BTRMDM_PKT_RWS_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 6
                        },
                        {
                            "name": "BTR-D Kord",
                            "classname": "BP_BTR-D_Kord_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 6
                        },
                        {
                            "name": "BMD-1M",
                            "classname": "BP_BMD1M_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 10
                        },
                        {
                            "name": "BMD-4M",
                            "classname": "BP_BMD4M_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 15
                        },
                        {
                            "name": "BMD-4M",
                            "classname": "BP_BMD4M_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 15
                        },
                        {
                            "name": "Sprut-SDM1",
                            "classname": "BP_Sprut_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 15
                        },
                        {
                            "name": "T-72B3",
                            "classname": "BP_T72B3_C",
                            "count": 1,
                            "spawnDelay": 10,
                            "respawnDelay": 20
                        },
                        {
                            "name": "Mi-8",
                            "classname": "BP_MI8_VDV_C",
                            "count": 1,
                            "spawnDelay": 10,
                            "respawnDelay": 6
                        }
                    ],
                    "numberOfTanks": 1,
                    "numberOfHelicopters": 1
                },
                {
                    "faction": "Irregular Militia Forces",
                    "name": "Local Militia Brigade",
                    "tickets": 900,
                    "commander": true,
                    "vehicles": [
                        {
                            "name": "Armored Ural-375D Transport",
                            "classname": "BP_Armored_Ural_375_MIL_C",
                            "count": 1,
                            "spawnDelay": 6,
                            "respawnDelay": 3
                        },
                        {
                            "name": "Armored Ural-375D Logistics",
                            "classname": "BP_Armored_Ural_375_Logi_MIL_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "Ural-375D Logistics",
                            "classname": "BP_Ural_375_Logi_MIL_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "Logistics Modern Pickup",
                            "classname": "BP_Technical4Seater_Logi_Camo_C",
                            "count": 2,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "Armored Logistics Modern Pickup",
                            "classname": "BP_Armored_Technical4Seater_Logi_Camo_C",
                            "count": 2,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "Modern Technical DShK",
                            "classname": "BP_Technical2Seater_Camo_DSHK_C",
                            "count": 2,
                            "spawnDelay": 0,
                            "respawnDelay": 5
                        },
                        {
                            "name": "Armored Modern Technical M2 HB",
                            "classname": "BP_Armored_Technical2Seater_Camo_M2_C",
                            "count": 2,
                            "spawnDelay": 0,
                            "respawnDelay": 5
                        },
                        {
                            "name": "Armored Modern Technical SPG-9",
                            "classname": "BP_Armored_Technical2Seater_Camo_SPG9_C",
                            "count": 2,
                            "spawnDelay": 0,
                            "respawnDelay": 10
                        },
                        {
                            "name": "MT-LBM 6MB",
                            "classname": "BP_MTLBM_6MB_MIL_C",
                            "count": 3,
                            "spawnDelay": 0,
                            "respawnDelay": 10
                        },
                        {
                            "name": "MT-LB ZU-23-2",
                            "classname": "BP_MTLB_ZU23_MIL_C",
                            "count": 2,
                            "spawnDelay": 0,
                            "respawnDelay": 6
                        },
                        {
                            "name": "T-62",
                            "classname": "BP_T62_MIL_C",
                            "count": 1,
                            "spawnDelay": 15,
                            "respawnDelay": 15
                        },
                        {
                            "name": "BM-21 Grad",
                            "classname": "BP_BM21Grad_MIL_C",
                            "count": 1,
                            "spawnDelay": 15,
                            "respawnDelay": 10
                        }
                    ],
                    "numberOfTanks": 1,
                    "numberOfHelicopters": 0
                }
            ]
        },
        "time": "2024-11-20T19:07:39.057Z"
    },
    {
        "layer": null,
        "time": "2024-11-20T18:09:08.946Z"
    },
    {
        "layer": {
            "name": "Narva RAAS v1",
            "classname": "Narva_RAAS_v1",
            "layerid": "Narva_RAAS_v1",
            "map": {
                "name": "Narva"
            },
            "gamemode": "RAAS",
            "version": "v1",
            "size": "2.7x2.5 km",
            "sizeType": "spline",
            "numberOfCapturePoints": null,
            "lighting": {
                "name": "Partial Clouds Mid Day",
                "classname": "LL_Narva_MidDay_Clouds"
            },
            "teams": [
                {
                    "faction": "United States Army",
                    "name": "III Corps",
                    "tickets": 300,
                    "commander": true,
                    "vehicles": [
                        {
                            "name": "M1126 CROWS M2",
                            "classname": "BP_M1126_Woodland_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 10
                        },
                        {
                            "name": "M1126 CROWS M2",
                            "classname": "BP_M1126_Woodland_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 10
                        },
                        {
                            "name": "M2A3",
                            "classname": "BP_BFV_Woodland_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 14
                        },
                        {
                            "name": "M939 Logistics",
                            "classname": "BP_US_Util_Woodland_Logi_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "M939 Logistics",
                            "classname": "BP_US_Util_Woodland_Logi_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "M-ATV M2",
                            "classname": "BP_MATV_Woodland_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 6
                        },
                        {
                            "name": "M939 Logistics",
                            "classname": "BP_US_Util_Woodland_Logi_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "M1A2",
                            "classname": "BP_M1A2_Woodland_C",
                            "count": 1,
                            "spawnDelay": 15,
                            "respawnDelay": 20
                        },
                        {
                            "name": "M939 Transport",
                            "classname": "BP_US_Util_Woodland_C",
                            "count": 1,
                            "spawnDelay": 6,
                            "respawnDelay": 3
                        },
                        {
                            "name": "M-ATV M2",
                            "classname": "BP_MATV_Woodland_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 6
                        }
                    ],
                    "numberOfTanks": 1,
                    "numberOfHelicopters": 0
                },
                {
                    "faction": "Russian Ground Forces",
                    "name": "49th Combined Arms Army",
                    "tickets": 300,
                    "commander": true,
                    "vehicles": [
                        {
                            "name": "BTR-82A",
                            "classname": "BP_BTR82A_RUS_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 10
                        },
                        {
                            "name": "BMP-2",
                            "classname": "BP_BMP2_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 14
                        },
                        {
                            "name": "BTR-82A",
                            "classname": "BP_BTR82A_RUS_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 10
                        },
                        {
                            "name": "KamAZ 5350 Logistics",
                            "classname": "BP_Kamaz_5350_Logi_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "KamAZ 5350 Logistics",
                            "classname": "BP_Kamaz_5350_Logi_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "KamAZ 5350 Logistics",
                            "classname": "BP_Kamaz_5350_Logi_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "Tigr-M RWS Kord",
                            "classname": "BP_Tigr_RWS_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 6
                        },
                        {
                            "name": "T-72B3",
                            "classname": "BP_T72B3_C",
                            "count": 1,
                            "spawnDelay": 15,
                            "respawnDelay": 20
                        },
                        {
                            "name": "KamAZ 5350 Transport",
                            "classname": "BP_Kamaz_5350_C",
                            "count": 1,
                            "spawnDelay": 6,
                            "respawnDelay": 3
                        },
                        {
                            "name": "BTR-80",
                            "classname": "BP_BTR80_RUS_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 6
                        }
                    ],
                    "numberOfTanks": 1,
                    "numberOfHelicopters": 0
                }
            ]
        },
        "time": "2024-11-20T17:13:53.046Z"
    },
    {
        "layer": {
            "name": "Kokan AAS v1",
            "classname": "Kokan_AAS_v1",
            "layerid": "Kokan_AAS_v1",
            "map": {
                "name": "Kokan"
            },
            "gamemode": "AAS",
            "version": "v1",
            "size": "2.5x2.5 km",
            "sizeType": "mapTexture",
            "numberOfCapturePoints": null,
            "lighting": {
                "name": "Sunny Mid Day",
                "classname": "LL_Kokan_Valley_MidDay_Sunny"
            },
            "teams": [
                {
                    "faction": "United States Army",
                    "name": "III Corps",
                    "tickets": 250,
                    "commander": false,
                    "vehicles": [
                        {
                            "name": "M939 Transport",
                            "classname": "BP_US_Util_Desert_C",
                            "count": 1,
                            "spawnDelay": 6,
                            "respawnDelay": 3
                        },
                        {
                            "name": "M939 Logistics",
                            "classname": "BP_US_Util_Desert_Logi_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "M939 Logistics",
                            "classname": "BP_US_Util_Desert_Logi_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "M939 Logistics",
                            "classname": "BP_US_Util_Desert_Logi_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "M-ATV M240",
                            "classname": "BP_MATV_M240_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 6
                        },
                        {
                            "name": "M-ATV M240",
                            "classname": "BP_MATV_M240_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 6
                        },
                        {
                            "name": "M-ATV M240",
                            "classname": "BP_MATV_M240_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 6
                        },
                        {
                            "name": "M-ATV CROWS M2",
                            "classname": "BP_MATV_CROWS_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 6
                        },
                        {
                            "name": "RHIB M240",
                            "classname": "BP_RHIB_US_M240_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 1
                        }
                    ],
                    "numberOfTanks": 0,
                    "numberOfHelicopters": 0
                },
                {
                    "faction": "People's Liberation Army",
                    "name": "2nd Heavy Combined Arms Brigade",
                    "tickets": 250,
                    "commander": false,
                    "vehicles": [
                        {
                            "name": "CTM131 Transport QJY88",
                            "classname": "BP_CTM131_Desert_C",
                            "count": 1,
                            "spawnDelay": 6,
                            "respawnDelay": 3
                        },
                        {
                            "name": "CTM131 Logistics",
                            "classname": "BP_CTM131_Logistic_Desert_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "CTM131 Logistics",
                            "classname": "BP_CTM131_Logistic_Desert_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "CTM131 Logistics",
                            "classname": "BP_CTM131_Logistic_Desert_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "CSK131 QJY88",
                            "classname": "BP_CSK131_QJY88_Desert_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 5
                        },
                        {
                            "name": "CTM131 Transport QJZ89",
                            "classname": "BP_CTM131_QJZ89_Desert_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 6
                        },
                        {
                            "name": "CSK131 QJC88 RWS",
                            "classname": "BP_CSK131_RWS_Desert_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 6
                        },
                        {
                            "name": "RHIB QJY88",
                            "classname": "BP_RHIB_QJY88_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 1
                        }
                    ],
                    "numberOfTanks": 0,
                    "numberOfHelicopters": 0
                }
            ]
        },
        "time": "2024-11-20T16:20:52.825Z"
    },
    {
        "layer": {
            "name": "Sumari Bala Seed v1",
            "classname": "Sumari_Seed_v1",
            "layerid": "Sumari_Seed_v1",
            "map": {
                "name": "Sumari Bala"
            },
            "gamemode": "Seed",
            "version": "v1",
            "size": "1.3x1.3 km",
            "sizeType": "mapTexture",
            "numberOfCapturePoints": null,
            "lighting": {
                "name": "Sunny Mid Day",
                "classname": "LL_Sumari_MidDay"
            },
            "teams": [
                {
                    "faction": "United States Army",
                    "name": "III Corps",
                    "tickets": 100,
                    "commander": false,
                    "vehicles": [
                        {
                            "name": "M939 Transport",
                            "classname": "BP_US_Util_Desert_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "M939 Transport",
                            "classname": "BP_US_Util_Desert_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "M939 Transport",
                            "classname": "BP_US_Util_Desert_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "M939 Logistics",
                            "classname": "BP_US_Util_Desert_Logi_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "M939 Logistics",
                            "classname": "BP_US_Util_Desert_Logi_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "M939 Logistics",
                            "classname": "BP_US_Util_Desert_Logi_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "M939 Logistics",
                            "classname": "BP_US_Util_Desert_Logi_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 0
                        }
                    ],
                    "numberOfTanks": 0,
                    "numberOfHelicopters": 0
                },
                {
                    "faction": "Russian Ground Forces",
                    "name": "49th Combined Arms Army",
                    "tickets": 100,
                    "commander": false,
                    "vehicles": [
                        {
                            "name": "KamAZ 5350 Transport",
                            "classname": "BP_Kamaz_5350_Desert_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "KamAZ 5350 Transport",
                            "classname": "BP_Kamaz_5350_Desert_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "KamAZ 5350 Transport",
                            "classname": "BP_Kamaz_5350_Desert_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "KamAZ 5350 Logistics",
                            "classname": "BP_Kamaz_5350_Logi_Desert_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "KamAZ 5350 Logistics",
                            "classname": "BP_Kamaz_5350_Logi_Desert_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "KamAZ 5350 Logistics",
                            "classname": "BP_Kamaz_5350_Logi_Desert_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "KamAZ 5350 Logistics",
                            "classname": "BP_Kamaz_5350_Logi_Desert_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 0
                        }
                    ],
                    "numberOfTanks": 0,
                    "numberOfHelicopters": 0
                }
            ]
        },
        "time": "2024-11-20T06:00:21.519Z"
    },
    {
        "layer": {
            "name": "Sumari Bala Seed v1",
            "classname": "Sumari_Seed_v1",
            "layerid": "Sumari_Seed_v1",
            "map": {
                "name": "Sumari Bala"
            },
            "gamemode": "Seed",
            "version": "v1",
            "size": "1.3x1.3 km",
            "sizeType": "mapTexture",
            "numberOfCapturePoints": null,
            "lighting": {
                "name": "Sunny Mid Day",
                "classname": "LL_Sumari_MidDay"
            },
            "teams": [
                {
                    "faction": "United States Army",
                    "name": "III Corps",
                    "tickets": 100,
                    "commander": false,
                    "vehicles": [
                        {
                            "name": "M939 Transport",
                            "classname": "BP_US_Util_Desert_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "M939 Transport",
                            "classname": "BP_US_Util_Desert_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "M939 Transport",
                            "classname": "BP_US_Util_Desert_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "M939 Logistics",
                            "classname": "BP_US_Util_Desert_Logi_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "M939 Logistics",
                            "classname": "BP_US_Util_Desert_Logi_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "M939 Logistics",
                            "classname": "BP_US_Util_Desert_Logi_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "M939 Logistics",
                            "classname": "BP_US_Util_Desert_Logi_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 0
                        }
                    ],
                    "numberOfTanks": 0,
                    "numberOfHelicopters": 0
                },
                {
                    "faction": "Russian Ground Forces",
                    "name": "49th Combined Arms Army",
                    "tickets": 100,
                    "commander": false,
                    "vehicles": [
                        {
                            "name": "KamAZ 5350 Transport",
                            "classname": "BP_Kamaz_5350_Desert_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "KamAZ 5350 Transport",
                            "classname": "BP_Kamaz_5350_Desert_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "KamAZ 5350 Transport",
                            "classname": "BP_Kamaz_5350_Desert_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "KamAZ 5350 Logistics",
                            "classname": "BP_Kamaz_5350_Logi_Desert_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "KamAZ 5350 Logistics",
                            "classname": "BP_Kamaz_5350_Logi_Desert_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "KamAZ 5350 Logistics",
                            "classname": "BP_Kamaz_5350_Logi_Desert_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 3
                        },
                        {
                            "name": "KamAZ 5350 Logistics",
                            "classname": "BP_Kamaz_5350_Logi_Desert_C",
                            "count": 1,
                            "spawnDelay": 0,
                            "respawnDelay": 0
                        }
                    ],
                    "numberOfTanks": 0,
                    "numberOfHelicopters": 0
                }
            ]
        },
        "time": 1732082421798
    }
]

I guess this is the culprit:

    {
        "layer": null,
        "time": "2024-11-20T18:09:08.946Z"
    },

@pavelhoral
Copy link
Contributor Author

From Discord I can see that the "null" map was supposed to be Manicouagan RAAS v1 - Manicouagan (Discord timezone in the screenshot is CET / +1):

image

@steelskillet
Copy link
Contributor

Can you provide the full log with crash. This is most likely a configuration problem and nothing is actually wrong with sjs itself.

@pavelhoral
Copy link
Contributor Author

output-2024-11-20T06_00_13.204Z.log

The log contains also stringified layerHistory where DEBUG log by Palko can be seen.

image

@steelskillet
Copy link
Contributor

steelskillet commented Nov 22, 2024

[2024-11-20T06:00:15.908Z][SquadServer][1] Updating squad list...
[2024-11-20T06:00:21.633Z][SquadServer][1] Updated squad list. 
[2024-11-20T06:00:21.633Z][SquadServer][1] Updating player list...
[2024-11-20T06:00:21.695Z][SquadServer][1] Updated player list. 
[2024-11-20T06:00:21.695Z][SquadServer][1] Updating layer information... 
[2024-11-20T06:00:21.798Z][SquadServer][1] Updated layer information. 
[2024-11-20T06:00:21.798Z][SquadServer][1] Updating server information... 
[2024-11-20T06:00:21.839Z][SquadServer][1] Updated server information. 
[2024-11-20T06:00:21.839Z][LogParser][1] Attempting to watch log file... 
[2024-11-20T06:00:22.262Z][LogParser][1] Watching log file... 
[2024-11-20T06:00:22.262Z][SquadServer][1] Watching undefined... 
[2024-11-20T06:00:22.262Z][SquadServer][1] Pinging SquadJS API... 
[2024-11-20T06:00:22.419Z][SquadServer][1] Successfully pinged the SquadJS API. Got back error: Invalid ping. 
[2024-11-20T06:00:22.430Z][SquadServer][1] Fetching Admin Lists... 
[2024-11-20T06:00:22.501Z][SquadServer][1] 388 admins loaded...

As I suspected this is infact a config issue. Your squadjs is not properly connected to your log file. It should read watching <name of server> not undefined.

@pavelhoral
Copy link
Contributor Author

pavelhoral commented Nov 22, 2024

As I suspected this is infact a config issue. Your squadjs is not properly connected to your log file. It should read watching not undefined.

This is strange. We are using SFTP log reader mode and I can confirm we are getting LogParser events (as seen in the attached log). So this works. Maybe the issue is caused by the log parser initializing before the server fully loads up (we do periodic restarts at 6 AM)? If that is the case it is a very nasty race condition.

@pavelhoral
Copy link
Contributor Author

Attaching log excerpts from today's crash (you can see that the log parsing is configured correctly):

...
[2024-12-05T06:15:09.165Z][SquadServer][1] Updating server information...
[2024-12-05T06:15:09.206Z][SquadServer][1] Updated server information.
[2024-12-05T06:15:09.206Z][LogParser][1] Attempting to watch log file...
[2024-12-05T06:15:09.617Z][LogParser][1] Watching log file...
[2024-12-05T06:15:09.617Z][SquadServer][1] Watching RallyPoint | Teamplay Focused | Sponsored by [CI]...
[2024-12-05T06:15:09.617Z][SquadServer][1] Pinging SquadJS API...
[2024-12-05T06:15:09.896Z][SquadServer][1] Successfully pinged the SquadJS API. Got back message: Pong.
[2024-12-05T06:15:09.942Z][SocketIOAPI][1] New Connection Made.
[2024-12-05T06:15:09.942Z][SocketIOAPI][1] Setting method listener for restartRCON...
[2024-12-05T06:15:09.942Z][SocketIOAPI][1] Setting method listener for restartLogParser...
...
...
DEBUG log by Palko
[{"layer":{"name":"Yehorivka Invasion v1","classname":"Yehorivka_Invasion_v1","layerid":"Yehorivka_Invasion_v1","map":{"name":"Yehorivka"},"gamemode":"Invasion","version":"v1","size":"5.0x5.0 km","sizeType":"spline","numberOfCapturePoints":null,"lighting":{"name":"Sunrise","classname":"LL_Yehorivka_Sunrise"},"teams":[{"faction":"British Armed Forces","name":"1st Battalion Yorkshire Regiment","tickets":200,"commander":true,"vehicles":[{"name":"HX60 Transport","classname":"BP_Brit_Util_Truck_Woodland_C","count":1,"spawnDelay":6,"respawnDelay":3},{"name":"HX60 Logistics","classname":"BP_Brit_Util_Truck_Logi_Woodland_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"HX60 Logistics","classname":"BP_Brit_Util_Truck_Logi_Woodland_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"HX60 Logistics","classname":"BP_Brit_Util_Truck_Logi_Woodland_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"FV432","classname":"BP_FV432_woodland_C","count":1,"spawnDelay":0,"respawnDelay":6},{"name":"FV432","classname":"BP_FV432_woodland_C","count":1,"spawnDelay":0,"respawnDelay":6},{"name":"FV432 RWS","classname":"BP_FV432_RWS_Woodland_C","count":1,"spawnDelay":0,"respawnDelay":6},{"name":"FV107","classname":"BP_FV107_Woodland_C","count":1,"spawnDelay":0,"respawnDelay":10},{"name":"FV510","classname":"BP_FV510_Woodland_C","count":1,"spawnDelay":0,"respawnDelay":10},{"name":"FV510 UA","classname":"BP_FV510UA_Woodland_C","count":1,"spawnDelay":0,"respawnDelay":10},{"name":"FV510 UA","classname":"BP_FV510UA_Woodland_C","count":1,"spawnDelay":0,"respawnDelay":10},{"name":"FV4034","classname":"BP_FV4034_Woodland_C","count":1,"spawnDelay":0,"respawnDelay":20},{"name":"SA330","classname":"BP_SA330_C","count":1,"spawnDelay":10,"respawnDelay":6}],"numberOfTanks":1,"numberOfHelicopters":1},{"faction":"Irregular Militia Forces","name":"Local Militia Brigade","tickets":900,"commander":true,"vehicles":[{"name":"Logistics Modern Pickup","classname":"BP_Technical4Seater_Logi_Camo_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"Armored Ural-375D Transport","classname":"BP_Armored_Ural_375_MIL_C","count":1,"spawnDelay":6,"respawnDelay":3},{"name":"Armored Ural-375D Logistics","classname":"BP_Armored_Ural_375_Logi_MIL_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"Armored Ural-375D Logistics","classname":"BP_Armored_Ural_375_Logi_MIL_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"Armored Ural-375D Logistics","classname":"BP_Armored_Ural_375_Logi_MIL_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"Armored Logistics Modern Pickup","classname":"BP_Armored_Technical4Seater_Logi_Camo_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"Logistics Modern Pickup","classname":"BP_Technical4Seater_Logi_Camo_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"Modern Technical M2 HB","classname":"BP_Technical2Seater_Camo_M2_C","count":1,"spawnDelay":0,"respawnDelay":5},{"name":"Armored Modern Technical DShK","classname":"BP_Armored_Technical2Seater_Camo_DSHK_C","count":1,"spawnDelay":0,"respawnDelay":5},{"name":"Tigr-M Kord","classname":"BP_Tigr_MIL_C","count":1,"spawnDelay":0,"respawnDelay":6},{"name":"Armored Modern Technical SPG-9","classname":"BP_Armored_Technical2Seater_Camo_SPG9_C","count":1,"spawnDelay":0,"respawnDelay":10},{"name":"MT-LB VMK","classname":"BP_MTLB_VMK_MIL_C","count":1,"spawnDelay":0,"respawnDelay":6},{"name":"MT-LB ZU-23-2","classname":"BP_MTLB_ZU23_MIL_C","count":1,"spawnDelay":0,"respawnDelay":10},{"name":"BMP-1","classname":"BP_BMP1_MIL_C","count":1,"spawnDelay":0,"respawnDelay":10},{"name":"BMP-2","classname":"BP_BMP2_IMF_C","count":1,"spawnDelay":0,"respawnDelay":10},{"name":"BM-21 Grad","classname":"BP_BM21Grad_MIL_C","count":1,"spawnDelay":10,"respawnDelay":10},{"name":"T-62","classname":"BP_T62_MIL_C","count":1,"spawnDelay":15,"respawnDelay":15}],"numberOfTanks":1,"numberOfHelicopters":0}]},"time":"2024-12-05T19:28:22.819Z"},{"layer":null,"time":"2024-12-05T18:51:12.523Z"},{"layer":{"name":"Black Coast RAAS v1","classname":"BlackCoast_RAAS_v1","layerid":"BlackCoast_RAAS_v1","map":{"name":"Black Coast"},"gamemode":"RAAS","version":"v1","size":"4.0x4.6 km","sizeType":"spline","numberOfCapturePoints":null,"lighting":{},"teams":[{"faction":"United States Marine Corps","name":"4th Assault Amphibian Battalion","tickets":300,"commander":true,"vehicles":[{"name":"M939 Transport","classname":"BP_US_Util_USMC_Woodland_C","count":1,"spawnDelay":6,"respawnDelay":3},{"name":"AAVC-7A1 Logistics","classname":"BP_AAVP7A1_Woodland_Logi_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"M939 Logistics","classname":"BP_US_Util_USMC_Woodland_Logi_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"M1151 M2","classname":"BP_M1151_Woodland_C","count":1,"spawnDelay":0,"respawnDelay":6},{"name":"M1151 M2","classname":"BP_M1151_Woodland_C","count":1,"spawnDelay":0,"respawnDelay":6},{"name":"AAVP-7A1","classname":"BP_AAVP7A1_Woodland_C","count":1,"spawnDelay":0,"respawnDelay":10},{"name":"AAVP-7A1","classname":"BP_AAVP7A1_Woodland_C","count":1,"spawnDelay":0,"respawnDelay":10},{"name":"LAV-25","classname":"BP_LAV25_Woodland_C","count":1,"spawnDelay":0,"respawnDelay":10},{"name":"LAV-25","classname":"BP_LAV25_Woodland_C","count":1,"spawnDelay":0,"respawnDelay":10},{"name":"M1A1","classname":"BP_M1A1_USMC_Woodland_C","count":1,"spawnDelay":10,"respawnDelay":20},{"name":"UH-1Y","classname":"BP_UH1Y_C","count":1,"spawnDelay":6,"respawnDelay":6},{"name":"UH-1Y","classname":"BP_UH1Y_C","count":1,"spawnDelay":6,"respawnDelay":6}],"numberOfTanks":1,"numberOfHelicopters":2},{"faction":"Russian Airborne Forces","name":"7th Guards Mountain Air Assault Division","tickets":300,"commander":true,"vehicles":[{"name":"KamAZ 5350 Transport","classname":"BP_Kamaz_5350_C","count":1,"spawnDelay":6,"respawnDelay":3},{"name":"KamAZ 5350 Logistics","classname":"BP_Kamaz_5350_Logi_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"BTR-DG Logistics","classname":"BP_BTR-DG_Logistics_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"BTR-D Kord","classname":"BP_BTR-D_Kord_C","count":1,"spawnDelay":0,"respawnDelay":6},{"name":"BTR-MDM","classname":"BP_BTRMDM_PKT_RWS_C","count":1,"spawnDelay":0,"respawnDelay":6},{"name":"BTR-ZD","classname":"BP_BTR-ZD_C","count":1,"spawnDelay":0,"respawnDelay":6},{"name":"BMD-4M","classname":"BP_BMD4M_C","count":1,"spawnDelay":0,"respawnDelay":15},{"name":"Sprut-SDM1","classname":"BP_Sprut_C","count":1,"spawnDelay":0,"respawnDelay":15},{"name":"T-72B3","classname":"BP_T72B3_C","count":1,"spawnDelay":10,"respawnDelay":20},{"name":"Mi-8","classname":"BP_MI8_VDV_C","count":1,"spawnDelay":6,"respawnDelay":6},{"name":"Mi-8","classname":"BP_MI8_VDV_C","count":1,"spawnDelay":6,"respawnDelay":6}],"numberOfTanks":1,"numberOfHelicopters":2}]},"time":"2024-12-05T17:46:52.596Z"},{"layer":{"name":"Narva AAS v1","classname":"Narva_AAS_v1","layerid":"Narva_AAS_v1","map":{"name":"Narva"},"gamemode":"AAS","version":"v1","size":"2.7x2.5 km","sizeType":"spline","numberOfCapturePoints":null,"lighting":{"name":"Partial Clouds Mid Day","classname":"LL_Narva_MidDay_Clouds"},"teams":[{"faction":"United States Army","name":"III Corps","tickets":300,"commander":true,"vehicles":[{"name":"M1126 CROWS M2","classname":"BP_M1126_Woodland_C","count":1,"spawnDelay":0,"respawnDelay":10},{"name":"M1126 CROWS M2","classname":"BP_M1126_Woodland_C","count":1,"spawnDelay":0,"respawnDelay":10},{"name":"M1126 CROWS M2","classname":"BP_M1126_Woodland_C","count":1,"spawnDelay":0,"respawnDelay":10},{"name":"M939 Logistics","classname":"BP_US_Util_Woodland_Logi_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"M939 Logistics","classname":"BP_US_Util_Woodland_Logi_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"M-ATV M2","classname":"BP_MATV_Woodland_C","count":1,"spawnDelay":0,"respawnDelay":6},{"name":"M-ATV M2","classname":"BP_MATV_Woodland_C","count":1,"spawnDelay":0,"respawnDelay":6},{"name":"M939 Logistics","classname":"BP_US_Util_Woodland_Logi_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"M939 Transport","classname":"BP_US_Util_Woodland_C","count":1,"spawnDelay":6,"respawnDelay":3}],"numberOfTanks":0,"numberOfHelicopters":0},{"faction":"Russian Ground Forces","name":"49th Combined Arms Army","tickets":300,"commander":true,"vehicles":[{"name":"BTR-82A","classname":"BP_BTR82A_RUS_C","count":1,"spawnDelay":0,"respawnDelay":10},{"name":"BTR-80","classname":"BP_BTR80_RUS_C","count":1,"spawnDelay":0,"respawnDelay":6},{"name":"Tigr-M Kord","classname":"BP_Tigr_C","count":1,"spawnDelay":0,"respawnDelay":6},{"name":"BTR-82A","classname":"BP_BTR82A_RUS_C","count":1,"spawnDelay":0,"respawnDelay":10},{"name":"KamAZ 5350 Logistics","classname":"BP_Kamaz_5350_Logi_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"KamAZ 5350 Logistics","classname":"BP_Kamaz_5350_Logi_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"KamAZ 5350 Logistics","classname":"BP_Kamaz_5350_Logi_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"KamAZ 5350 Transport","classname":"BP_Kamaz_5350_C","count":1,"spawnDelay":6,"respawnDelay":3},{"name":"Tigr-M RWS Kord","classname":"BP_Tigr_RWS_C","count":1,"spawnDelay":0,"respawnDelay":6}],"numberOfTanks":0,"numberOfHelicopters":0}]},"time":"2024-12-05T17:02:15.875Z"},{"layer":{"name":"Sumari Bala Seed v1","classname":"Sumari_Seed_v1","layerid":"Sumari_Seed_v1","map":{"name":"Sumari Bala"},"gamemode":"Seed","version":"v1","size":"1.3x1.3 km","sizeType":"mapTexture","numberOfCapturePoints":null,"lighting":{"name":"Sunny Mid Day","classname":"LL_Sumari_MidDay"},"teams":[{"faction":"United States Army","name":"III Corps","tickets":100,"commander":false,"vehicles":[{"name":"M939 Transport","classname":"BP_US_Util_Desert_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"M939 Transport","classname":"BP_US_Util_Desert_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"M939 Transport","classname":"BP_US_Util_Desert_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"M939 Logistics","classname":"BP_US_Util_Desert_Logi_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"M939 Logistics","classname":"BP_US_Util_Desert_Logi_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"M939 Logistics","classname":"BP_US_Util_Desert_Logi_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"M939 Logistics","classname":"BP_US_Util_Desert_Logi_C","count":1,"spawnDelay":0,"respawnDelay":0}],"numberOfTanks":0,"numberOfHelicopters":0},{"faction":"Russian Ground Forces","name":"49th Combined Arms Army","tickets":100,"commander":false,"vehicles":[{"name":"KamAZ 5350 Transport","classname":"BP_Kamaz_5350_Desert_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"KamAZ 5350 Transport","classname":"BP_Kamaz_5350_Desert_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"KamAZ 5350 Transport","classname":"BP_Kamaz_5350_Desert_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"KamAZ 5350 Logistics","classname":"BP_Kamaz_5350_Logi_Desert_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"KamAZ 5350 Logistics","classname":"BP_Kamaz_5350_Logi_Desert_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"KamAZ 5350 Logistics","classname":"BP_Kamaz_5350_Logi_Desert_C","count":1,"spawnDelay":0,"respawnDelay":3},{"name":"KamAZ 5350 Logistics","classname":"BP_Kamaz_5350_Logi_Desert_C","count":1,"spawnDelay":0,"respawnDelay":0}],"numberOfTanks":0,"numberOfHelicopters":0}]},"time":1733379309165}]
file:///home/container/squad-server/plugins/discord-round-winner.js:53
            value: `${info.winner} won on ${this.server.layerHistory[1].layer.name}.`
                                                                              ^

TypeError: Cannot read properties of null (reading 'name')
    at DiscordRoundWinner.onNewGame (file:///home/container/squad-server/plugins/discord-round-winner.js:53:79)
    at SquadServer.emit (node:events:531:35)
    at SquadLogParser.<anonymous> (file:///home/container/squad-server/index.js:208:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

@pavelhoral
Copy link
Contributor Author

pavelhoral commented Dec 10, 2024

Those two lines got parsed to layer: null:

[2024.12.10-17.29.11:060][575]LogWorld: Bringing World /Game/Maps/Gorodok/Gameplay_Layers/Gorodok_RAAS_v2.Gorodok_RAAS_v2 up for play (max tick rate 50) at 2024.12.10-17.29.11
[2024.12.10-18.14.03:306][534]LogWorld: Bringing World /Game/Maps/Yehorivka/Gameplay_Layers/Yehorivka_RAAS_v1.Yehorivka_RAAS_v1 up for play (max tick rate 50) at 2024.12.10-18.14.03

If I understand it correctly, this means that layer classes Gorodok_RAAS_v2 and Yehorivka_RAAS_v1 were not found in layers database, which is being loaded from https://raw.githubusercontent.com/Squad-Wiki/squad-wiki-pipeline-map-data/master/completed_output/_Current%20Version/finished.json... and surely enough there are no such layers there :/ (there is Gorodok_RAAS_v02 and Yehorivka_RAAS_v01 though).

So I guess this is connected to #386?

@fantinodavide
Copy link
Contributor

fantinodavide commented Dec 10, 2024

@pavelhoral the "file names" don't necessarily need to match the actual layer id's

this can be considered a path + file name (I don't know the details of UE): /Game/Maps/Gorodok/Gameplay_Layers/Gorodok_RAAS_v2.Gorodok_RAAS_v2

while the actual layer id's are the row names in the layers datatables

@pavelhoral
Copy link
Contributor Author

pavelhoral commented Dec 10, 2024

But SquadJS matches the layer name parsed from the log line to levelName in the layers JSON file.

I am simply stating what is happening. There is something broken there...

@fantinodavide
Copy link
Contributor

Gorodok_RAAS_v2 is an actual layer, while Gorodok_RAAS_v02 no longer exists, so at least we can count on naming conventions here

@fantinodavide
Copy link
Contributor

The layer list can be replaced with mine here: https://raw.githubusercontent.com/fantinodavide/SquadLayerList/refs/heads/main/layers.old.json

I was working on an update to the layers system after Offworld made layers and factions not tied to each other, but never finished it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core bug Bug related to the core SquadJS API
Projects
None yet
Development

No branches or pull requests

3 participants