Travis Selenium Test Failure: javascript error: this.each is not a function - selenium

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?

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
npx webdriver-manager update --versions.chrome=83.0.4103.39
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
sudo apt-get purge google-chrome-stable
rm ~/.config/google-chrome/ -rf
wget https://dl.google.com/linux/direct/google-chrome-beta_current_amd64.deb
sudo dpkg -i google-chrome-beta_current_amd64.deb
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.

Related

Newer version of cmake available in CentOS 7 than in CentOS 8?

I have CentOS 7 and CentOS 8 installed on 2 VMs. Both have epel enabled.
CentOS 7:
$ cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core)
$ yum repolist
...
repo id repo name status
base/7/x86_64 CentOS-7 - Base 10070
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 13445
extras/7/x86_64 CentOS-7 - Extras 413
updates/7/x86_64 CentOS-7 - Updates 1127
repolist: 25055
CentOS 8:
$ cat /etc/redhat-release
CentOS Linux release 8.2.2004 (Core)
$ yum repolist
repo id repo name
AppStream CentOS-8 - AppStream
BaseOS CentOS-8 - Base
PowerTools CentOS-8 - PowerTools
epel Extra Packages for Enterprise Linux 8 - x86_64
epel-modular Extra Packages for Enterprise Linux Modular 8 - x86_64
extras CentOS-8 - Extras
On CentOS 7, cmake3 is available from the epel repo, and provides cmake version 3.17.
$ yum provides cmake3
...
cmake3-3.17.3-3.el7.x86_64 : Cross-platform make system
Repo : epel
On CentOS 8, cmake3 is available from the AppStream repo, and provides cmake version 3.11.
$ yum provides cmake3
...
cmake-3.11.4-7.el8.x86_64 : Cross-platform make system
Repo : #System
Matched from:
Provide : cmake3 = 3.11.4-7.el8
I tried to disable all repos except for epel, but it's still coming back with the one from AppStream (which seems counter intuitive to me - surely it should come back with nothing if I've disabled all the other repos?)
$ yum --disablerepo=* --enablerepo=epel info cmake
Last metadata expiration check: 0:21:06 ago on Fri 11 Sep 2020 09:44:08 AM UTC.
Installed Packages
Name : cmake
Version : 3.11.4
Release : 7.el8
Architecture : x86_64
Size : 24 M
Source : cmake-3.11.4-7.el8.src.rpm
Repository : #System
From repo : AppStream
Summary : Cross-platform make system
URL : http://www.cmake.org
License : BSD and MIT and zlib
Description : CMake is used to control the software compilation process using simple
: platform and compiler independent configuration files. CMake generates
: native makefiles and workspaces that can be used in the compiler
: environment of your choice. CMake is quite sophisticated: it is possible
: to support complex environments requiring system configuration, preprocessor
: generation, code generation, and template instantiation.
I searched on pkgs.org, and it certainly does seem that cmake-3.11 is the latest version available to CentOS 8.
Apart from building from source, is there any other way to obtain a newer version of cmake on CentOD 8?
The cmake: 3.11.4 version will still be listed when you run yum info because it is already installed, so disabling the AppStream repo won't affect what is shown. If you only want to show available packages (based on your enabled yum repos), you can run this instead:
yum --disablerepo=* --enablerepo=epel info cmake --available
If you want to install the latest version of CMake (or some other version), you can always download the binary distribution from the CMake download page.
Once downloaded, you can extract the package to somewhere you have access to on your machine, e.g.:
mkdir ~/cmake
tar xvzf ~/Downloads/cmake-3.18.2-Linux-x86_64.tar.gz -C ~/cmake
Finally, make sure you add the extracted bin directory to your PATH environment variable so you can run the cmake executable from the command line.

"ERROR command failed: npm install --loglevel error" when trying to do "vue create"

