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 Bugfix Update

January 27 (10 years ago)
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.
January 27 (10 years ago)
The Aaron
Pro
API Scripter
Awesome!!!
January 27 (10 years ago)
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...
January 27 (10 years ago)
This macro worked just before the update. I know this because I was working on journal characters at the time...
January 27 (10 years ago)
My apologizes. They work again. Not sure why they didn't before but they do now.
January 27 (10 years ago)
Riley D.
Roll20 Team
No problem, Barry, let us know if you run across anything else.
January 27 (10 years ago)
PrincessFairy
Plus
Marketplace Creator
Perfect thanks guys
January 27 (10 years ago)

Edited January 27 (10 years ago)
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.
January 27 (10 years ago)
Riley D.
Roll20 Team
So you're still getting this today Ken? What's the link to the campaign where it's happening?
January 28 (10 years ago)
Sent you a PM
January 28 (10 years ago)

Edited January 28 (10 years ago)
vÍnce
Pro
Sheet Author
Started getting double powercard macros on the Dev.

January 28 (10 years ago)
Riley D.
Roll20 Team
I attempted a different way of dealing with the double-script-running issue. Let me know if it helped.
January 28 (10 years ago)
vÍnce
Pro
Sheet Author
Thanks Riley. Still getting doubles...
January 28 (10 years ago)
The Aaron
Pro
API Scripter
(Vince, you did restart the sandbox, right?)
January 28 (10 years ago)
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.
January 28 (10 years ago)
vÍnce
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.

January 28 (10 years ago)
vÍnce
Pro
Sheet Author
Seems to be working again....
January 29 (10 years ago)

Edited January 29 (10 years ago)
Still occurs, moving my API scripting to yet another campaign..

No error this time; it just silently did it.
January 29 (10 years ago)
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?
January 29 (10 years ago)

Edited January 29 (10 years ago)
DXWarlock
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.

January 29 (10 years ago)
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.
January 29 (10 years ago)

Edited January 29 (10 years ago)
DXWarlock
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.
January 29 (10 years ago)
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.
January 29 (10 years ago)
Stephen Koontz
Forum Champion
Marketplace Creator
Sheet Author
API Scripter
Compendium Curator
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.
January 29 (10 years ago)

William R. said:





I like that text formatting, what kind of style is it?

January 30 (10 years ago)
DXWarlock
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 :)
January 30 (10 years ago)
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.
February 12 (10 years ago)
I'm still getting double script execution.
February 12 (10 years ago)
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?
February 12 (10 years ago)
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.
February 13 (10 years ago)

Edited February 13 (10 years ago)
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.
February 22 (10 years ago)
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



February 22 (10 years ago)
PrincessFairy
Plus
Marketplace Creator
It appears that none of the API scripts are working right now.

February 23 (10 years ago)
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.
February 23 (10 years ago)
PrincessFairy
Plus
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

February 23 (10 years ago)
Yes I keep the API on a tab, as it needs to be reset 50 times in a three hour game...
February 24 (10 years ago)
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.
February 24 (10 years ago)

Edited February 24 (10 years ago)
DXWarlock
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.
February 24 (10 years ago)

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? ;)