Advertisement Create a free account

API Bugfix Update

1422379791
Riley D.
Roll20 Team
We just pushed a new update to the API (for campaigns running on both Dev and Main) that should hopefully address the following issues: Getting a "heartbeat timeout" or "script closed due to error" message when you come back to a game that was previously working fine (e.g. you played it on Thursday, it was fine, you come back Monday and you have to hit Save Scripts to get it to work again due to one of those errors). Note that you still may get the "heartbeat timeout" error today since we just fixed it, but you shouldn't see that happen again going forward. Getting a "script closed due to error" message without further explanation -- hopefully now you should get one of "heartbeat timeout", "too much CPU", or "too much memory" instead. Issues with previous sandbox instances not closing properly, leading to "double execution" of API scripts (e.g. you would run a PowerCards command and get the result back twice instead of once). Although not solely an API issue, we also fixed a bug yesterday that was causing some dice rolls not to work (including inside of API commands) on the Dev Server when 3D Dice were enabled, so that may have caused you to think your API scripts weren't running when in fact they were, and it was the dice engine that was having issues. If you are still experiencing any of these after today, please post in this thread and let us know so that we can investigate further. Thanks! Note that we had to reset the API server to roll out these changes, so you may have to go hit the "Save Scripts" button for your Campaign to get your API scripts to function again, so be sure to check that if you notice your scripts aren't responding.
1422383431
The Aaron
Forum Champion
API Scripter
Awesome!!!
1422385017
Macros that roll dice for selected tokens are not working. This began as soon as the update took effect. Macro in question is "/gmroll @{selected|MainAttack}". I have already logged out and re-entered the Roll20 site as well as saving all of my scripts in case that was the issue...
1422385071
This macro worked just before the update. I know this because I was working on journal characters at the time...
1422385146
My apologizes. They work again. Not sure why they didn't before but they do now.
1422385226
Riley D.
Roll20 Team
No problem, Barry, let us know if you run across anything else.
1422388555
Joshua Kurz
Marketplace Creator
Perfect thanks guys
1422389108

Edited 1422389301
I do get a coupe of these every now and again after opening the campaign with any script loaded, doesn't matter which: events.js:72 throw er; // Unhandled 'error' event ^ Error: listen EADDRINUSE at errnoException (net.js:904:11) at Server._listen2 (net.js:1023:19) at listen (net.js:1064:10) at Server.listen (net.js:1132:5) at Sandbox.start (/home/symbly/www/d20-api-server/sandcastle/lib/sandbox.js:35:15) at Object.<anonymous> (/home/symbly/www/d20-api-server/sandcastle/bin/sandcastle.js:11:9) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) EDIT: once that happens I get the double script execution bits. It seems to persist even if you delete or disable the script, kinda like a phantom script at that point.
1422396343
Riley D.
Roll20 Team
So you're still getting this today Ken? What's the link to the campaign where it's happening?
Sent you a PM
1422431344

Edited 1422432119
Vince
Pro
Sheet Author
Started getting double powercard macros on the Dev.
1422458180
Riley D.
Roll20 Team
I attempted a different way of dealing with the double-script-running issue. Let me know if it helped.
1422469954
Vince
Pro
Sheet Author
Thanks Riley. Still getting doubles...
1422470684
The Aaron
Forum Champion
API Scripter
(Vince, you did restart the sandbox, right?)
1422470839
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
If we are fixing issues with Vince I have a list I would like to socailze.
1422474088
Vince
Pro
Sheet Author
The Aaron said: (Vince, you did restart the sandbox, right?) You know, I've gotten in the habit of restarting the sandbox every time I open the API... Stephen S. said: If we are fixing issues with Vince I have a list I would like to socailze. Get in line Stephen.
1422474234
Vince
Pro
Sheet Author
Seems to be working again....
1422494118

Edited 1422494153
Still occurs, moving my API scripting to yet another campaign.. No error this time; it just silently did it.
1422548177
Riley D.
Roll20 Team
Okay, we took a stab at this again this morning. Again, you will probably need to restart your API scripts the next time you join a Campaign. Let me know if you experience the double script execution thing again after this point. Also just to confirm this "ghost script"/"double script" thing has only occurred on Dev campaigns, right?
1422549499

