After the recent discord ban, the same code works on one project but not the other

#1

Hey! So after yesterday’s discord ban, my bot that got banned is now up and running. However, there’s some code that isn’t working in one discord bot project, but is in another. The code uses selenium web-driver. This problem happened a couple months ago, and fixed itself within a couple days. However, I was curious to know if anyone knows why the code works in one project container but not in another, and if there’s a way to fix it. The code in question is below:

const webdriver = require('selenium-webdriver');
var capabilities = {
   'browserName' : 'phantomjs'
}
var driver1 = new webdriver.Builder().
    withCapabilities(capabilities).
    build();

Error is as follows:

Error: Server terminated early with status 12

    at earlyTermination.catch.e (/rbd/pnpm-volume/5c14e12f-0790-4195-ba5f-0315077802ad/node_modules/.registry.npmjs.org/selenium-webdriver/3.6.0/node_modules/selenium-webdriver/remote/index.js:252:52)

    at <anonymous>

    at process._tickCallback (internal/process/next_tick.js:189:7)

From: Task: WebDriver.createSession()

    at Function.createSession (/rbd/pnpm-volume/5c14e12f-0790-4195-ba5f-0315077802ad/node_modules/.registry.npmjs.org/selenium-webdriver/3.6.0/node_modules/selenium-webdriver/lib/webdriver.js:769:24)

    at Function.createSession (/rbd/pnpm-volume/5c14e12f-0790-4195-ba5f-0315077802ad/node_modules/.registry.npmjs.org/selenium-webdriver/3.6.0/node_modules/selenium-webdriver/phantomjs.js:220:41)

    at createDriver (/rbd/pnpm-volume/5c14e12f-0790-4195-ba5f-0315077802ad/node_modules/.registry.npmjs.org/selenium-webdriver/3.6.0/node_modules/selenium-webdriver/index.js:170:33)

    at Builder.build (/rbd/pnpm-volume/5c14e12f-0790-4195-ba5f-0315077802ad/node_modules/.registry.npmjs.org/selenium-webdriver/3.6.0/node_modules/selenium-webdriver/index.js:657:16)

Any insight would be appreciated! Thanks!

#2

Hey @ericyangwa can you provide the two project names?

#3

Hey @cori! The projects should be named tremor-bot and smite-bot. Thanks :slight_smile:

#4

Hey @ericyangwa, I’m not seeing any errors in either of those projects, although I do note that ~tremor-bot is in Debug mode.

Are you still seeing problems?

#5

Hey @cori. Thanks for taking a look! In the project I mentioned (tremor-bot) that has the error, I’ve actually just wrapped the offending code in an “if false” so it doesn’t actually run, so that everything else is working with the bot. That’s probably why there are no errors haha. I just tried releasing that code, and the error still comes up. Should I leave it in an erroneous state for you to check out? Thanks!

EDIT: I’m also not too familiar with debug mode. Should it be off? I feel like I’ve always just had it on haha.

#7

It would help to be able to look at it in the error state, yes. In general I leave Debug off not least so I don’t forget about it.

#8

Got it. I’ve turned the if false into an if true so you can see the error now :slight_smile: Thanks for your help in all of this!

#9

I stopped Debug mode and that seems like it may have fixed the issue for now. Since running in Debug mode changes the port that Glitch listens to perhaps something about that was causing issues for your tests.

Please let me know if you’re still seeing the issue.

#10

That did seem to work! Thanks! Could you tell me how to turn on/off debug mode? Maybe I had accidentally turned it on. Thanks for your effort looking into this!

#11

This little screencast shows how to view the debugger in the project’s Console: https://support-assets.glitch.me/debugger. And this help article may also be of interest: https://glitch.com/help/how-do-i-use-the-debugger/

Hope this helps!