webdriverio / webdriverio/webdriverio

[🐛 Bug]: <NODE_TLS_REJECT_UNAUTHORIZED environment>

Open
#13,889 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug 🐛 help wanted wdio-browserstack-service
Dominant language
TypeScript
Stars
9.8k
Forks
2.7k
Avg merge
2d 13h
Merged PRs (30d)
69

Description

Have you read the Contributing Guidelines on issues?
WebdriverIO Version

9.2.8

Node.js Version

20.10.0

Mode

WDIO Testrunner

Which capabilities are you using?
platformName: 'Android',
      'appium:app': getCIAppID(appIdValue) || process.env.BROWSERSTACK_APP_ID_ANDROID,
      'appium:autoGrantPermissions': 'true', //Auto accept Push Notification
      'appium:interactiveDebugging': 'true',
      'bstack:options': {
        buildName: getCIAppID(appIdValue) || `Manual Android Execution  -  ${new Date().toLocaleString('en-gb')}`,
        projectName: 'App Android',
        networkLogs: true,
        networkLogsOptions: {
          captureContent: true,
        },
        idleTimeout: 120,
        debug: true,
        appiumVersion: '1.22.0',
      },
What happened?

When run locally

 (node:92107) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
[1-0] (Use `node --trace-warnings ...` to show where the warning was created)

When run on CI pipeline

Error only on Pipeline run - 
(node:47) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)
Error while trying to execute binary Error: Command failed: /root/.browserstack/BrowserStackLocal --daemon start --log-file /tmp/build/ffa2fcdb/repo/tests/e2e/local.log --source nodejs-1.5.5 --key ((redacted)) --force-local --local-identifier 2681f2a5-d789-49f9-a9c2-b311bdfa5644
/root/.browserstack/BrowserStackLocal: --import is not allowed in NODE_OPTIONS
12:47:02
What is your expected behavior?

no node error, and it should work smoothly as with @wdio/cli - v 8.40.6

How to reproduce the bug.

platformName: 'Android',
'appium:app': getCIAppID(appIdValue) || process.env.BROWSERSTACK_APP_ID_ANDROID,
'appium:autoGrantPermissions': 'true', //Auto accept Push Notification
'appium:interactiveDebugging': 'true',
'bstack:options': {
buildName: getCIAppID(appIdValue) || Manual Android Execution - ${new Date().toLocaleString('en-gb')},
projectName: 'App Android',
networkLogs: true,
networkLogsOptions: {
captureContent: true,
},
idleTimeout: 120,
debug: true,
appiumVersion: '1.22.0',
},

Relevant log output
platformName: 'Android',
      'appium:app': getCIAppID(appIdValue) || process.env.BROWSERSTACK_APP_ID_ANDROID,
      'appium:autoGrantPermissions': 'true', //Auto accept Push Notification
      'appium:interactiveDebugging': 'true',
      'bstack:options': {
        buildName: getCIAppID(appIdValue) || `Manual Android Execution  -  ${new Date().toLocaleString('en-gb')}`,
        projectName: 'Appv3 Android',
        networkLogs: true,
        networkLogsOptions: {
          captureContent: true,
        },
        idleTimeout: 120,
        debug: true,
        appiumVersion: '1.22.0',
      },
Code of Conduct
  • I agree to follow this project's Code of Conduct
Is there an existing issue for this?
  • I have searched the existing issues

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare @wdio/cli v8.40.6 with the reported v9.2.8 behavior, then trace how the WDIO testrunner launches BrowserStackLocal in the CI environment. Reproduce the NODE_TLS_REJECT_UNAUTHORIZED warning and the NODE_OPTIONS --import failure; done means the Android BrowserStack run completes without that launch error.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
ci-cd, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.