Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Possible infinite loop detected, shutting down.

Hello, my server, 9472656 and pretty much all 3 of my major large group servers are having issues with an Infinite Loop detected issue. The only script I have enabled is the 5th Edition OGL Roll20 Companion. I am unable to debug because I am not sure where the error is happening. Any help would be appreciated. If it's one of the 100+ character sheets, how do I debug which one it is?
1626056464
The Aaron
Roll20 Production Team
API Scripter
Does the error happen immediately when you restart the sandbox, or does it happen when you do something in the game, like open a particular character?
I am not sure. We have many DMs and many players. It just stops randomly and I have to restart the API server. I'd say it's a specific token or map but all of those change often
My other server has an actual error: For reference, the error message generated was:  TypeError: Cannot read property 'substring' of undefined TypeError: Cannot read property 'substring' of undefined at TrackedObj._validateAttrs (/home/node/d20-api-server/api.js:907:27) at createObj (/home/node/d20-api-server/api.js:2707:23) at apiscript.js:257:13 at /home/node/d20-api-server/api.js:830:7 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147) at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546) at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489) at Rd.Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425) at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:111:400
1626099093
The Aaron
Roll20 Production Team
API Scripter
Is the companion script the only script you have installed in both games?
Yes, no other scripts are running.
1626108959
The Aaron
Roll20 Production Team
API Scripter
That second callstack is crashing in this function: // AUTOMATICALLY GENERATE NPC TOKEN WHEN HP FORMULA IS ROLLED var handlenpctoken = function(msg,character,player) { character.get("defaulttoken", function(token) { var t = JSON.parse(token); if(token === "null") { log("NPC DOES NOT HAVE A DEFAULT TOKEN"); } else { var page = playerIsGM(player.id) === true && player.get("lastpage") != "" ? player.get("lastpage") : Campaign().get("playerpageid"); var hp = msg.inlinerolls[0].results.total ? msg.inlinerolls[0].results.total : 0; var img = getCleanImgsrc(t.imgsrc); var tokenname = t.name ? t.name : character.get("name"); var represents = t.represents ? t.represents : character.id; createObj("graphic", { left: 140, top: 140, width: t.width, height: t.height, imgsrc: img, pageid: page, layer: (_.contains(["gmlayer", "objects", "map"], t.layer) ? t.layer : 'gmlayer'), name: tokenname, represents: represents, bar3_value: hp, bar3_max: hp }); } }); }; I'm not sure where the problem lies, but it has something to do with the cnpc character or npc default token.
Thanks! That helps me pinpoint what the issue could be. I will investigate.