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

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!

Hey @ericyangwa can you provide the two project names?

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

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?

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.

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.

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!

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.

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!

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!

Hey @cori I don’t mean to necro an old thread, but I just wanted to bring up the same problem. Glitch just had a strange bug where it was saying it couldn’t find the express module again, so I refreshed the project and it re-installed express and that seemed to fix it. However, as before, my selenium-webdriver is causing the same errors again, but it’s not on debug mode anymore. I suspect it might be a similar port problem? Do you happen to have any ideas?

The not-working project is tremor-bot, while the working one (with the same selenium code) is smite-bot. If you have any ideas, please let me know, thanks!