Vue CLI v3.2.1
✨ Creating project in /home/mcaubrey511/portfolio.
🗃 Initializing git repository...
⚙ Installing CLI plugins. This might take a while...
> yorkie#2.0.0 install /home/mcaubrey511/portfolio/node_modules/yorkie
> node bin/install.js
ERROR command failed: npm install --loglevel error
Environment info
System:
OS: Linux 4.18 Ubuntu 18.10 (Cosmic Cuttlefish)
CPU: (1) x64 Intel(R) Xeon(R) CPU # 2.30GHz
Binaries:
Node: 10.14.1 - /usr/bin/node
npm: 6.4.1 - /usr/bin/npm
npmPackages:
#vue/babel-preset-app: 3.2.0
#vue/cli-overlay: 3.2.0
#vue/cli-plugin-babel: ^3.2.0 => 3.2.0
#vue/cli-plugin-eslint: ^3.2.0 => 3.2.1
#vue/cli-service: ^3.2.0 => 3.2.0
#vue/cli-shared-utils: 3.2.0
#vue/component-compiler-utils: 2.3.0
#vue/preload-webpack-plugin: 1.1.0
#vue/web-component-wrapper: 1.2.0
babel-helper-vue-jsx-merge-props: 2.0.3
babel-plugin-transform-vue-jsx: 4.0.1
eslint-plugin-vue: 4.7.1
vue-eslint-parser: 2.0.3
vue-hot-reload-api: 2.3.1
vue-loader: 15.4.2
vue-style-loader: 4.1.2
vue-template-es2015-compiler: 1.6.0
npmGlobalPackages:
#vue/cli: 3.2.1
Any idea what's wrong or what I could do to get it working?
After switching the machine I was using to Ubuntu 18.04 LTS I am no longer having the problem. I made an issue on the vue-cli repository and it seems like at least one other person is having a similar problem, but with a different environment.
If you do apt-get update in terminal before installing the vue/cli, the issue will be solved.
In a nutshell, apt-get update doesn't actually install new versions of software. Instead, it updates the package lists for upgrades for packages that need upgrading, as well as new packages that have just come to the repositories.
apt-get update downloads the package lists from the repositories and "updates" them to get information on the newest versions of packages and their dependencies. It will do this for all repositories and PPAs.

How do I get version of MPC, not MPD

Using Ubuntu 12.04 desktop, but using putty from Windows, so... CLI.
When I type:
mpc version
it reports the version of the mpd daemon.
How can I get the version of the mpc controller, not the daemon?
Thanks.
Mark.
PS, how can I get the latest version of mpc?
Ubuntu repositories are horribly out of date. I'd rather not update mpd as it seems to be working fine.
M.
The mpc command itself has no awareness of its own version. What you can do instead, though, is ask Ubuntu what version you have installed:
phrogz#music:~$ apt-cache policy mpc
mpc:
Installed: 0.27-1
Candidate: 0.27-1
Version table:
*** 0.27-1 0
500 http://us.archive.ubuntu.com/ubuntu/ wily/universe amd64 Packages
100 /var/lib/dpkg/status
Also, note that the version reported by mpc version is (confusingly) not the MPD version either, but returns the protocol version.
gkistner#music:~$ mpc version
mpd version: 0.19.0
gkistner#music:~$ mpd --version | head -1
Music Player Daemon 0.19.10

SShpass not allowed with Travis CI

