Not able to Migrate and can't open the sheets anymore after failed migration

Issue #203 resolved
Former user created an issue

just what I said above, I saw in another issue ticket that disabling other modules might help but sadly it didn't at all

Comments (14)

  1. Justin Gable

    Since I was the one with the same problem, I can maybe help slightly. Have you ported all actors over to a Compendium? That fixed it for me.

  2. Gingernut96

    Jumping onto this issue as I have the same problem.

    Updated to most recent Foundry, 5e and Obsidian

    Obsidian Fails migration, and I can’t open or import character sheets with it enabled.

    Error when just loading:

    bonuses.js:180 Uncaught (in promise) TypeError: Cannot read property 'effects' of undefined
    at bonusToParts (bonuses.js:180)
    at Object.calculateDamage (prepare.js:176)
    at damage (item.js:351)
    at prepareEffects (item.js:536)
    at Item5e.<anonymous> (item.js:17)
    at ObsidianActor._prepareOwnedItems (foundry.js:30343)
    at ObsidianActor.prepareEmbeddedEntities (foundry.js:30321)
    at ObsidianActor.prepareEmbeddedEntities (actor.js:234)
    at ObsidianActor.prepareData (entity.js:48)
    at data.js:59

    Then when the migration fails, I get this:

    foundry.js:3705 Error: Required field brightSight not present in PrototypeToken.
    at PrototypeToken._validateRequiredField (opt/foundry/foundryvtt/resources/app/dist/database/odm/abstract.js:1)
    at PrototypeToken.validate (opt/foundry/foundryvtt/resources/app/dist/database/odm/abstract.js:1)
    at Actor._validateField (opt/foundry/foundryvtt/resources/app/dist/database/odm/abstract.js:1)
    at Actor.validate (opt/foundry/foundryvtt/resources/app/dist/database/odm/abstract.js:1)
    at Actor.save (opt/foundry/foundryvtt/resources/app/dist/database/odm/document.js:1)
    at async Function._onUpdate (opt/foundry/foundryvtt/resources/app/dist/database/odm/document.js:1)
    at async Socket.handleEvent (opt/foundry/foundryvtt/resources/app/dist/sockets.js:1)

    And:

    run.js:59 ObsidianActor {_data: {…}, data: {…}, options: {…}, apps: {…}, compendium: null, …}apps: {}compendium: nulldata: {_id: "E0S0QLyUj0QrCjbn", name: "Zombie", permission: {…}, type: "npc", data: {…}, …}effects: Map(0) {}items: Map(2) {"uhRYeiZdo5ckzvvH" => Item5e, "LCFBz71U848IiC3j" => Item5e}options: {}overrides: {}token: null_data: {_id: "E0S0QLyUj0QrCjbn", name: "Zombie", permission: {…}, type: "npc", data: {…}, …}_tokenImages: nullcollection: (...)entity: (...)folder: (...)hasPlayerOwner: (...)id: (...)img: (...)isPC: (...)isPolymorphed: (...)isToken: (...)itemTypes: (...)limited: (...)link: (...)name: (...)owner: (...)permission: (...)sheet: (...)temporaryEffects: (...)uuid: (...)visible: (...)_id: (...)_sheetClass: (...)proto: Actor5e Error: Required field brightSight not present in PrototypeToken.
    at PrototypeToken._validateRequiredField (opt/foundry/foundryvtt/resources/app/dist/database/odm/abstract.js:1)
    at PrototypeToken.validate (opt/foundry/foundryvtt/resources/app/dist/database/odm/abstract.js:1)
    at Actor._validateField (opt/foundry/foundryvtt/resources/app/dist/database/odm/abstract.js:1)
    at Actor.validate (opt/foundry/foundryvtt/resources/app/dist/database/odm/abstract.js:1)
    at Actor.save (opt/foundry/foundryvtt/resources/app/dist/database/odm/document.js:1)
    at async Function._onUpdate (opt/foundry/foundryvtt/resources/app/dist/database/odm/document.js:1)
    at async Socket.handleEvent (opt/foundry/foundryvtt/resources/app/dist/sockets.js:1)
    beginMigration @ run.js:59
    async function (async)
    beginMigration @ run.js:41
    (anonymous) @ run.js:145
    dispatch @ jquery.min.js:2
    v.handle @ jquery.min.js:2

    I have tried various combinations of Modules, including only obsidian.

    Any help would be appreciated, let me know here on on Discord (SoulMuncherr#2775) if you need any more info.

  3. Kim Mantas repo owner

    Two of your actors (Eikik and Varis Liadon) had a null value for their prototype token brightSight field, which was breaking the migration. I don’t think this had anything to do with obsidian, any module that performed a bulk actor update would similarly have failed, and indeed I noticed that the dnd5e system migration to 0.9.8 also failed.

    What you can do is load up your world, click cancel on the obsidian migration popup, then paste this into your console and hit Enter to run it:

    (function () {
        Actor.update(game.actors.entities.filter(a => a.data.token.brightSight == null).map(a => {
            return {_id: a.data._id, 'token.brightSight': 0};
        }));
    })();
    

    It should only take a moment, then you can refresh and run the obsidian migration again and it should (hopefully) succeed this time.

  4. Gingernut96

    It has cleared one of the two errors, I now only get the following:

    ObsidianActor {_data: {…}, data: {…}, options: {…}, apps: {…}, compendium: null, …}apps: {}``proto``: Objectconstructor: ƒ Object()hasOwnProperty: ƒ hasOwnProperty()isPrototypeOf: ƒ isPrototypeOf()propertyIsEnumerable: ƒ propertyIsEnumerable()toLocaleString: ƒ toLocaleString()toString: ƒ toString()valueOf: ƒ valueOf()``defineGetter``: ƒ ``defineGetter``()``defineSetter``: ƒ ``defineSetter``()``lookupGetter``: ƒ ``lookupGetter``()``lookupSetter``: ƒ ``lookupSetter``()get ``proto``: ƒ ``proto``()set ``proto``: ƒ ``proto``()compendium: nulldata: {_id: "E0S0QLyUj0QrCjbn", name: "Zombie", permission: {…}, type: "npc", data: {…}, …}data: {abilities: {…}, attributes: {…}, details: {…}, traits: {…}, currency: {…}, …}effects: []flags: {obsidian: {…}}folder: "bJSjBpBv65M3HhqA"img: "``https://5e.tools/img/bestiary%2FMM%2FZombie.jpg"items:`` (2) [{…}, {…}]name: "Zombie"permission: {default: -1}sort: 11800000token: {flags: {…}, name: "Zombie", displayName: 20, img: "``https://5e.tools/img/MM/Zombie.png",`` tint: null, …}type: "npc"_id: "E0S0QLyUj0QrCjbn"``proto``: Objecteffects: Map(0) {}items: Map(2) {"uhRYeiZdo5ckzvvH" => Item5e, "LCFBz71U848IiC3j" => Item5e}options: {}overrides: {}token: null_data: {_id: "E0S0QLyUj0QrCjbn", name: "Zombie", permission: {…}, type: "npc", data: {…}, …}_tokenImages: nullcollection: (...)entity: (...)folder: (...)hasPlayerOwner: (...)id: (...)img: (...)isPC: (...)isPolymorphed: (...)isToken: (...)itemTypes: (...)limited: (...)link: (...)name: (...)owner: (...)permission: (...)sheet: (...)temporaryEffects: (...)uuid: (...)visible: (...)_id: (...)_sheetClass: (...)``proto``: Actor5e TypeError: Cannot read property 'effects' of undefined
    at bonusToParts (bonuses.js:180)
    at Object.calculateDamage (prepare.js:176)
    at damage (item.js:351)
    at prepareEffects (item.js:536)
    at Item5e.<anonymous> (item.js:17)
    at ObsidianActor._prepareOwnedItems (foundry.js:30343)
    at ObsidianActor.prepareEmbeddedEntities (foundry.js:30321)
    at ObsidianActor.prepareEmbeddedEntities (actor.js:234)
    at ObsidianActor._onUpdate (foundry.js:30568)
    at foundry.js:29229

  5. Kim Mantas repo owner

    Well, I can’t reproduce it from your file. But, just looking at the error I’ve pushed some changes that might help. Try out the latest update and let me know if it solves your issue.

  6. Gingernut96

    I’ve tried it, and it seems to work now, I was able to re-import the characters correctly.

    Thank you very much!

  7. Log in to comment