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 .
×
D&D 2024 has arrived! Pre-order the new core rulebooks now and get an exclusive pre-order bonus for free!
Create a free account

API issues requiring Sandbox restart

1464619615
Giger
API Scripter
Hey all - i'm hoping someone has fixed this issue, or that i'm just doing something silly that's causing this problem I'm currently running just three APIs, Torch, (motd) and the 5e Companion one. I (seemingly) randomly get errors that cause the companion and the Torch to stop working properly, until I pres (save script) and the sandbox restarts, after which everything is fine for a period of time. It's just mildly annoying, having to restart the sandbox every time I go into a session - and once and awhile during a session. The latest error was TypeError: Cannot read property 'split' of undefined TypeError: Cannot read property 'split' of undefined at apiscript.js:598:100 at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:1:0), <anonymous>:65:16) at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:1:0), <anonymous>:70:8) at /home/node/d20-api-server/api.js:1197:12 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 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 Ques'que what?
1464800503
Phil B.
Forum Champion
Sheet Author
Do you know which of these scripts, specifically, is breaking? This seems like it is a bug in the script, rather than a bug with Roll20, which means it would be up to the script author to fix it. If it's the 5e Companion that's breaking, then we would be the author, but I'm not sure which script is breaking. 
1464804653
Giger
API Scripter
Not specifically, I can do some more testing - it's just tough because it's sporadically breaks... but it's been Torch and Companion as I was having this problem before putting in the MOTD script.  Any my suggestions on how to "break it"? 
1465244924

Edited 1465245053
Phil B.
Forum Champion
Sheet Author
The way to know which one was breaking it would be to open your API screen in a separate tab, preferably to a different window so you can watch the API console while you test/play. Then keep an eye on it, either while you're playing or simulating what you would normally be doing when it breaks. Then depending on what's happening in your game when it breaks would determine which one is breaking. If it breaks because someone is using their character sheet, that would be the 5e companion, if no one is using their character sheet at the time then probably the Torch. You can also disable one temporarily to see if that fixes the issue, if it does you've figured out which one is broken. Once we figure out which one is broken, we can contact the owner of that script and let them know they have some fixin to do.
1465305531
Giger
API Scripter
I've spent a few hours tinkering with this - and though i've had the problem a couple times since the OP it is very difficult to force a break. I went through the source codes of both likely culprits - and I noticed that the "split" command is only used once in the Torch script, versus countless times in the companion.  So my instinct says it's probably the companion script. I've spent a half dozen hours now tinkering with this now, and can't figure it out so I just decided to build in a heart beat and restart the APIs when the heart beat fails. Thanks for the feedback.