The Sauce Labs Cookbook

Sauce Headless

Front End Performance Testing

Insights

External Resources

More Info


Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

When running Sauce Labs tests with Sauce Connect Proxy, there may be situations in which Sauce Connect Proxy doesn't perform as expected. To make sure everything is in working order, you can run Sauce Connect diagnostic tests by appending the --doctor flag to your command-line. 

NOTE: While the --doctor flag can provide some help with facilitate debugging, you'll find most valuable troubleshooting information is available by turning on verbose logging in your verbose logs (which you'd need to enable), as described in Sauce Connect Proxy Troubleshooting.

...

Running Tests Using the --doctor Flag as a Diagnostics Tool

To use the --doctor flag, you would run the same command for starting the Sauce Connect Proxy, including any additional flags related to your specific tunnel (for example, e.g., --tunnelidentifier or -x to specify a data center). Please note that when using

NOTE: When adding the --doctor flag to your code, placement matters. Here's the correct order of flags matter.:

sc -u [Your Sauce Username] -k [Your Sauce Access Key] --doctor

...

--doctor will run a series of diagnostic operations to verify the following:

  • Determine what Which DNS servers and SSL certificates can be found in your network when Sauce Connect Proxy boots up
  • Verify the Sauce Connect Proxy outbound connections to:

    • saucelabs.

    com and *.miso.saucelabs.com on port 443  gv
    • com on port 443 for the REST API and the primary tunnel connection to the Sauce Labs cloud

    Verify that the Sauce Connect Proxy tunnel can make connections on port 443 and 80 to
    • gv.symcd.

    com and g
    • com and g.symd.

    com using
    • com on port 443 using the SSL certificates found in your network

    Verify ability to connect
    • https://google.com
  • Connectivity to these Sauce Labs REST API calls: 
    • https://saucelabs.com/version.json
    • https://saucelabs.com/rest/v1/[

...

    • Your Sauce Username]/tunnels

...

  • Verify that the Sauce Connect can make a connection to https://google.com

NOTE: Sauce Connect will exit after these checks are performed. A tunnel will not be started.

...

ErrorResolution

failed to fetch PAC file <file>

Indicates the specified PAC file couldn't be downloaded. This may be caused by an incorrect URL, or a network mis-configuration. To troubleshoot this type of issue, try to download the PAC file manually from the machine running Sauce Connect with cURL or another HTTP client.

To debug the PAC file you can create one locally and pass it to Sauce Connect Proxy using the --pac option like this:

Code Block
$ sc --pac file:///path/to/pacfile.js

In Windows, remember to add the drive to the path like this:

Code Block
$ sc --pac file://C:/path/to/pacfile.js

failed to fetch or empty PAC file

Connection to the remote server was successful, but the PAC file was empty or missing.

both --proxy and --pac are used

Using both may work, but this is unsupported by Sauce Labs and should only be used if directed by the Sauce Labs support.

invalid REST URL

URL specified in the -x option is invalid.

failed to find proxy via PAC for <host>

PAC file was downloaded successfully, but no proxy was found for this host. This may be the result of an incorrect PAC file: make sure a proxy is specified for all the hosts.

can't resolve 'saucelabs.com'/... tunnel hostname(s) via any DNS server

Please check your firewall and DNS settings.

To troubleshoot this issue, use dig or host to resolve the domain and verify it is correct:

Code Block
$ dig saucelabs.com

your hosts file contains an entry for <host>

If this error occurred, it is likely that your DNS server couldn't resolve saucelabs.com correctly. As a result, Sauce Labs Support might have directed someone at your organization to add the host to /etc/hosts. This is most likely because the DNS system has a special configuration for some hosts.

Please remove this entry from the host file: it's usually /etc/hosts on Unix-like systems. With Linux/Mac OS X systems, you can check the hosts file with this command.

Code Block
$ grep 'saucelabs.com' /etc/hosts

connecting via <proxy> to http://<url>: <error> or connecting to http://<url>: <error>

URL isn't accessible. If you see this error after other errors in the logs, try to fix the previous errors first.

Please refer to the libcurl errors manual to troubleshoot this issue.

SSL connect failed, socket: .<code_number> code: %d

Secure connection couldn't be established. Please refer to the OpenSSL manual to get more information about the error.

failed to retrieve certificate chain

Some X509 certificates couldn't be imported into the SSL library. This may indicate an issue with DNS, or public CAs being unreachable.

failed to reach https?://google.com

Sauce Connect client can't reach google.com. This indicates that the client doesn't have full Internet connectivity. It may not be an issue; Sauce Connect only needs access to saucelabs.com and its tunnels.

...

Additional Support

If you need more help, please get in touch with our support team at help@saucelabs.com.

...

  •  --doctor flag
  • Link to your Sauce Labs test from your the Test Results page in Sauce Labs dashboard, showing reproduction of the problem
  • Your Sauce Connect verbose log, which you can get by adding the -v and -l sc.log options to your Sauce Connect Proxy command line:

...