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

Unexpected token

The problem though Ziechael is the ability for players to come in without the GM and update/test with their characters. If you have a sheet that relies on the api, this has significant impact as I may not always be available to restart the API for my players.
1427125856
Ziechael
Forum Champion
Sheet Author
API Scripter
That, sir, is a very valid point that i hadn't considered... mainly because i spoon feed my players so all testing etc is done by me (they don't know how good they've got it!). It's interesting that a thread of this age, length and repeatedly reported issue-ness hasn't had a Dev response yet (<-- not faulting them, i now worship them instead of Loviatar; which has p***ed her off no end!), would be great to get a resolution.
So I've been in and out of my campaign several times today. It looks like each time the sandbox shuts down and starts back up, I am getting this error. I think this bug needs some escalation.
Has there been any official word on this? I don't remember where I read it, but I've tried a few last ditch attempts to resolve it, like adding a space at the end of each API, removing comments from each API, and adding a space to the beginning of each API. All no luck, and there still seems to be no rhyme or reason as to when the error occurs. Main issue is players can't reset everything if they're working on stuff between sessions without the GM around.
I think we may have to send emails to get direct support on this. link this topic.
Thanks for the heads up everyone, we have received an email regarding this issue. Any updates will be shared.
We're aware of this (sorry if that wasn't communicated properly) and it's currently on our list of bugs to look into this sprint (so in the next week or two). I'm not totally sure what's going on here as it's not happening very often, but hopefully a deeper look will allow me to figure it out. My guess is it has something to do with us starting to use Cloudflare to prevent DDoS attacks and that interfering with the API server communicating so frequently with the main app server.
Much appreciated! I think we all knew you were on top of it, but it's good to see the pink ink on a post!
I've implemented a fix I think may have fixed this, but again since it's intermittent it's hard to confirm. Please let me know if you used your API scripts yesterday afternoon/evening, and then this morning if you had the Unexpected token error. Thanks!
1428504995

Edited 1428505037
Hi Riley, I had this issue just this morning. It was an 'S'. Assuming you did this in production and not on the dev instance?
it still occurs, if you need a production campaign that has this happen 100%, let me know. API sandbox shutdown due to campaign inactivity. Spinning up new sandbox... Spinning up new sandbox... Unexpected token s
Still occurs on dev server. On my campaign it happens everytime i quit the campaign and log again after one hour or two. Hope this helps.
1428507827
The Aaron
Roll20 Production Team
API Scripter
I've escalated this to Riley and he is looking into other solutions.
Thanks for the feedback --- indeed it still seems broken :-) I'll keep looking into it. Ken L. said: it still occurs, if you need a production campaign that has this happen 100%, let me know. API sandbox shutdown due to campaign inactivity. Spinning up new sandbox... Spinning up new sandbox... Unexpected token s You're saying it happens every time you try to start up a sandbox, not just overnight?
Overnight is 100% for all of my campaigns. It happens also throughout the day after a significant period of inactivity (often several hours 4-8).
1428518479
vÍnce
Pro
Sheet Author
Kevin said: Overnight is 100% for all of my campaigns. It happens also throughout the day after a significant period of inactivity (often several hours 4-8). Happens more often than that for me. I've just gotten used to a "Save" on the API console whenever I open my campaign. Second nature at this point. :-)
Riley D. said: Thanks for the feedback --- indeed it still seems broken :-) I'll keep looking into it. You're saying it happens every time you try to start up a sandbox, not just overnight? Not overnight, the key is after the sandbox is shutdown due to inactivity. I believe you set the timeout to 15m, as you have the controls at hand, you can perhaps experiment with decreasing this timeout on an experimental server to see it in action.
1428532601