Edited 1422549728
DXWarlock
Pro
Sheet Author
API Scripter
I just tested mine, it has been good all week. yesterday no ghosts. And and today doubles :(. Steps I took was: Go to API panel - save Launch game and do !API command. Get 2 results from a command to roll dice, it does it twice and returns two different roll results. And only one seems to be reacting to saving as I get one on:ready reply: BUT it seems after a minute the ghost one died off, and everything was normal again But I got no error message on it to supply you when the ghost one died. Just for the first 1-2 minutes everything was double then it worked normal.
1422550563
Riley D.
Roll20 Team
Okay, well let me know if it happens again. That was so close to when I was doing everything it may have been a "leftover" ghost.
1422551153

Edited 1422551283
DXWarlock
Pro
Sheet Author
API Scripter
Will do! One thing that seems to be a good side effect of it is I notice saves happen faster going from 'saving to saved' and api reacts almost instant vs a slight delay on chat vs how its always been. But then its maybe because its low load on thursday at 12pm. Either way thanks for going through and bashing your head against it. For a month going to API and saving to get it going from a random heartbeat timeout before every login was a pain.
1422567788
Jeremy H.
Pro
Sheet Author
Still been unable to get my API scripts to work properly, Dev server still works with scripts but the main server does not. Just did a quick run-through of all three of my games, one of them ended up working for some odd reason while the rest did not when I went to check them. Two of the games came up with an error saying the Sandbox was closed, to which I tried to disable and reenable the scripts, but to no avail. My third game ran the scripts after I pressed "Save Scripts" instead of "Disable/Enable"...not sure how to explain most of this. Perhaps one of the devs might have an idea on what could be the issue? If not, I can try to give a more detailed description of what all of these shenanigans are.
1422569515
Steve K.
Roll20 Team
Jeremy, please provide a console log through that process and any other detailed information you can give about when and how these issues start happening to the best of your ability. The more info you can provide the better we'll be able to help you.
William R. said: I like that text formatting, what kind of style is it?
1422596995
DXWarlock
Pro
Sheet Author
API Scripter
its just div's and text in the script PM me if you want the code scriptlet for it, don't want to highjack Rileys thread :)
1422647041
Jeremy H.
Pro
Sheet Author
Steve K. said: Jeremy, please provide a console log through that process and any other detailed information you can give about when and how these issues start happening to the best of your ability. The more info you can provide the better we'll be able to help you. I just opened the console in two of my games that I currently have open, nothing has been coming up. Also, the API seems to be working again in them...Not sure what to say, the issues seem to spur up at random. The API will be working and I exit out of the game for a bit. I come back when I have to run it or change something before running the game and it suddenly isn't working. The only thing I've noticed that has stayed the same is that the issue only ever happens on the main server and not the dev server. Sorry I can't provide much more information, but I've just got no clue as to why these spur up.
I'm still getting double script execution.
1423759187
Riley D.
Roll20 Team
Ken L. said: I'm still getting double script execution. You've been getting it constantly for the last week? Or it just started again today? And what's the link to the campaign?
Sent a message, this is on dev-server, some time yesterday, it happens from time to time during the hour i spending writing the script.
1423786974

Edited 1423788156
Had it happen again. It might have to do with a script that does a long running activity. For instance say, saving then immediately trying to execute the script in the campaign. If you do so within say 5-10 seconds after saving it, sometimes it simply refuses to execute, but if you wait another 5 seconds it'll do it when you execute the command again. Also, it appears to cause the double script execution after awhile. It occurs more with my script I'm using since it involves a good amount of parsing logic and perhaps the sandbox isn't ready to serve a request. I'm unsure as to why it starts to double execute though.
1424647848
Having scripts act up. Lots of stopping and occasional double or even triple executions. First noticed this Friday 2/20 and has been going on since then. Scripts were very stable for me before then. Any idea if something changed on 2/20 or near then? This is a production campaign. Any idea what it might be? Link to campaign: https://app.roll20.net/join/441064/XghWWA Samples
1424648290
Joshua Kurz
Marketplace Creator
It appears that none of the API scripts are working right now.
1424653631
Yes it worked for a few days during the week, but Friday and Saturday was pretty bad, scripts stopping with no error message, restarting would generally fix it.
1424653913
Joshua Kurz
Marketplace Creator
Yeah powercards have been down for a while, infact all API are not working on my Sunday game. Reset 20 times, saved 20 times no luck
1424705148
Yes I keep the API on a tab, as it needs to be reset 50 times in a three hour game...
1424746446
Riley D.
Roll20 Team
We had some issues last night during peak time for sure. I took some additional steps to handle the additional load we're seeing on the API server. We'll continue to monitor it.
1424780482

Edited 1424780588
DXWarlock
Pro
Sheet Author
API Scripter
Thanks Riley. I was getting it to over the weekend but nothing game breaking. If it helps a few times it seems the API itself was firing fine, but anything needing a roll in API was hanging. Like my GM roll script. it sends a html div formatted message "GM rolled some dice" like I posted above, but I never got the actual result whispered to me, just the message I rolled. Then 10-15 second later it would tell me the roll. Or people doing a blind roll, it would send the message they sent me one, but take 10-15 seconds to tell me and them the result.
Riley D. said: We had some issues last night during peak time for sure. I took some additional steps to handle the additional load we're seeing on the API server. We'll continue to monitor it. I was having the same issues as others during my campaign on the past 2 Sundays (we play from 3-6pm, Eastern)... cards showing up twice, macros hanging (sometimes firing after a substantial delay, sometimes disappearing into the void). Will these additional steps prevent this from happening? Maybe the API server needs to be really beefed up or something, to handle the load from the popularity of your product? ;)