{"record":{"id":"4260e870778dc680","repo":"SeleniumHQ/selenium","slug":"unsuccessful-command-executed-command-e-mes","errorCode":null,"errorMessage":"Unsuccessful command executed: #{command}; #{e.message}","messagePattern":"Unsuccessful command executed: #(.+?); #(.+?)","errorType":"exception","errorClass":"Error::WebDriverError","httpStatus":null,"severity":"critical","filePath":"rb/lib/selenium/webdriver/common/selenium_manager.rb","lineNumber":95,"sourceCode":"          elsif Platform.mac?\n            \"#{directory}/macos/selenium-manager\"\n          elsif Platform.linux?\n            \"#{directory}/linux/selenium-manager\"\n          elsif Platform.unix?\n            WebDriver.logger.warn('Selenium Manager binary may not be compatible with Unix',\n                                  id: %i[selenium_manager unix_binary])\n            \"#{directory}/linux/selenium-manager\"\n          else\n            raise Error::WebDriverError, \"unsupported platform: #{Platform.os}\"\n          end\n        end\n\n        def execute_command(*command)\n          WebDriver.logger.debug(\"Executing Process #{command}\", id: :selenium_manager)\n\n          Open3.capture3(*command)\n        rescue StandardError => e\n          raise Error::WebDriverError, \"Unsuccessful command executed: #{command}; #{e.message}\"\n        end\n\n        def parse_result_and_log(stdout)\n          json_output = stdout.empty? ? {'logs' => [], 'result' => {}} : JSON.parse(stdout)\n\n          json_output['logs'].each do |log|\n            level = log['level'].casecmp('info').zero? ? 'debug' : log['level'].downcase\n            WebDriver.logger.send(level, log['message'], id: :selenium_manager)\n          end\n\n          json_output['result']\n        end\n\n        def validate_command_result(command, status, result, stderr)\n          if status.nil? || status.exitstatus.nil?\n            WebDriver.logger.info(\"No exit status for: #{command}. Assuming success if result is present.\",\n                                  id: :selenium_manager)\n          end","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/rb/lib/selenium/webdriver/common/selenium_manager.rb#L77-L113","documentation":"Raised by SeleniumManager.execute_command when Open3.capture3 fails to spawn or run the selenium-manager binary with a StandardError (e.g., Errno::ENOENT if the binary does not exist, Errno::EACCES if not executable, or ENOMEM). This wraps the underlying OS error into a WebDriverError with the original message appended.","triggerScenarios":"The selenium-manager binary is missing from the gem's bin directory (corrupt install). The binary exists but lacks execute permission. The binary path from SE_MANAGER_PATH points to a nonexistent file. The system is out of memory or out of process slots.","commonSituations":"Partial or corrupt gem installation (e.g., git clone without submodules). Filesystem permissions after extracting a tarball that dropped the executable bit. Running inside a restricted container where process spawning is limited. SELinux/AppArmor blocking execution.","solutions":["Verify the binary exists and is executable: check rb/lib/selenium/webdriver/common/../../../bin/<platform>/selenium-manager.","Reinstall the selenium-webdriver gem cleanly: gem install selenium-webdriver.","Set SE_MANAGER_PATH to a known-good binary location.","Fix permissions: chmod +x on the binary.","Bypass Selenium Manager by specifying the driver path explicitly in your Service configuration."],"exampleFix":"// before\n# Binary missing or not executable, raises on driver launch\n\n// after (fix permissions)\nchmod +x bin/linux/selenium-manager\n\n// after (bypass)\nSelenium::WebDriver::Service.chrome(driver_path: '/usr/bin/chromedriver')","handlingStrategy":"try-catch","validationCode":"# Verify selenium-manager binary exists and is executable before driver launch\nbinary_dir = File.expand_path('../../../bin', __dir__)\nplatform_dir = case\n               when Selenium::WebDriver::Platform.windows? then 'windows'\n               when Selenium::WebDriver::Platform.mac? then 'macos'\n               when Selenium::WebDriver::Platform.linux? then 'linux'\n               end\nbinary = File.join(binary_dir, platform_dir, 'selenium-manager')\nbinary += '.exe' if Selenium::WebDriver::Platform.windows?\nunless File.executable?(binary)\n  raise \"selenium-manager binary not executable at #{binary}. Set SE_MANAGER_PATH or fix permissions.\"\nend","typeGuard":null,"tryCatchPattern":"begin\n  driver = Selenium::WebDriver.for :chrome\nrescue Selenium::WebDriver::Error::WebDriverError => e\n  raise unless e.message.include?('Unsuccessful command executed')\n  # binary execution failed; fall back to manual driver path\n  service = Selenium::WebDriver::Service.chrome(driver_path: '/usr/local/bin/chromedriver')\n  driver = Selenium::WebDriver.for(:chrome, service: service)\nend","preventionTips":["Pin selenium-webdriver gem version in your Gemfile.lock to avoid shipping without the bundled binary.","In Docker, add a RUN chmod +x step for the binary if the base image strips exec bits.","Set SE_MANAGER_PATH in CI to a pre-validated binary location.","Always have a fallback driver_path configured for environments where Selenium Manager is unreliable."],"tags":["selenium-manager","binary","permissions","environment","ruby"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}