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

API Silently Crashing (No Error Message)

The past week or two I've noticed the API won't start up when I launch the game, it has to be restarted to spin up. It also has frequently been silently crashing while the game is active, requiring another restart. There are no error messages when this happens, and in both cases the console log shows this when restarting: Restarting sandbox by user request... No existing sandbox found. Preparing sandbox to start on game activity. Spinning up new sandbox... "Starting webworker script..." "Loading 964 translation strings to worker..."
How many scripts are you running, and which ones?&nbsp; I don't think it's an issue to have too many, but there may be an issue if multiple scripts are interacting in weird ways. I also see that you have the Tongues script installed -- I was never able to get it to work properly and it would crash my API after a bit.&nbsp; So you might want to start with that one by disabling it and see if you have issues.&nbsp; Otherwise you'll probably have to go through them one by one. I also use this little scriptlet (slightly adapted from Wolf Thunderspirit's here ) which may be helpful for getting a message in the API console log and in the in-game chat: // <a href="https://app.roll20.net/forum/post/9379560/script-help-new-to-scripting-need-help-on-one-started#post-9412121" rel="nofollow">https://app.roll20.net/forum/post/9379560/script-help-new-to-scripting-need-help-on-one-started#post-9412121</a> const APIStartup = (()=&gt;{ //User Editable &nbsp; &nbsp; const TimerSeconds = 10; // How many seconds after the restart notice does it take to complete the sandbox load? // Do not Edit below this line &nbsp; &nbsp; const scriptName = "API Startup"; &nbsp; &nbsp; const version = '0.1'; &nbsp; &nbsp; const TimerMilliseconds = TimerSeconds * 1000; &nbsp; &nbsp; const BGColor = "#0f0"; &nbsp; &nbsp; const BGColorStart = "#f00"; &nbsp; &nbsp; const OuterStyleStart = `width: 75%; margin: auto; padding: 0px; border-radius: 4px;&nbsp; box-shadow: 1px 1px 1px #707070;`; &nbsp; &nbsp; const InnerStyleStart = `text-align: center; vertical-align: middle; padding: 0px 0px; margin: 0px auto; border: 1px solid #000; border-radius: 4px; color: #000; background-image: -webkit-linear-gradient(-45deg, #a7c7dc 0%,#85b2d3 100%); text-shadow: 0px 0px #222, 0px 0px #222, 0px 0px #222, 0px 0px #222 , 0px 0px #222;`; &nbsp; &nbsp; var currentTime = new Date(); &nbsp; &nbsp; currentTime.setHours(currentTime.getHours() - 8); &nbsp; &nbsp; var timestamp = (new Date(currentTime).toLocaleString('en-US')); &nbsp; &nbsp; const checkInstall = function() { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; log('-=&gt; ' + scriptName + ' v' + version + ' &lt;=-'); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setTimeout(()=&gt;log(`API Wakeup Complete at ` +timestamp),0); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sendChat("API Startup", `/w gm &lt;div style='${OuterStyleStart}'&gt;&lt;div style='${InnerStyleStart}'&gt;API Wakeup Complete&lt;/div&gt;&lt;/div&gt;`,null,{noarchive:true}); &nbsp; &nbsp; }; &nbsp; &nbsp; log(`API Wakeup Begun...`); &nbsp; &nbsp; sendChat("API Startup", `/w gm &lt;div style='${OuterStyleStart}'&gt;&lt;div style='${InnerStyleStart}'&gt;API Starting Up&lt;/div&gt;&lt;/div&gt;`,null,{noarchive:true}); &nbsp; &nbsp; on("ready",() =&gt; { &nbsp; &nbsp; &nbsp; &nbsp; checkInstall(); &nbsp; &nbsp; }); })();
I'll give all that a try though I doubt the Tongues script is an issue, I've had it installed for over a year now with no trouble. I have over 30 scripts in my game but it hasn't been a problem before. A few other people a similar bug in their own threads, including one person who only had Group Initiative installed.
1615998967

Edited 1616013507
I have been experiencing this as well (and I don't have Tongues installed). ETA: Now I do &nbsp;have Tongues installed. Wasn't aware it was a thing. Great API!
Have the feeling too, that the APIscripts do not start up consistently. The 30 second heartbeat i have loaded in most of my games confirms this is the case. Heartbeat script can be as simple as: &nbsp; on("ready",() =&gt; { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setInterval(() =&gt; { let d = new Date(); log(d.toUTCString() + " beat ");&nbsp;},30000); });
1617142738

Edited 1617148281
Still experiencing this multiple times while the game is active. Games in which I am only a player continue to experience this as well, especially the API being unresponsive after the first spin up.
1617162987
Victor B.
Pro
Sheet Author
API Scripter
Restart sandbox.&nbsp; I've seen same.&nbsp; Restarting works.&nbsp; It's like it's losing connection
Right, as mentioned in top post. I haven't noticed a pattern of what triggers it though. The last time I was having issues with silent crashes, it only happened when the API wasn't interacted with for a few minutes, so I installed API Heartbeat so something would be constantly interacting with it.