[1.6.3] A session is either terminated or not started

See original GitHub issue

The problem

Hey guys, I’ve been getting this issue quite frequently when running tests on appium via webdriverIO on my Note 4. Its been getting quite frequent which is causing my tests to time out, hang or fail: ERROR: A session is either terminated or not started.

I’m not sure how to resolve this issue.

I think this might be a chromedriver issue, as i have this in the following logs.

[Chromedriver] ProxyRequestError: Could not proxy command to remote server. Original error: Error: connect ECONNREFUSED 127.0.0.1:8000
    at JWProxy.proxy$ (../../../lib/jsonwp-proxy/proxy.js:126:13)
    at tryCatch (C:\Users\Rambo\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\Rambo\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (C:\Users\Rambo\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (C:\Users\Rambo\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
 { ProxyRequestError: Could not proxy command to remote server. Original error: Error: connect ECONNREFUSED 127.0.0.1:8000
    at JWProxy.proxy$ (../../../lib/jsonwp-proxy/proxy.js:126:13)
    at tryCatch (C:\Users\Rambo\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\Rambo\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (C:\Users\Rambo\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (C:\Users\Rambo\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
  jsonwp: 
   { Error: connect ECONNREFUSED 127.0.0.1:8000
       at Object.exports._errnoException (util.js:1026:11)
       at exports._exceptionWithHostPort (util.js:1049:20)
       at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
     code: 'ECONNREFUSED',
     errno: 'ECONNREFUSED',
     syscall: 'connect',
     address: '127.0.0.1',
     port: 8000 } }

Environment

  • Appium version: 1.6.3
  • Desktop OS/version used to run Appium: Windows 10 - 64 bit
  • Node.js version: 7.0.0
  • Npm version: 4.3.0
  • Mobile platform/version under test: Android 6.0.1
  • Real device or emulator/simulator: Samsung Note 4.
  • Appium CLI

Link to Appium logs

The full log:

https://gist.github.com/johnRambo2k14/5d47195974fbeca380f1eb83d2e41071

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:22 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
dolanmiucommented, Jan 18, 2019

I encounter this kind of question,finally i solve it.First time i set newCommandTimeout: “4000” to “newCommandTimeout”: “400000”,after i return to 4000 the Exception had solved.

I wouldn’t exactly call this a fix lol

2reactions
erustusagutucommented, Jul 9, 2019

The “newCommandTimeout” here is set to 0.

In doc, the value stands for “How long (in seconds) Appium will wait for a new command from the client before assuming the client quit and ending the session”. So you can set a bigger one, e.g. 60.

This capability when set to 0 means it has no timeout so that can’t be the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

A session is either terminated or not started - Appium Discuss
It's a timing issue. The first Appium server has not finished exiting. Solutions: Run the Server on a different port: https://stackoverflow.com/ ...
Read more >
A session is either terminated or not started - Stack Overflow
Firstly app opens and the home page is appeared and then it is closed. Then app opens second time and no case are...
Read more >
appium/appium - Gitter
has anyone seen "Encountered internal error running command: NoSuchDriverError: A session is either terminated or not started".
Read more >
How to Solve Nosuchdriver:A Session Is Either Terminated Not ...
I just update the appium desktop to 1.6.3 latest. ... A session is either terminated or not started this was working fine before...
Read more >
A session is either terminated or not started ,appium in ...
Hi All, I got a error when launch appium,these are the sever logs node and eclipse. please send me solutions as early as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found