question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Request failed with status 500 due to Error: Sauce could not start your job

See original GitHub issue

[//]: # NOTE: This repository only maintains packages that are listed in the Readme. Please make sure that your issue is directly caused by one of these packages and if not file an issue in the correct 3rd party package repository.

Environment (please complete the following information):

  • WebdriverIO version:– V 6.4.6
  • Mode:–WDIO Testrunner
  • If WDIO Testrunner, running sync/async: --sync
  • Node.js version: – 10.19.0
  • NPM version: – 6.13.4
  • Browser name and version: – chrome latest
  • Platform name and version: – Windows 10
  • Additional wdio packages used (if applicable):@wdio/cli”: “6.4.6”, “@wdio/local-runner”: “6.4.6”, “@wdio/mocha-framework”: “6.4.0”, “@wdio/spec-reporter”: “6.4.0”, “@wdio/sync”: “6.4.6”, “@wdio/sauce-service”: “6.4.6”, “wdio-chromedriver-service”: “6.0.4”,

Config of WebdriverIO

exports.config = {

    suites: {

        DriversPageTest: [
            './test/specs/driversPageTest.js'
        ]
    },

    user: process.env.SAUCELABS_USERNAME,
    key: process.env.SAUCELABS_KEY,
    region: 'eu',
    services: [
        ['sauce', {
            sauceConnect: true,
            sauceConnectOpts: {
                logfile: './target/Screenshots/sc-test.log',
                proxy: 'HOST:PORT'
            }
        }]
    ],
    maxInstances: 10,
    capabilities: [{
        browserName: 'chrome',
        browserVersion: 'latest',
        platformName: 'Windows 10',
        'sauce:options': {
            screenResolution: '1920x1080',
            name: process.env.SUITE,
            idleTimeout: 1000,
        }
    }],

    disableWebdriverScreenshotsReporting: false,
    sync: true,
    logLevel: 'error',
    coloredLogs: true,
    bail: 0,
    baseUrl: process.env.BASEURL,
    waitforTimeout: 30000,
    connectionRetryTimeout: 90000,
    connectionRetryCount: 5,
    framework: 'mocha',
    reporters: ['spec'],

    mochaOpts: {
        ui: 'bdd',
        timeout: 300000,
    },

    before: function (capabilities, specs) {
        global.screenshotPath = `./target/Screenshots/${Date.now()}.png`
        global.assert = chai.assert;
        browser.setWindowSize(1920, 1080)
        browser.url('/explore.internallogin')
        browser.deleteAllCookies()
            loginPage.loginToBetty()
        try {
            header.navigateTo("Transportation", "Planning")
        } catch (err) {
            loginPage.acceptCookies()
        header.navigateTo("Transportation", "Planning")
        }
        header.navigateTo("Transportation", "Master-Data")
        browser.switchToFrame(0)
    }
}

Describe the bug I’m trying to use Sauce Labs secure tunnels but sometimes the test fails with no reason. They are triggered by jenkins and for the most of the time they run successfully, but sometimes they fail with an error that I attached below. This is just random and it looks like the tunnel could not be opened. This only happens when I add sauceConnect: true option to the config file.

To Reproduce I cannot say exactly when this happens. It is just random. It just fails from time to time and from what I analyzed it does not seem to be related with other tests running in the same time. The problem is that the log file is not generated when it fails for this reason so I cannot add it here.

[Include code or an example repository that can easily be set up]

Expected behavior The expected behavior if that the tests always runs successfully and it does not fail randomly even before it starts.

Log Log files are not generated when it fails with this error. Jenkins logs look like:

[0-0] RUNNING in chrome - /test/specs/driversPageTest.js
[0-0] 2020-09-29T11:19:02.349Z ERROR webdriver: Request failed with status 500 due to Error: Sauce could not start your job. For more information on what happened, please visit https://app.eu-central-1.saucelabs.com/tests/12e83b030bac4a558f699c9aa2b87652
[0-0] 2020-09-29T11:19:02.351Z ERROR webdriver: Error: Sauce could not start your job. For more information on what happened, please visit https://app.eu-central-1.saucelabs.com/tests/12e83b030bac4a558f699c9aa2b87652
    at getErrorFromResponseBody (/home/jenkins/agent/workspace/smokeTestsDAN-DriversPageTest/DAN_ui_automation/node_modules/webdriver/build/utils.js:121:10)
    at WebDriverRequest._request (/home/jenkins/agent/workspace/smokeTestsDAN-DriversPageTest/DAN_ui_automation/node_modules/webdriver/build/request.js:149:56)
    at process._tickCallback (internal/process/next_tick.js:68:7)
[0-0] 2020-09-29T11:19:02.352Z ERROR @wdio/runner: Error: Failed to create session.
Sauce could not start your job. For more information on what happened, please visit https://app.eu-central-1.saucelabs.com/tests/12e83b030bac4a558f699c9aa2b87652
    at startWebDriverSession (/home/jenkins/agent/workspace/smokeTestsDAN-DriversPageTest/DAN_ui_automation/node_modules/webdriver/build/utils.js:45:11)
    at process._tickCallback (internal/process/next_tick.js:68:7)
[0-0]  Error:  Failed to create session.
Sauce could not start your job. For more information on what happened, please visit https://app.eu-central-1.saucelabs.com/tests/12e83b030bac4a558f699c9aa2b87652
[0-0] FAILED in chrome - /test/specs/driversPageTest.js

Additional context Add any other context about the problem here.

Please use the correct markdown

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:24 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
alinageorgianaiftodecommented, May 5, 2021

No fix found. The problem still exists and I’m using the latest wdio.

0reactions
darkartswizardcommented, Jul 28, 2022

Hardening browser.url (url) with a try / catch and a 2nd shot did not make any difference. Both attempts failed. It’s not a transient error in this case.

However, we think the root cause is the URL behind the firewall is whitelisted on my local machine, but not on the Docker instance. So it’s an issue on my side.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Common Error Messages - Sauce Labs Documentation
This is a rare but known error. It indicates that the OnDemand portion of the Sauce Labs service lost its connection with the...
Read more >
webdriverio/webdriverio - Gitter
"ERROR webdriver: Request failed due to session not created: session not created ... Request failed with status 500 due to Unable to create...
Read more >
ERROR webdriver: Request failed with status 500 due to ...
I have the latest chrome version installed. and I have not changed any permission explicitly. Yet, if you see that I can cross-check...
Read more >
Upgrade to 6.2.1 causes "WebDriver Error: Sauce could not ...
2021-11-01T07:55:26.668Z ERROR webdriver: Request failed with status 500 due to WebDriver Error: Sauce could not start your job.
Read more >
Sauce Service - WebdriverIO
the Sauce Labs Real Device cloud (iOS and Android) and can ONLY update the job status to passed / failed. What else will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found