Context
I have an application in which, I m using unit tests and I need to continuous deliver this. I chose to use github + travis + docker.
My Docker container is an Ubuntu 12.04 with openSSL that I cant connect from outside, and I dont have any problem with this
I need, when the travis build is okay, to connect my docker container via SSH and to run a script.
Problem
Actually, I m using :
But this doesn't work at all, because sshpass is not in the whitelist. It seems that I cant you before_install command, because I m on a container based infrastructure.
NB : The port is 22, I missed it during the picture taken.
Questions
How can I do to connect my ssh container from travis to deploy my app (only run a script that git clone / git pull if the directory exists)
Is this a good way to make it like this with travis, or does it exist something else ?
EDIT :
The travis new file :
And the log
Using worker: worker-linux-968a87ce-1.bb.travis-ci.org:travis-linux-14
system_info
Build system information
Build language: node_js
Build image provisioning date and time
Wed Feb 4 18:22:50 UTC 2015
Operating System Details
Distributor ID: Ubuntu
Description: Ubuntu 12.04 LTS
Release: 12.04
Codename: precise
Linux Version
2.6.32-042stab090.5
Cookbooks Version
23bb455 https://github.com/travis-ci/travis-cookbooks/tree/23bb455
GCC version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
LLVM version
clang version 3.4 (tags/RELEASE_34/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Pre-installed Ruby versions
ruby-1.9.3-p551
Pre-installed Node.js versions
v0.10.36
Pre-installed Go versions
1.4.1
Redis version
redis-server 2.8.19
riak version
2.0.2
MongoDB version
MongoDB 2.4.12
CouchDB version
couchdb 1.6.1
Neo4j version
1.9.4
Cassandra version
2.0.9
RabbitMQ Version
3.4.3
ElasticSearch version
1.4.0
Installed Sphinx versions
2.0.10
2.1.9
2.2.6
Default Sphinx version
2.2.6
Installed Firefox version
firefox 31.0esr
PhantomJS version
1.9.8
ant -version
Apache Ant(TM) version 1.8.2 compiled on December 3 2011
mvn -version
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T17:29:23+00:00)
Maven home: /usr/local/maven
Java version: 1.7.0_76, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-oracle/jre
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-042stab090.5", arch: "amd64", family: "unix"
git.checkout
0.26s$ git clone --depth=50 --branch=master git://myPrivateRepo/Project
Cloning into 'user/Project'...
remote: Counting objects: 1363, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 1363 (delta 4), reused 0 (delta 0), pack-reused 1354
Receiving objects: 100% (1363/1363), 874.89 KiB | 0 bytes/s, done.
Resolving deltas: 100% (263/263), done.
Checking connectivity... done.
$ cd user/Project
$ git checkout -qf commitId
1.56s$ nvm install 0.10
######################################################################## 100.0%
Now using node v0.10.38
$ node --version
v0.10.38
$ npm --version
1.4.28
$ nvm --version
0.23.3
before_install
6.72s$ sudo apt-get install sshpass
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libgeos-3.2.2
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
sshpass
0 upgraded, 1 newly installed, 0 to remove and 102 not upgraded.
Need to get 10.5 kB of archives.
After this operation, 56.3 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ precise/universe sshpass amd64 1.05-1 [10.5 kB]
Fetched 10.5 kB in 0s (234 kB/s)
Selecting previously unselected package sshpass.
(Reading database ... 75363 files and directories currently installed.)
Unpacking sshpass (from .../sshpass_1.05-1_amd64.deb) ...
Processing triggers for man-db ...
Setting up sshpass (1.05-1) ...
install
1.12s$ npm install
npm WARN package.json UnitTest#0.0.0 No description
npm WARN package.json UnitTest#0.0.0 No repository field.
npm WARN package.json UnitTest#0.0.0 No README data
0.95s$ npm test
> UnitTest#0.0.0 test /home/travis/build/user/project
> node test
First test should fail: 1) First test should fail
0 passing (8ms)
1 failing
1) First test should fail:
AssertionError: true == false
+ expected - actual
-true
+false
at Context.<anonymous> (test/first.js:8:16)
The command "npm test" exited with 0.
after_success
0.91s$ sudo sshpass -p password ssh root#ip -p 7000
Done. Your build exited with 0.
sshpass can be installed in a Travis CI container by adding:
addons:
apt:
packages:
- sshpass
I see two possible solutions to your problem:
Switch to the non-container based infrastructure of Travis-CI, by adding sudo: true in your .travis file, so you will be able to install the package you need.
Ask for the addition of sshpass in the package white list. Request can be done here: https://github.com/travis-ci/travis-ci/labels/apt-whitelist
Can you use an SSH key instead of sshpass? That way you can simply use the SSH key to connect to the Docker container instead of using a password.

Running into issues installing ruby 2.0 with rvm

The error I keep getting when rvm is trying to import the default gemsets, is:
ruby-2.0.0-p247 - #importing default gemsets, this may take time...............................
/Users/****/.rvm/scripts/functions/support: line 291: 84474 Segmentation fault: 11 "$ruby_path" -rrbconfig -e '\
File.open("'"$config_path"'","w") { |file|
RbConfig::CONFIG.sort.each{|key,value|
file.write("#{key.gsub(/\.|-/,"_")}=\"#{value.gsub("$","\\$")}\"\n")
}
}
' > /dev/null 2>&1
rvm -v
rvm 1.21.17 () by Wayne E. Seguin , Michal Papis [https://rvm.io/]
xcode 4.6.3
uname -a
Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64
sw_vers -productVersion :10.7.5
This can be happening because this ruby was build on OSX 10.8 and this is OSX 10.7 (like mentioned in the other answer), you can make sure it's all fine with disabling binary rubies:
rvm reinstall 2.0.0 --disable-binary
this will tell rvm to not search for binary and to go straight to compile process.
If this works for you then open a ticket for rvm to prepare binaries which are compatible with OSX 10.7
Update 2013.08.06
I have removed the link to binary osx/10.7/x86_64/ruby-2.0.0-p247 - if you prefer to use binaries then please open a ticket for rvm to build version for your system.
If the code you are showing segfaults, it must be a bug in Ruby 2.0. I recommend that you submit a bug report to https://bugs.ruby-lang.org/.
I had the same problem at OS X 10.7.5
I tried: sudo rvm reinstall 2.0.0, but it fails again.
Finally I chose to install a previous version with:
sudo rvm install 1.9.3 and all its ok