Nightwatch.js chromedriver error "Error connecting to localhost on port 9515" - selenium-chromedriver

I have come across this issue multiple times when helping a new hire and each time i have to go through different steps each time to rediscover the fix. These are things that have made it work, unfortunately i am slightly less technical than I used to be and dont exactly know why they work, but they do. Hence i have decided to put this out here, hoping my next new hire will come across this when searching for a fix.
⠋ Connecting to localhost on port 9515...
Starting ChromeDriver 87.0.4280.88 (89e2380a3e36c3464b1382549290d-refs/branch-heads/4280#{#1761}) on port 9515
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
⚠ Error connecting to localhost on port 9515.

Here is a list of things to try:
Upgrade to the lastest version of Chromedriver by deleting node_modules, update the version of chromedriver in package.json and npm install.
An upgrade has fixed such an error message 3 out of 5 times that i have seen it happen.
Check if a chrome driver process is already running on the system and has placed a lock on the port that you are trying to access. Sometimes, chromedriver does not quit when it stops in error, as a result the port from your config is not available and the subsequent runs fail.
On a mac follow these steps :
ps -ax | grep -i chromedriver
Find the PID of the process ( usually an integer in the first column ), then :
kill < PID >
In nightwatch.config.js ( or figure out which config file is being used from your package .json script key ) add :
selenium: {
start_process: true }
If there is already a selenium object, add a comma after the last k-v pair and append this k-v pair to it.

Related

Minishift Error While Downloading OC Binary Version

I am trying to install minishift on Windows. However, I am facing with below Issue while installing It.I have tried with multiple version of Open Shift
Command Used : minishift.exe start --vm-driver virtualbox
Console Out Put :
-- Downloading OpenShift v3.9.0 checksums ... OKError starting the cluster: Error attempting to download and cache 'oc': Failed to validate hash - expected: 7ed04f7bc411056425d98aa6a10536fab15bdb569549446223f6ed22421ea4e6, actual: 705eb110587fdbd244fbb0f93146a643b24295cfe2410ff9fe67a0e880912663
Is their anyway to skip hash validation Check..?
There is currently no option to disable hash validation check. However there is a workaround for your issue, you can download the binary manually and put it into Minishift home - then Minishift on next start will not attempt to download it.
Download oc v3.9.0 release for Windows from its release page
Extract
Move oc.exe binary to .minishift/cache/oc/v3.9.0/windows/oc.exe
Start Minishift
Similar steps will also apply for other platforms and versions of oc. You can search for all releases by tag at Origin release page.
Reason of failure:
I have checked both Checksum on release and actual sha256sum of the binary and your sum is correct. Is it possible that the CHEKSUM file is cached on your proxy? What is the version of Minishift you are using?
If you are willing to invest some of your time, you can create an issue on Minishift so the team can take a deeper look into the problem.
you might receive a 403 forbidden status from GitHub if your request exceeds the rate limit for your IP address.Instead of waiting for GitHub to reset the limit for your IP address, you can create a Personal API Tokens from your personal GitHub account.
Personal API Token generation URL: https://github.com/blog/1509-personal-api-tokens
You need to set Token to environment variable.
For windows10: set MINISHIFT_GITHUB_API_TOKEN=<token_ID>
For Linux: export MINISHIFT_GITHUB_API_TOKEN=<token_ID>
Then run below command on windows CMD:
minishift.exe start --vm-driver virtualbox

how to free a localhost port on mac

I have read the posts similar to this but to no avail.
I am in the midst of a comprehensive tutorial for Angular (5). I am on MacOs High Sierra 10.13.3. I am using Chrome Version 64.0.3282.140 (Official Build) (64-bit).
I just completed one project in the tutorial. I am now trying to complete the next project in the tutorial. The project is set to use the default port 4200 on localhost. All of the projects have executed this way.
I have performed my npm install. My npm start script is simple, = "ng serve". I enter npm start and it serves up the project as expected. I then go to my browser and enter the address localhost:4200. The previous project renders. I can't get the current project to render. These are the things I have tried to remedy the situation:
sudo lsof -i tcp:4200
changing the start script to ng serve --port 4300 and then using the address localhost:4300 (tried it with 5000 too)
Actually the first thing I did was look for an active activity on port 4200 in the Activity Monitor
Clear my Chrome browsing history
Restart my computer.
Tried the same process using Firefox as a browser
Tried it using Brave as a browser
In each and every case when I enter localhost:(anything) I get the previous project. Any ideas?
If I could delete this question I would. I discovered the problem.
I only THOUGHT I was pointing to the new project. In reality, I was pointing at the old project. THAT is why the same thing kept coming up and that is why nothing I tried would work.
I am embarrassed. Clearly, I am still a rookie. I hope no one spent any time on this.

Elastic Beanstalk stops at EbExtensionPostBuild

I am having a problem deploying an EB instance with a custom .ebextensions file. This is the relevant part in that file:
container_commands:
01_migrate:
command: 'python db_migrate.py'
02_npm_build:
command: 'npm install && npm run prod'
As you can see, these commands are for migrating my PostgreSQL database (via a Flask backend) and building my React .jsx files.
If I leave these commands out, the deployment completes perfectly well. However, once I put them in, looking at the eb-activity.log it stalls at this part forever (as far as I can tell):
[2017-04-10T02:39:24.106Z] INFO [3023] - [Application deployment app-613e-170409_223418#1/StartupStage0/EbExtensionPostBuild] : Starting activity...
I also get this message on the Health overview in the console (this is after 1 day):
Performing application deployment (running for 1 day).
I have also tried to deploy it without those container_commands, and then including it back after the successful initial deployment. Then I get the same error message as before in eb-activity.log, and I also get this message on the Health overview:
Incorrect application version "app-2a3d-170409_214923" (deployment 1). Expected version "app-2a3d-170409_214923" (deployment 1).
Which is very strange because those two versions referenced are the same versions. I don't know what this means!
I found a solution.
Remove all you container_commands from .ebextensions/
Go ssh to instance, kill process with.
sudo killall python
Then Deploy new version without container_commands.
And start debuging all your container_commands, one by one on ssh..
Have fun.

PhpStorm & Xdebug - cant get to work debugger with CLI script

This is my first post here, I post because after reading through X articles googling can't get PhpStorm, Xdebug work with CLI scripts.
Already tried to follow advices from:
PHPStorm + XDebug Setup Walkthrough
https://confluence.jetbrains.com/display/PhpStorm/Zero-configuration+Web+Application+Debugging+with+Xdebug+and+PhpStorm
PHPStorm + XDebug + Vagrant
and few blogs that I've found online, but still nothing...
I had it working, but after destroy vagrant recently and now can't fully restore this feature.
SETUP:
I'm running Symfony project on Vagrant.
Debugging of "webpages" on my server works just perfectly.
When I try debug CLI Command I prequisite it with:
export XDEBUG_CONFIG="XDEBUG_SESSION=1"
export PHP_IDE_CONFIG="serverName=vagrant"
XDEBUG.INI (on Vagrant):
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_host=192.168.0.133 (ip I get from ifconfig -a on Vagrant)
xdebug.remote_port=9000
xdebug.max_nesting_level=2500
xdebug.remote_handler=dbgp
xdebug.remote_autostart=1
xdebug.remote_connect_back=1
xdebug.idekey="PHPSTORM"
Any help much appreciated. Digged through X articles on web but in my eyes all configurations look ok, no idea what to do...
Set xdebug.remote_connect_back to be 0.
This option prevents you from using right IP address when you are doing Remote CLI debugging. Since it's a CLI debug, the IP will always be local (vagrant machine) while you need another one.
This option works OK when debugging over browser as request comes from your "real" computer. But when doing CLI debug .. request will be local to Vagrant machine.
When this option is set to 1 (as it is done now) it ignores the setting from #2 below.
xdebug.remote_host=192.168.0.133 (ip I get from ifconfig -a on Vagrant) -- this should be an IP of your computer where PhpStorm is running as seen from Vagrant machine.
Combination of those 2 above will do the job for you.

Apache not starting on MAMP Pro

Apache wont start and it throws an error:
OR
Apache couldn't be started. Please check the log file for more information.
dyld: Symbol not found: _iconv
Referenced from: /usr/lib/libmecabra.dylib
Expected in: /Applications/MAMP/Library/lib/libiconv.2.dylib
in /usr/lib/libmecabra.dylib
/Applications/MAMP/Library/bin/apachectl: line 80: 2799 Trace/BPT trap: 5 $HTTPD "$
This is the same for multiple ports. The reccomended MAMP ports AND the regular apache ports.
MySQL starts perfectly fine.
Any suggestions?
Locked. Comments on this answer have been disabled, but it is still accepting other interactions. Learn more.
I updated to the latest version of yosemite last night.
You apparently have to go to your MAMP folder in Applications. Go to bin -> apache2 -> bin.
Then rename the file from envvars to _envvars.
I also came across another problem of it not working correctly. Make sure the ports are Apache defaults, NOT MAMP defaults (port 80 etc). If it works straight away, this should not apply to you.
Installing the latest release of MAMP 3 Version 3.0.7.3 in my case seems to solve this issue.