appium: [1.6.3] A session is either terminated or not started
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
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 24 (1 by maintainers)
I wouldn’t exactly call this a fix lol
This capability when set to 0 means it has no timeout so that can’t be the issue.
I have the same issue as above, same error
when Appium takes a screenshot, it crashes.
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.
Here’s an example from my instance of the bug, I have filtered out only the session related lines and this is the logs from the beginning of the session to the end.
As you can see the line which errors is:
[HTTP] --> POST /wd/hub/session/08e92283-00a8-40e6-8826-d824c54c9376/elements
where the driver tries to POST to an incorrect session. The session it tries to POST to is not mentioned anywhere else in the log.Also this happens about 15% of the time. This bug has occurred for me on the drivers: XCUITest, UiAutomator and UiAutomator2.
Here are the capabilities from the session above
Additional Information: This only happens when trying to use find elements soon after the driver has initialised in this example approximately 23 seconds had elapsed between the session being created to the invalid POST request.
Is it possible to get this issue reopened as I think this is a genuine issue.
closing since no response. also the screenshot error is a red herring; that’s saying it couldn’t take a screenshot after ending the session. but of course you can’t!
@mykola-mokhnach , hmm, i have this in the console though,
The above shows entering the string “Ali” into the input field and clicking on the login button with the id “login”, then Its looking for the element with the class “'toast-message” which it cant find, so that’s why it keeps repeating itself, which is expected behavior as its waiting for the element to appear, so it throws a fail but it tries to take the screenshot which is where it fails.
The npm debug log: https://gist.github.com/johnRambo2k14/d1b9a0af9caa8247e59e7b5422e7c642