{"action":"closed","issue":{"url":"https://api.github.com/repos/appium/appium/issues/4570","labels_url":"https://api.github.com/repos/appium/appium/issues/4570/labels{/name}","comments_url":"https://api.github.com/repos/appium/appium/issues/4570/comments","events_url":"https://api.github.com/repos/appium/appium/issues/4570/events","html_url":"https://github.com/appium/appium/issues/4570","id":58233553,"number":4570,"title":"Issue with Appium 1.3.4  - Unhandled error: TypeError: Cannot read property 'args' of null","user":{"login":"rahulk06","id":9517306,"avatar_url":"https://avatars.githubusercontent.com/u/9517306?v=3","gravatar_id":"","url":"https://api.github.com/users/rahulk06","html_url":"https://github.com/rahulk06","followers_url":"https://api.github.com/users/rahulk06/followers","following_url":"https://api.github.com/users/rahulk06/following{/other_user}","gists_url":"https://api.github.com/users/rahulk06/gists{/gist_id}","starred_url":"https://api.github.com/users/rahulk06/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rahulk06/subscriptions","organizations_url":"https://api.github.com/users/rahulk06/orgs","repos_url":"https://api.github.com/users/rahulk06/repos","events_url":"https://api.github.com/users/rahulk06/events{/privacy}","received_events_url":"https://api.github.com/users/rahulk06/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/appium/appium/labels/NeedsTriage","name":"NeedsTriage","color":"ededed"},{"url":"https://api.github.com/repos/appium/appium/labels/OnGoing","name":"OnGoing","color":"006b75"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-19T16:42:50Z","updated_at":"2015-06-03T16:52:12Z","closed_at":"2015-06-03T16:52:12Z","body":"Hi ,\r\n\r\nI am sending request on appium server (version 1.3.4) one after the another in a sequential order. As I know appium can run only one session at a time. But when I send multiple request I see the below error in the logs  :-\r\n\r\n2015-02-13 05:51:35:339 - \u001B[36minfo\u001B[39m: \u001B[37m<-- DELETE /wd/hub/session \u001B[39m\u001B[32m200\u001B[39m\u001B[90m 2783.225 ms - 76\u001B[39m \u001B[90m{\"status\":0,\"value\":null,\"sessionId\":\"4b51d604-7022-4d7e-bd24-bdbf6c8bb43e\"}\u001B[39m\r\n2015-02-13 05:51:36:079 - \u001B[36minfo\u001B[39m: [debug] http://XXX.XX.XX.XX/jenkins/job/XXX_Android_PlayStore/lastSuccessfulBuild/artifact/XXXApp/bin/XXXAndroid-release.apk downloaded to C:\\Windows\\TEMP\\115112-232-izuhrb\\appium-app.apk\r\n2015-02-13 05:51:36:079 - \u001B[36minfo\u001B[39m: [debug] Creating new appium session ed4c7d8c-50e2-4204-b9a9-c72d43ed971e\r\n2015-02-13 05:51:36:129 - \u001B[31merror\u001B[39m: Unhandled error: TypeError: Cannot read property 'args' of null\r\n    at Appium.invoke (C:\\Users\\vdl\\AppData\\Roaming\\npm\\node_modules\\appium\\lib\\appium.js:247:18)\r\n    at null.<anonymous> (C:\\Users\\vdl\\AppData\\Roaming\\npm\\node_modules\\appium\\lib\\appium.js:112:14)\r\n    at null.<anonymous> (C:\\Users\\vdl\\AppData\\Roaming\\npm\\node_modules\\appium\\lib\\devices\\android\\android-common.js:61:5)\r\n    at null.<anonymous> (C:\\Users\\vdl\\AppData\\Roaming\\npm\\node_modules\\appium\\lib\\devices\\device.js:121:9)\r\n    at WriteStream.<anonymous> (C:\\Users\\vdl\\AppData\\Roaming\\npm\\node_modules\\appium\\lib\\helpers.js:22:7)\r\n    at WriteStream.emit (events.js:117:20)\r\n    at fs.js:1610:14\r\n    at Object.oncomplete (fs.js:108:15) context: [POST /wd/hub/session {\"desiredCapabilities\":{\"isWait\":\"false\",\"Version\":\"4.2\",\"platform\":\"android\",\"platformVersion\":\"4.2\",\"app\":\"http://XXX.XX.XX.XX/jenkins/job/XXX_Android_PlayStore/lastSuccessfulBuild/artifact/XXXApp/bin/XXXAndroid-release.apk]\r\n2015-02-13 05:51:41:442 - \u001B[36minfo\u001B[39m: \u001B[37m-->\u001B[39m \u001B[37mPOST\u001B[39m \u001B[37m/wd/hub/session\u001B[39m \u001B[90m{\"desiredCapabilities\":{\"isWait\":\"false\",\"Version\":\"4.2\",\"platform\":\"android\",\"platformVersion\":\"4.2\",\"app\":\"http://XXX.XX.XX.XX/jenkins/job/XXX_Android_PlayStore/lastSuccessfulBuild/artifact/XXXApp/bin/XXXAndroid-release.apk \",\"deviceId\":\"057bedea\",\"deviceName\":\"Google Nexus 7 (MTV)*\",\"tempSessionId\":\"d394e32b-ce9f-4069-b102-943e995c252c\",\"browserName\":\"android\",\"deviceCategory\":\"phone\",\"platformName\":\"android\"}}\u001B[39m\r\n\r\n\r\n\r\n~~On close inspection, I found that there is no POST call made for session creation after the DELETE call in above log, but still the log says : \" Creating new appium session ed4c7d8c-50e2-4204-b9a9-c72d43ed971e\" also since there was no POST call , there is no payload sent for this and therefore it goes into a state where it creates a session but never deletes it, therefore no more session creation call succeeds and all the requests fails saying \"Error: Requested a new session but one was in progress\".~~\r\n\r\nI think this is the POST call (printed some lines below the error mesage \"Unhandled error\" in above log) for which it was trying to create the session and then it failed :\r\n\r\nat Object.oncomplete (fs.js:108:15) context: [POST /wd/hub/session {\"desiredCapabilities\":{\"isWait\":\"false\",\"Version\":\"4.2\",\"platform\":\"android\",\"platformVersion\":\"4.2\",\"app\":\"http://XXX.XX.XX.XX/jenkins/job/XXX_Android_PlayStore/lastSuccessfulBuild/artifact/XXXApp/bin/XXXAndroid-release.apk]\r\n\r\nIt is happening very frequently, for some request it works and then it fails with this error.\r\nCan you please help me with this issue. I have not seen this issue on older versions of appium like 1.1. Please let me know if there is any work around.\r\n\r\nThanks,\r\nRahul."}}