jmreidy / sauce-tunnel Goto Github PK
View Code? Open in Web Editor NEWA Node.js wrapper around the Saucelabs tunnel jar
License: MIT License
A Node.js wrapper around the Saucelabs tunnel jar
License: MIT License
When I try the full example from the README, the tunnel opens successfully and is reported to be closed successfully, but the tunnel doesn't actually close. Then I have to go to https://saucelabs.com/tunnels to close the tunnel manually.
I have reproduced this problem on both Windows 7 and Windows 10 (technical preview) so this seems to affect all versions of Windows.
Originally reported as: axemclion/grunt-saucelabs#173
Can you please publish the latest version to npm?
We were using the older version(.jar) of sauce connect(Sauce Connect 3.0-r28, build 43) to support our asset mapping feature. But recently the support for it was taken away.
Now we are unable to use that feature in the recent build of Sauce Connect(Sauce Connect 4.4.5, build 1447).
We need to know the solution or the way it can be done with the latest build.
`Sauce Connect 3.0-r28, build 43
** This version of Sauce Connect is outdated.
** Please update with https://docs.saucelabs.com/reference/sauce-connect/
2017-04-05 11:04:44,510 - / Starting
2017-04-05 11:04:44,526 - Please wait for "You may start your tests" to start your tests.
2017-04-05 11:04:44,526 - Forwarding: None:['80'] -> 127.0.0.1:['57371']
2017-04-05 11:04:44,526 - Succesfully connected to local server 127.0.0.1:57371 in 0ms
2017-04-05 11:04:44,884 - {"tunnel_identifier":"FFXX2","metadata":{"OwnerHost":"127.0.0.1","Platform":"Java-1.8.0_121-Java_HotSpot-TM-_
64-Bit_Server_VM,_25.121-b13,_Oracle_Corporation-on-Windows_7-6.1-amd64","PythonVersion":"2.5.1","Ports":["80"],"ScriptRelease":43,"Own
erPorts":["57371"],"Build":"43","ScriptName":"sauce_connect","Release":"3.0-r28"},"ssh_port":443,"squid_config":null,"use_caching_proxy
":true,"use_kgp":true,"domain_names":[],"direct_domains":null,"fast_fail_regexps":null,"shared_tunnel":false}
Traceback (most recent call last):
File "pyclasspath/java_urllib2.py", line 41, in open
IOException: java.io.IOException: Server returned HTTP response code: 400 for URL: https://saucelabs.com/rest/v1/OMNIUM_DPIDEV/tunnels
2017-04-05 11:04:45,230 - Problem connecting to Sauce Labs REST API (HTTP server responded with 'java.io.IOException: Server returned H
TTP response code: 400 for URL: https://saucelabs.com/rest/v1/OMNIUM_DPIDEV/tunnels' (expected 'OK'))
Traceback (most recent call last):
File "pyclasspath/java_urllib2.py", line 41, in open
IOException: java.io.IOException: Server returned HTTP response code: 400 for URL: https://saucelabs.com/rest/v1/OMNIUM_DPIDEV/tunnels
2017-04-05 11:04:51,164 - Problem connecting to Sauce Labs REST API (HTTP server responded with 'java.io.IOException: Server returned H
TTP response code: 400 for URL: https://saucelabs.com/rest/v1/OMNIUM_DPIDEV/tunnels' (expected 'OK'))
Traceback (most recent call last):
File "pyclasspath/java_urllib2.py", line 41, in open
IOException: java.io.IOException: Server returned HTTP response code: 400 for URL: https://saucelabs.com/rest/v1/OMNIUM_DPIDEV/tunnels
2017-04-05 11:04:57,058 - Problem connecting to Sauce Labs REST API (HTTP server responded with 'java.io.IOException: Server returned H
TTP response code: 400 for URL: https://saucelabs.com/rest/v1/OMNIUM_DPIDEV/tunnels' (expected 'OK'))
Traceback (most recent call last):
File "pyclasspath/java_urllib2.py", line 41, in open
IOException: java.io.IOException: Server returned HTTP response code: 400 for URL: https://saucelabs.com/rest/v1/OMNIUM_DPIDEV/tunnels
2017-04-05 11:05:02,934 - Problem connecting to Sauce Labs REST API (HTTP server responded with 'java.io.IOException: Server returned H
TTP response code: 400 for URL: https://saucelabs.com/rest/v1/OMNIUM_DPIDEV/tunnels' (expected 'OK'))
Traceback (most recent call last):
File "pyclasspath/java_urllib2.py", line 41, in open
IOException: java.io.IOException: Server returned HTTP response code: 400 for URL: https://saucelabs.com/rest/v1/OMNIUM_DPIDEV/tunnels
2017-04-05 11:05:08,832 - Problem connecting to Sauce Labs REST API (HTTP server responded with 'java.io.IOException: Server returned H
TTP response code: 400 for URL: https://saucelabs.com/rest/v1/OMNIUM_DPIDEV/tunnels' (expected 'OK'))
Traceback (most recent call last):
File "pyclasspath/java_urllib2.py", line 41, in open
IOException: java.io.IOException: Server returned HTTP response code: 400 for URL: https://saucelabs.com/rest/v1/OMNIUM_DPIDEV/tunnels
2017-04-05 11:05:14,701 - Problem connecting to Sauce Labs REST API (HTTP server responded with 'java.io.IOException: Server returned H
TTP response code: 400 for URL: https://saucelabs.com/rest/v1/OMNIUM_DPIDEV/tunnels' (expected 'OK'))
2017-04-05 11:05:14,701 - Could not reach Sauce Labs REST API after 6 tries. Is your network down or firewalled?
2017-04-05 11:05:14,701 - \ Exiting /`
I noticed that using Connect v4 on failed connections it will sit on stop
never calling the callback
. See sauce-tunnel/index.js.
I'm guessing this happens because when tunnel.start(...)
passes a status of false
to its callback the proc
is already killed. So when I then call tunnel.stop(...)
in the start
callback for the false
status it just waits forever.
Just a heads up. When SauceLabs released Sauce Connect 4.3.15 somefolks noticed an issue causing intermittent crashes in the built-in HTTP proxy typically seen when a PAC is used and HTTPS websites are accessed. A new version (4.3.16) containing a fix for this is now available:
As of May 31, 2019 the version of sauceconnect used in this module (4.3.16) is no longer supported by SauceLabs.
here is the error, would you be able to help, please?
Running "saucelabs-mocha:all" (saucelabs-mocha) task
=> Starting Tunnel to Sauce Labs
>> /home/.../grunt-saucelabs/node_modules/sauce-tunnel/vendor/linux/bin/sc: 1: /home/.../node_modules/grunt-saucelabs/node_modules/sauce-tunnel/vendor/linux/bin/sc: Syntax error: "(" unexpected
=> Stopping Tunnel to Sauce Labs
Hi @jmreidy
I have a question regarding passing pac file as part of options while creating sauce tunnel. I have tried the below way, but it didn't work.
var tunnel = new SauceTunnel('user', 'key', 'my-tunnel', true,'--pac **.pac' );
What is the right approach to pass pac file?
Thanks,
Raghul
I've been using sauce-tunnel and it's been very helpful, however I can't seem to figure out how to print verbose output about the sauce tunnel (not just the sauce lab's selenium servers). The extraArgs array with the flag "--verbose" is for the selenium servers, but I want to see the line by line output from the Sauce Tunnel application. I'm not sure if I'm missing something, but I read through the READMe and still can't figure this out.
Sauce Connect v4 is vulnerable to Heartbleed. v4.1 has been released as a fix.
http://sauceio.com/index.php/2014/04/regarding-heartbleed-and-sauce-labs/
Hiyo :) New Sauce Connect version.
Download URLs/checksums:
https://saucelabs.com/downloads/sc-4.3.10-linux.tar.gz
SHA1: 744039a0f9530463eca62baf6d16cb9db8f836c7
https://saucelabs.com/downloads/sc-4.3.10-linux32.tar.gz
SHA1: 66d8e16b368dc65819f3a758de07234285ec6658
https://saucelabs.com/downloads/sc-4.3.10-osx.zip
SHA1: 6ec6f7e2af76a189ed8ceadd31282c5fce1e7dae
https://saucelabs.com/downloads/sc-4.3.10-win32.zip
SHA1: 0f29c39d062cb761a1c297b739301d7ef09bdd12
The SauceTunnel
function always sets the identifier
attribute to a value passed as argument or a string with a timestamp:
this.identifier = identifier || 'Tunnel'+new Date().getTime();
This means that the following condition is always entered:
if (this.identifier) {
args.push("-i", this.identifier);
}
Unless the identifier is unset explicitly after creating the object:
var sauceTunnel = new SauceTunnel(...);
sauceTunnel.identifier = null;
This is an awkward way to create an unnamed tunnel.
The API is the same, I've heard some people clamoring for this update :-) Happy to help if it's a bunch of work for you to update it.
Current version supplied with this package (4.3.9
) is not compatible anymore or it seems so as
running the it results in this error on MacOSX:
Peer certificate cannot be authenticated with given CA certificates
Replacing the binary supplied in the vendor directory for darwin
with the downloaded sc
version (4.3.12
) it works just fine.
This indicates a version compatibility issue.
Would you like to receive a PR for the most recent package versions?
I'm trying to download the npm package and getting:
http://registry.npmjs.org/sauce-tunnel/-/sauce-tunnel-1.1.1.tgz
{"error":"not_found","reason":"Document is missing attachment"}
Version in the repo: Sauce Connect 3.0-r28, build 43
Latest version on Sauce's site: Sauce Connect 3.0-r30, build 46
See the issue posted here: axemclion/grunt-saucelabs#95
I'm assuming the problem is actually inside the sauce connect jar. If so, I'll pass the message on.
It's pretty unintuitive that new SauceTunnel(process.env.SAUCE_USERNAME, process.env.SAUCE_ACCESSKEY)
creates a tunnel that does nothing.
Would it be possible to create a method for updating the binaries programmatically ?
check out this gist
Starting up two tunnels causes the second to immediately fail.
I'm getting a shasum check failed error when trying to install via npm:
npm ERR! Error: shasum check failed for /var/folders/t6/8zv34y2111l2dq1_fwjx3krw0000gn/T/npm-6640-o2KBtyGo/1397337395619-0.37695143604651093/tmp.tgz
npm ERR! Expected: 6c8fa750be7138e3b3681008fe5cb9bb52069ec7
npm ERR! Actual: 7142b907199eb3d260c789015979114a9475521f
npm ERR! From: https://registry.npmjs.org/sauce-tunnel/-/sauce-tunnel-2.0.4.tgz
npm ERR! at /usr/local/lib/node_modules/npm/node_modules/sha/index.js:38:8
npm ERR! at ReadStream.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/sha/index.js:85:7)
npm ERR! at ReadStream.EventEmitter.emit (events.js:117:20)
npm ERR! at _stream_readable.js:920:16
npm ERR! at process._tickCallback (node.js:415:13)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Darwin 12.5.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/ME/MYPROJECT
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users//ME/MYPROJECT/npm-debug.log
npm ERR! not ok code 0
I also tried downloading the .tgz file and got errors trying to untar, so possibly an issue with the file itself?
$ tar -zxvf sauce-tunnel-2.0.4.tgz
x package/package.json
x package/.npmignore
x package/README.md
x package/index.js
x package/LICENSE-MIT
x package/vendor/darwin/bin/sc
x package/vendor/darwin/bin/sc.dSYM/Contents/Info.plist
x package/vendor/darwin/bin/sc.dSYM/Contents/Resources/DWARF/sc
x package/vendor/darwin/license.html
x package/vendor/linux/bin/sc: (Empty error message)
tar: Error exit delayed from previous errors.
$ gunzip -c sauce-tunnel-2.0.4.tgz | tar xvf -
x package/package.json
x package/.npmignore
x package/README.md
x package/index.js
x package/LICENSE-MIT
x package/vendor/darwin/bin/sc
x package/vendor/darwin/bin/sc.dSYM/Contents/Info.plist
x package/vendor/darwin/bin/sc.dSYM/Contents/Resources/DWARF/sc
x package/vendor/darwin/license.html
x package/vendor/linux/bin/sc
gzip: sauce-tunnel-2.0.4.tgz: unexpected end of file
: Truncated tar archive
tar: Error exit delayed from previous errors.
When running this on OSX 10.8 I get:
Exception in thread "main" Traceback (most recent call last):
File "<string>", line 1, in <module>
File "__pyclasspath__/sauce_connect.py", line 3, in <module>
ImportError: No module named __future__
This happens when Sauce-Connect.jar is called:
Lines 26 to 27 in 966a5ea
If I change those lines to:
var args = ["-jar", "Sauce-Connect.jar", this.user, this.key, "-i", this.identifier];
this.proc = proc.spawn('java', args, {
cwd: __dirname + "/vendor"
});
It works.
So it looks like we need a relative path for the jar.
Sauce Connect 4.3.7 is now available. Download links:
The new Sauce Connect has improvements for high concurrency and has been load tested. Can sauce-tunnel please be upgraded to use the latest Sauce Connect?
Please update the sc.exe version to latest as the current version is not connecting. i have changed the sc.exe for windows. please update it to latest versions
While a single line written to the stdout of the sc
process might always span multiple lines/data events in Node, the recognition of a successful tunnel startup is pretty flaky under Windows (and eventually also on other OS).
Such an unrecognized process is then just waiting forever.
Example output:
13 Mar 11:53:01 - Sauce Conne ct is up, you may start your tests.
https://saucelabs.com/downloads/sc-4.3.9-linux.tar.gz SHA1: 2ee561d16069f20f09fe22bf27e93d658f24d23a
https://saucelabs.com/downloads/sc-4.3.9-linux32.tar.gz SHA1: 285924db00bac5038f0a0d20b6c334b1c55b2570
https://saucelabs.com/downloads/sc-4.3.9-osx.zip SHA1: b15857b60c8b6e1105a241c9faebd7896192c1e0
https://saucelabs.com/downloads/sc-4.3.9-win32.zip SHA1: 1d397d58692fbe8585a0fac66f8dfa5de5dc2c12
The travis build logs show that the encrypted Sauce Labs username/access key is incorrect in .travis.yml.
Looks like named tunnels (-i flag) are broken for the SC4 binary. Might want to revert until they're fixed.
See https://docs.saucelabs.com/reference/sauce-connect/
It appears to be a stable release.
Supersedes #26.
It does so here: https://github.com/jmreidy/sauce-tunnel/blob/master/index.js#L103
If the tunnels have a tunnel_identifier (and it doesn't conflict with the one we're trying to start), they can and should be left running. This causes trouble for Travis CI users who rely on the tunnel_identifier feature to run multiple simultaneous tunnels.
The underlying sauce-connect.jar takes care of shutting down conflicting tunnels โ it may be best to just leave it up to sauce-connect rather than duplicating the logic.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.