JENKINS: Encountered internal error running command: NoSuchDriverError: A session is either terminated or not started


#1

Getting the below error while running my automated tests on jenkins server

Logs:
10:19:26 [Appium] Welcome to Appium v1.9.1
10:19:26 [Appium] Appium REST http interface listener started on 0.0.0.0:4723
10:19:26 [HTTP] --> GET /wd/hub/status
10:19:26 [HTTP] {}
10:19:26 [debug] [GENERIC] Calling AppiumDriver.getStatus() with args: []
10:19:26 [debug] [GENERIC] Responding to client with driver.getStatus() result: {“build”:{“version”:“1.9.1”}}
10:19:26 [HTTP] <-- GET /wd/hub/status 200 15 ms - 67
10:19:26 [HTTP]
10:19:26 [HTTP] --> POST /wd/hub/session/02152043-75d6-4c58-92c4-a5c90d45ade4/appium/app/close
10:19:26 [HTTP] {}
10:19:26 [debug] [GENERIC] Encountered internal error running command: NoSuchDriverError: A session is either terminated or not started
10:19:26 [debug] [GENERIC] at asyncHandler$ (/usr/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:260:15)
10:19:26 [debug] [GENERIC] at tryCatch (/usr/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
10:19:26 [debug] [GENERIC] at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
10:19:26 [debug] [GENERIC] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
10:19:26 [debug] [GENERIC] at invoke (/usr/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
10:19:26 [debug] [GENERIC] at enqueueResult (/usr/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:185:17)
10:19:26 [debug] [GENERIC] at new Promise ()
10:19:26 [debug] [GENERIC] at new F (/usr/lib/node_modules/appium/node_modules/core-js/library/modules/$.export.js:30:36)
10:19:26 [debug] [GENERIC] at AsyncIterator.enqueue (/usr/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:184:12)
10:19:26 [debug] [GENERIC] at AsyncIterator.prototype.(anonymous function) [as next] (/usr/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
10:19:26 [debug] [GENERIC] at Object.runtime.async (/usr/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:209:12)
10:19:26 [debug] [GENERIC] at asyncHandler (/usr/lib/node_modules/appium/node_modules/appium-base-driver/build/lib/protocol/protocol.js:380:32)
10:19:26 [debug] [GENERIC] at /usr/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:446:15
10:19:26 [debug] [GENERIC] at Layer.handle [as handle_request] (/usr/lib/node_modules/appium/node_modules/express/lib/router/layer.js:95:5)
10:19:26 [debug] [GENERIC] at next (/usr/lib/node_modules/appium/node_modules/express/lib/router/route.js:137:13)
10:19:26 [debug] [GENERIC] at Route.dispatch (/usr/lib/node_modules/appium/node_modules/express/lib/router/route.js:112:3)
10:19:26 [debug] [GENERIC] at Layer.handle [as handle_request] (/usr/lib/node_modules/appium/node_modules/express/lib/router/layer.js:95:5)
10:19:26 [debug] [GENERIC] at /usr/lib/node_modules/appium/node_modules/express/lib/router/index.js:281:22
10:19:26 [debug] [GENERIC] at param (/usr/lib/node_modules/appium/node_modules/express/lib/router/index.js:354:14)
10:19:26 [debug] [GENERIC] at param (/usr/lib/node_modules/appium/node_modules/express/lib/router/index.js:365:14)
10:19:26 [debug] [GENERIC] at Function.process_params (/usr/lib/node_modules/appium/node_modules/express/lib/router/index.js:410:3)
10:19:26 [debug] [GENERIC] at next (/usr/lib/node_modules/appium/node_modules/express/lib/router/index.js:275:10)
10:19:26 [debug] [GENERIC] at logger (/usr/lib/node_modules/appium/node_modules/morgan/index.js:144:5)
10:19:26 [debug] [GENERIC] at Layer.handle [as handle_request] (/usr/lib/node_modules/appium/node_modules/express/lib/router/layer.js:95:5)
10:19:26 [debug] [GENERIC] at trim_prefix (/usr/lib/node_modules/appium/node_modules/express/lib/router/index.js:317:13)
10:19:26 [debug] [GENERIC] at /usr/lib/node_modules/appium/node_modules/express/lib/router/index.js:284:7
10:19:26 [debug] [GENERIC] at Function.process_params (/usr/lib/node_modules/appium/node_modules/express/lib/router/index.js:335:12)
10:19:26 [debug] [GENERIC] at next (/usr/lib/node_modules/appium/node_modules/express/lib/router/index.js:275:10)
10:19:26 [debug] [GENERIC] at /usr/lib/node_modules/appium/node_modules/body-parser/lib/read.js:130:5
10:19:26 [debug] [GENERIC] at invokeCallback (/usr/lib/node_modules/appium/node_modules/raw-body/index.js:224:16)
10:19:26 [debug] [GENERIC] at done (/usr/lib/node_modules/appium/node_modules/raw-body/index.js:213:7)
10:19:26 [debug] [GENERIC] at IncomingMessage.onEnd (/usr/lib/node_modules/appium/node_modules/raw-body/index.js:273:7)
10:19:26 [debug] [GENERIC] at emitNone (events.js:106:13)
10:19:26 [debug] [GENERIC] at IncomingMessage.emit (events.js:208:7)
10:19:26 [debug] [GENERIC] at endReadableNT (_stream_readable.js:1064:12)
10:19:26 [debug] [GENERIC] at _combinedTickCallback (internal/process/next_tick.js:139:11)
10:19:26 [debug] [GENERIC] at process._tickCallback (internal/process/next_tick.js:181:9)
10:19:26 [HTTP] <-- POST /wd/hub/session/02152043-75d6-4c58-92c4-a5c90d45ade4/appium/app/close 404 18 ms - 3834