I have a rails app with some Capybara/Selenium tests. Travis runs these tests automatically on each commit.
3 days ago, my build ran successfully.
As of today, a build of the same commit is failing in travis with the following error.
Selenium::WebDriver::Error::JavascriptError:
javascript error: this.each is not a function
(Session info: chrome=81.0.4044.92)
When I scan my code for this.each
, I see that it exists many times in jQuery.
Travis Config
I presumed that there would be a travis configuration difference between the 2 builds.
When I compare the configuration of the successful build and the failed build, the configuration is identical except for the Build id and Job id.
Build language: ruby
Build dist: xenial
Build id: 673499273
Job id: 673499274
Runtime kernel version: 4.15.0-1028-gcp
travis-build version: f65a8dc88
[34m[1mBuild image provisioning date and time[0m
Mon Mar 25 16:43:24 UTC 2019
[34m[1mOperating System Details[0m
Distributor ID: Ubuntu
Description: Ubuntu 16.04.6 LTS
Release: 16.04
Codename: xenial
[34m[1mSystemd Version[0m
systemd 229
[34m[1mCookbooks Version[0m
42e42e4 https://github.com/travis-ci/travis-cookbooks/tree/42e42e4
[34m[1mgit version[0m
git version 2.21.0
[34m[1mbash version[0m
GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)
[34m[1mgcc version[0m
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609
[34m[1mdocker version[0m
Client:
Version: 18.06.0-ce
API version: 1.38
Go version: go1.10.3
Git commit: 0ffa825
Built: Wed Jul 18 19:11:02 2018
OS/Arch: linux/amd64
Experimental: false
Server:
Engine:
Version: 18.06.0-ce
API version: 1.38 (minimum version 1.12)
Go version: go1.10.3
Git commit: 0ffa825
Built: Wed Jul 18 19:09:05 2018
OS/Arch: linux/amd64
Experimental: false
[34m[1mclang version[0m
clang version 7.0.0 (tags/RELEASE_700/final)
[34m[1mjq version[0m
jq-1.5
[34m[1mbats version[0m
Bats 0.4.0
[34m[1mshellcheck version[0m
0.6.0
[34m[1mshfmt version[0m
v2.6.3
[34m[1mccache version[0m
3.2.4
[34m[1mcmake version[0m
cmake version 3.12.4
[34m[1mheroku version[0m
heroku/7.22.7 linux-x64 node-v11.10.1
[34m[1mimagemagick version[0m
Version: ImageMagick 6.8.9-9 Q16 x86_64 2018-09-28 http://www.imagemagick.org
[34m[1mmd5deep version[0m
4.4
[34m[1mmercurial version[0m
version 4.8
[34m[1mmysql version[0m
mysql Ver 14.14 Distrib 5.7.25, for Linux (x86_64) using EditLine wrapper
[34m[1mopenssl version[0m
OpenSSL 1.0.2g 1 Mar 2016
[34m[1mpacker version[0m
1.3.3
[34m[1mpostgresql client version[0m
psql (PostgreSQL) 10.7 (Ubuntu 10.7-1.pgdg16.04+1)
[34m[1mragel version[0m
Ragel State Machine Compiler version 6.8 Feb 2013
[34m[1msudo version[0m
1.8.16
[34m[1mgzip version[0m
gzip 1.6
[34m[1mzip version[0m
Zip 3.0
[34m[1mvim version[0m
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 24 2016 16:44:48)
[34m[1miptables version[0m
iptables v1.6.0
[34m[1mcurl version[0m
curl 7.47.0 (x86_64-pc-linux-gnu) libcurl/7.47.0 GnuTLS/3.4.10 zlib/1.2.8 libidn/1.32 librtmp/2.3
[34m[1mwget version[0m
GNU Wget 1.17.1 built on linux-gnu.
[34m[1mrsync version[0m
rsync version 3.1.1 protocol version 31
[34m[1mgimme version[0m
v1.5.3
[34m[1mnvm version[0m
0.34.0
[34m[1mperlbrew version[0m
/home/travis/perl5/perlbrew/bin/perlbrew - App::perlbrew/0.86
[34m[1mphpenv version[0m
rbenv 1.1.2
[34m[1mrvm version[0m
rvm 1.29.7 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
[34m[1mdefault ruby version[0m
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]
[34m[1mCouchDB version[0m
couchdb 1.6.1
[34m[1mElasticSearch version[0m
5.5.0
[34m[1mInstalled Firefox version[0m
firefox 63.0.1
[34m[1mMongoDB version[0m
MongoDB 4.0.7
[34m[1mPhantomJS version[0m
2.1.1
[34m[1mPre-installed PostgreSQL versions[0m
9.4.21
9.5.16
9.6.12
[34m[1mRedis version[0m
redis-server 5.0.4
[34m[1mPre-installed Go versions[0m
1.11.1
[34m[1mmvn version[0m
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T18:41:47Z)
[34m[1mgradle version[0m
Gradle 4.10.2!
[34m[1mlein version[0m
Leiningen 2.9.1 on Java 11.0.2 OpenJDK 64-Bit Server VM
[34m[1mPre-installed Node.js versions[0m
v10.15.3
v11.0.0
v4.9.1
v6.17.0
v8.12.0
v8.15.1
v8.9
[34m[1mphpenv versions[0m
system
5.6
5.6.40
7.1
7.1.27
7.2
* 7.2.15 (set by /home/travis/.phpenv/version)
hhvm
hhvm-stable
[34m[1mcomposer --version[0m
Composer version 1.8.4 2019-02-11 10:52:10
[34m[1mPre-installed Ruby versions[0m
ruby-2.3.8
ruby-2.4.5
ruby-2.5.3
travis_fold:end:system_info
What else should I check to diagnose this problem?
3
Answers
I have a solution to this issue. Based on the "this.each" error listed above, I scanned the code and saw that string was present in prototype.js.
The rails code had an old instance of prototype.js. I upgraded that to the latest version of prototype.js and the build succeeded.
Unfortunately, I could not find any other differences in the Travis build output that suggested a difference in how the javascript resources were assembled.
Perhaps this change was sensitive to updates in my build caches on Travis. I would be curious to learn of a better explanation for why the same build began failing a few days ago.
It’s coming from selenium web driver and the cause can be either chrome version or selenium driver itself.
It might not be a viable option for you guys but upgrading browser to latest beta version helped me you can also choose to downgrade the browser and driver
On Node, you can update the driver version like following or you can directly download it from here and replace
Upgrade your chrome version to beta-83 (as it’s at the time of writing) and uninstall old versions which you do as follows on ubuntu 16
Note – In future if you guys encounter this strange issue when chromeV81 Stable, ChromeV83Beta becomes obsolete, Upgrading/Downgrading should help you.
Refer to this Bug on https://bugs.chromium.org/
I also came across this issue in one of the Scripts. This was dealing with a pop-up form within the same window. I was having an alternative to open in a new window. This resolved the issue.