Edited 1428532675
Vince said: Kevin said: Overnight is 100% for all of my campaigns. It happens also throughout the day after a significant period of inactivity (often several hours 4-8). Happens more often than that for me. I've just gotten used to a "Save" on the API console whenever I open my campaign. Second nature at this point. :-) Im geting so tired of my players contacting me with "hey mang, API is down for the campaign, and i need to tool with my powercard macros, mind logging in and starting the API??? oh, i know its 2 am but..." we need a BIG BUTTON inside the campaign "PRESS TO RESET AY-PEE-EYE"
1428557943
vÍnce
Pro
Sheet Author
Bruticus said: Vince said: Kevin said: Overnight is 100% for all of my campaigns. It happens also throughout the day after a significant period of inactivity (often several hours 4-8). Happens more often than that for me. I've just gotten used to a "Save" on the API console whenever I open my campaign. Second nature at this point. :-) Im geting so tired of my players contacting me with "hey mang, API is down for the campaign, and i need to tool with my powercard macros, mind logging in and starting the API??? oh, i know its 2 am but..." we need a BIG BUTTON inside the campaign "PRESS TO RESET AY-PEE-EYE" Can't someone write a script that can reset the API when it goes down? :-P
Vince said: Bruticus said: we need a BIG BUTTON inside the campaign "PRESS TO RESET AY-PEE-EYE" Can't someone write a script that can reset the API when it goes down? :-P - . -
Of late I keep a tap with the API open and tab to it when the API dies, which is almost every 20-30 mins. I guess I have become inured to the problem, it barely annoys me any more.
1429900539

Edited 1429900606
Ah I constantly get this, also when you hit disable script I have to refresh before it actually correctly displays the enable script button. It looks like it isnt' disabled.
1429900621

Edited 1429900690
The Aaron
Pro
API Scripter
Save has the effect of restarting and clearing up that error, but it would be nice to see it solved. I have the same issues with disabled.
1429914156
Kryx
Pro
Sheet Author
API Scripter
I have it regularly as well. :(
So I wasn't sure exactly where to report this, so I came back to report it in the original thread. I still get an " Unexpected token s " on any campaign that was inactive overnight, there are no additional logs or messages. However last night I had left my browser open on a PC that doesn't sleep (yeah I know, not eco-friendly!), but there was a different message there this morning. I am not sure it is helpful because the use case is slightly different (going inactive vs. technically having an "active" connection), but here is the message: undefined:1 tps://s3.amazonaws.com/files.d20.io/images/8976745/5DDUaycfvzbg3ds{"d":{"b":{" ^ SyntaxError: Unexpected token d at Object.parse (native) at sa (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:7:258) at Lc (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:56:192) at Y.onmessage (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:54:431) at EventTarget.dispatchEvent (/home/symbly/www/d20-api-server/node_modules/firebase/node_modules/faye-websocket/lib/faye/websocket/api/event_target.js:22:30) at instance._receiveMessage (/home/symbly/www/d20-api-server/node_modules/firebase/node_modules/faye-websocket/lib/faye/websocket/api.js:134:10) at null.<anonymous> (/home/symbly/www/d20-api-server/node_modules/firebase/node_modules/faye-websocket/lib/faye/websocket/api.js:34:49) at emit (events.js:117:20) at null.<anonymous> (/home/symbly/www/d20-api-server/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/lib/websocket/driver/hybi.js:458:14) at pipe (/home/symbly/www/d20-api-server/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/node_modules/websocket-extensions/lib/pipeline/index.js:37:40)
1430224848
The Aaron
Roll20 Production Team
API Scripter
I know Riley added enhanced logging, that's probably something he'll want to see. I'll make sure it's highlighted.
The biggest reason this sucks, is for players that want to log into a campaign to work on something (e.g.: PowerCard macros), but are unable to do so because the API has to be restarted with a save by someone who has access to do so.
Reporting in case this helps the mod team debugging: I'm a new roll20 user and was scanning the API pages, and got an "unexpected token a" error, having never entered a single line of script code. I had created chunks of a campaign with 5e char sheets, tokens, etc., however. Probably with some things done wrong. Spinning a new sandbox per previous posts seems to work (my first script consists of a js comment), although I only vaguely understand what that means. I assume this is related and I just have to bear with it like the rest of you. Let me know if there's something else I should be doing or not doing. LIke if this is not right place to post.