Skip to content

Stash id error after raid #129

@Elfenwolf

Description

@Elfenwolf

Hey, I just got a bug after leaving the raid. When the stash is loading I got this situation. I did a quick debug with AI to replace the collision id.

I'm not sure how much this is valid as I'm playing on SPT 3.10.5 (waiting for the juicy 4.x update :) ) Thank you for your amazing work

I apologize if this is not connected to Realism mod

Duplicate item _id in stash causes profile load failure

How it happened

The 2OPSKSv2 weapon preset (OP-SKS with PSO-1M2-1 scope) is defined identically across three bot preset files:

  • db/bots/loadouts/weaponPresets/assaultPresets.json
  • db/bots/loadouts/weaponPresets/pmcbearPresets.json
  • db/bots/loadouts/weaponPresets/pmcusecPresets.json

All three copies share the same item _id values. When two bots from different preset files (e.g. a Bear PMC and a USEC PMC) spawn in the same raid both
carrying this preset, SPT assigns their items the _id values directly from the preset files — which are identical across files.

The specific conflicting _id is the PSO-1M2-1 scope attachment:
"_id": "11d1ef0c5f1a8cf19d8dca81"
"_tpl": "576fd4ec2459777f0b518431" (PSO-1M2-1 scope, mod_scope slot)

When the player loots both bots' weapons, two items with the same _id end up in the stash. SPT uses _id as a unique dictionary key when building the
inventory — hitting a duplicate key throws:

Error converting value "11d1ef0c5f1a8cf19d8dca81" to type 'EFT.MongoID'. Path '[0].Inventory.items[N]._id'

This makes the profile permanently unloadable until manually corrected.


What was done to fix it

Profile fix (immediate):
With the SPT server fully shut down, the second occurrence of _id: 11d1ef0c5f1a8cf19d8dca81 in the active profile and all SPT-Realism profile backups
was replaced with a fresh valid 24-character MongoID. The server must be stopped first — if it is running, it holds the broken profile in memory and
overwrites any file fix on next write.

Root cause fix (prevent recurrence):
The _id values in the 2OPSKSv2 preset block in assaultPresets.json should be regenerated to be unique across all three files. As long as the same
_id exists in more than one preset file, any raid where two bots from different files both carry this preset will reproduce the issue.

Image

MOD list

  • SPT-Realism
  • DanW-SPTQuestingBots
  • zSolarint-SAIN-ServerMod
  • Skwizzy-LootingBots-ServerMod
  • MoreCheckmarksBackend
  • IhanaMies-LootValueBackend
  • rairaitheraichu-ammostats
  • tyfon-uifixes
  • [SVM] Server Value Modifier
  • BRNVG_N-15Adapter

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions