Error: volttron.platform.web INFO: Web server not started - volttron

I am having a hard time creating my first example listener agent on the Volttron platform. This is the error I am getting when I enter the (tail volttron.log) command after creating and starting the agent:
2017-01-13 13:12:56,664 (listeneragent-3.2 16153)
volttron.platform.vip.agent.core ERROR: No response to hello message
after 10 seconds.
2017-01-13 13:12:56,664 (listeneragent-3.2 16153)
volttron.platform.vip.agent.core ERROR: A common reason for this is a
conflicting VIP IDENTITY.
2017-01-13 13:12:56,664 (listeneragent-3.2 16153)
volttron.platform.vip.agent.core ERROR: Shutting down agent.
2017-01-13 13:12:56,664 (listeneragent-3.2 16153)
volttron.platform.vip.agent.core ERROR: Possible conflicting identity
is: platform.listener }
When I activate the Volttron platform and just run the (tail volttron.log) command without creating any agents, I get this message
in the terminal :-
{ 2017-01-13 13:22:06,276 () volttron.platform.vip.agent.core DEBUG:
Running onstart methods.
2017-01-13 13:22:06,277 () volttron.platform.vip.agent.core INFO:
Connected to platform: router: ce01039f-9fc1-4395-b294-0c008f43aa8b
version: 1.0 identity: pubsub
2017-01-13 13:22:06,277 () volttron.platform.vip.agent.core DEBUG:
Running onstart methods.
2017-01-13 13:22:06,278 () volttron.platform.vip.agent.core INFO:
Connected to platform: router: ce01039f-9fc1-4395-b294-0c008f43aa8b
version: 1.0 identity: pubsub.compat
2017-01-13 13:22:06,278 () volttron.platform.vip.agent.core DEBUG:
Running onstart methods.
2017-01-13 13:22:06,279 () volttron.platform.vip.agent.core INFO:
Connected to platform: router: ce01039f-9fc1-4395-b294-0c008f43aa8b
version: 1.0 identity: master.web
2017-01-13 13:22:06,279 () volttron.platform.vip.agent.core DEBUG:
Running onstart methods.
2017-01-13 13:22:06,279 () volttron.platform.main INFO: loading
protected-topics file /home/mint/.volttron/protected_topics.json
2017-01-13 13:22:06,279 () volttron.platform.main INFO:
protected-topics file /home/mint/.volttron/protected_topics.json
loaded
2017-01-13 13:22:06,279 () volttron.platform.web INFO: Web server
not started. }
Any idea what's causing this error: INFO: Web server not started. ??

(We actually solved this in an over the phone conversation, I'm not psychic)
This is what happens when you attempt to run VOLTTRON on the Mint OS Live CD and not from an installed copy of Mint.
You will also see authentication errors in the log when Agents try to start up.
In the VM double click on the "Install Linux Mint" icon on the desktop and follow the prompts. Once Mint is installed on the VM restart the VM and proceed with the normal installation instructions.

Related

VOLTTRON forward historian authorization failing

Can someone give me a tip on how to fix a forward historian agent that is going to a BAD state installed on an edge device with an attempt to forward data to a Central instance?
This is my forward agent config on the edge device where the destination server key I got from the Central instance:
{
"destination-vip": "tcp://192.168.0.168:22916",
"destination-serverkey": "asdfasdfasdfasdfasdf"
}
On the edge device I did a vctl auth serverkey to get the edge device key and on the VOLTTRON central I did a vctl auth add to add this key of this edge device to the server.
Full traceback in the log file. When I start the agent is goes BAD in about 30 seconds, and I think the error is coming from the edge to server authentication? AND not some internal edge device agent authentication....but not sure.
2022-10-24 15:23:20,622 (forwarderagent-5.1 2914) volttron.platform.vip.agent.core INFO: Destination serverkey not found in known hosts file, using config
2022-10-24 15:23:20,630 (forwarderagent-5.1 2914) volttron.platform.vip.agent.core INFO: CORE address:tcp://10.200.200.168:22916?publickey=WMdhM3co5g2keLwh5yMdFBgoxaq9g9RRFz__K6KctkI&secretkey=U6UZ9bLnbvvcDm6V5uByBbc-1tA1bUd1ZYubWgKjdG4&serverkey=GgJApMOBM8bg7HiKECP6KOwk_O8f_HslrbqPygDcoCY
2022-10-24 15:23:20,630 (forwarderagent-5.1 2914) volttron.platform.vip.agent.core ERROR: No response to hello message after 10 seconds.
2022-10-24 15:23:20,630 (forwarderagent-5.1 2914) volttron.platform.vip.agent.core ERROR: Type of message bus used zmq
2022-10-24 15:23:20,630 (forwarderagent-5.1 2914) volttron.platform.vip.agent.core ERROR: A common reason for this is a conflicting VIP IDENTITY.
2022-10-24 15:23:20,630 (forwarderagent-5.1 2914) volttron.platform.vip.agent.core ERROR: Another common reason is not having an auth entry onthe target instance.
2022-10-24 15:23:20,630 (forwarderagent-5.1 2914) volttron.platform.vip.agent.core ERROR: Shutting down agent.
2022-10-24 15:23:20,630 (forwarderagent-5.1 2914) volttron.platform.vip.agent.core ERROR: Possible conflicting identity is: volttron1.forwarderagent-5.1_1
2022-10-24 15:23:20,829 (listeneragent-3.3 1608) __main__ INFO: Peer: pubsub, Sender: listeneragent-3.3_1:, Bus: , Topic: heartbeat/listeneragent-3.3_1, Headers: {'TimeStamp': '2022-10-24T15:23:20.826211+00:00', 'min_compatible_version': '3.0', 'max_compatible_version': ''}, Message:
'GOOD'
2022-10-24 15:23:21,219 (listeneragent-3.3 1608) __main__ INFO: Peer: pubsub, Sender: forwarderagent-5.1_1:, Bus: , Topic: heartbeat/forwarderagent-5.1_1, Headers: {'TimeStamp': '2022-10-24T15:23:21.216704+00:00', 'min_compatible_version': '3.0', 'max_compatible_version': ''}, Message:
'BAD'
2022-10-24 15:23:21,613 () volttron.platform.auth.auth_protocols.auth_zmq INFO: AUTH: After authenticate user id: 'control.connection', b'4552b404-0290-41d5-b7a8-ba4653e98e3c'
2022-10-24 15:23:21,613 () volttron.platform.auth.auth_protocols.auth_zmq INFO: authentication success: userid=b'4552b404-0290-41d5-b7a8-ba4653e98e3c' domain='vip', address='localhost:1000:1000:2943', mechanism='CURVE', credentials=['sRZnNl3PPt-_NBiyXcCtqbwG7_5dYAALmDQzXtBEFFU'], user='control.connection'
2022-10-24 15:23:21,624 (listeneragent-3.3 1608) __main__ INFO: Peer: pubsub, Sender: control.connection:, Bus: , Topic: heartbeat/control.connection, Headers: {'TimeStamp': '2022-10-24T15:23:21.623967+00:00', 'min_compatible_version': '3.0', 'max_compatible_version': ''}, Message:
'GOOD'
2022-10-24 15:23:21,631 (forwarderagent-5.1 2914) volttron.platform.vip.agent.subsystems.auth INFO: Skipping updating rpc auth capabilities for agent volttron1.forwarderagent-5.1_1 connecting to remote address: tcp://10.200.200.168:22916?publickey=WMdhM3co5g2keLwh5yMdFBgoxaq9g9RRFz__K6KctkI&secretkey=U6UZ9bLnbvvcDm6V5uByBbc-1tA1bUd1ZYubWgKjdG4&serverkey=GgJApMOBM8bg7HiKECP6KOwk_O8f_HslrbqPygDcoCY
2022-10-24 15:23:21,631 (forwarderagent-5.1 2914) volttron.platform.vip.agent.subsystems.auth WARNING: Auth entry not found for volttron1.forwarderagent-5.1_1: rpc_method_authorizations not updated. If this agent does have an auth entry, verify that the 'identity' field has been included in the auth entry. This should be set to the identity of the agent
2022-10-24 15:23:30,627 (forwarderagent-5.1 2914) __main__ ERROR: Couldn't connect to address. gevent timeout: (tcp://10.200.200.168:22916)
2022-10-24 15:23:30,628 (forwarderagent-5.1 2914) __main__ ERROR: Could not connect to targeted historian dest_vip tcp://10.200.200.168:22916 dest_address None
2022-10-24 15:23:30,755 () volttron.platform.vip.agent.core INFO: CORE address:inproc://vip
2022-10-24 15:23:30,786 () volttron.platform.vip.agent.core INFO: Connected to platform: router: 4552b404-0290-41d5-b7a8-ba4653e98e3c version: 1.0 identity
One thing to note is I am trying to rectify a botched update from 8.0 to 8.2 on the edge device I ended up just recloning the repo and bootstrapping 8.2, so now I have this volttron1 config someone.
#bbartling, on the destination Volttron platform, can you verify that all remote connections (e.g. Forwarder connections) have been received and approved? You can run the following commands on the destination platform to verify:
# to view all remote connections; this will return a list of user ids that can be used to approve or deny connections
vctl auth remote list
# to approve a remote connection
vctl auth remote approve <USER_ID>
Docs to vctl auth remote commands
If you're goal is to verify that your forwarder can connect to the destination platform, you can always auto accept all remote connections (though you should only do this for testing since it is not secure):
vctl auth add --credentials '/.*/'
I fixed this by doing:
vctl auth serverkey on the central instance and adding this into
the forward agent config file on the edge device
Then on the edge device doing a vctl auth publickey which flashes the
edge device key of the forward agent which then needs to be added to the central instance
on a vctl auth add

Appium (and desktop) unable to launch wda session since xCode13 and iOS15

Since my xCode got (automatically...) updated to 13 and all my simulators moved from iOS 14.5 to 15. with the same setup / commands I'm unable to launch the WDA from both the desktop app, and the node ( selenium server grid/node setup)
The issue exists for all simulators.
I can still use real device..
(the actual ports in errors might differ, the first one is from the actual automation where it fails, the 2nd and 3rd is from the desktop app -where it still fails with the same error. the root issue is still the same on both)
The error logs I get:
In short:
org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: Unable to start WebDriverAgent session because of xcodebuild failure: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: connect ECONNREFUSED 127.0.0.1:8205
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'Janoss-MacBook-Pro.local', ip: 'fe80:0:0:0:18e4:52:307c:8c7b%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '11.5', java.version: '11.0.11'
Driver info: driver.version: IOSDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Unable to start WebDriverAgent session because of xcodebuild failure: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: connect ECONNREFUSED 127.0.0.1:8205
at getResponseForW3CError (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:804:9)
at asyncHandler (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:380:37)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'Janoss-MacBook-Pro.local', ip: 'fe80:0:0:0:18e4:52:307c:8c7b%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '11.5', java.version: '11.0.11'
Driver info: driver.version: IOSDriver
The longer error from the server:
[iOSSim] Got Simulator UI client PID: 11815
[iOSSim] Both Simulator with UDID 'F5A500AB-FAA5-41A0-A009-E5A8EDB8643A' and the UI client are currently running
[BaseDriver] Event 'simStarted' logged at 1632487969688 (14:52:49 GMT+0200 (Central European Summer Time))
[WebDriverAgent] No obsolete cached processes from previous WDA sessions listening on port 8100 have been found
[DevCon Factory] Requesting connection for device F5A500AB-FAA5-41A0-A009-E5A8EDB8643A on local port 8100
[DevCon Factory] Cached connections count: 0
[DevCon Factory] Successfully requested the connection for F5A500AB-FAA5-41A0-A009-E5A8EDB8643A:8100
[XCUITest] Starting WebDriverAgent initialization with the synchronization key 'XCUITestDriver'
[WD Proxy] Matched '/status' to command name 'getStatus'
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[WD Proxy] connect ECONNREFUSED 127.0.0.1:8100
[WebDriverAgent] WDA is not listening at 'http://127.0.0.1:8100/'
[WebDriverAgent] WDA is currently not running. There is nothing to cache
[XCUITest] Trying to start WebDriverAgent 2 times with 10000ms interval
[XCUITest] These values can be customized by changing wdaStartupRetries/wdaStartupRetryInterval capabilities
[BaseDriver] Event 'wdaStartAttempted' logged at 1632487969773 (14:52:49 GMT+0200 (Central European Summer Time))
[WebDriverAgent] Launching WebDriverAgent on the device
[WebDriverAgent] WebDriverAgent does not need a cleanup. The sources are up to date (1620631774000 >= 1620631774000)
[WebDriverAgent] Killing running processes 'xcodebuild.*F5A500AB-FAA5-41A0-A009-E5A8EDB8643A, F5A500AB-FAA5-41A0-A009-E5A8EDB8643A.*XCTRunner, xctest.*F5A500AB-FAA5-41A0-A009-E5A8EDB8643A' for the device F5A500AB-FAA5-41A0-A009-E5A8EDB8643A...
[WebDriverAgent] 'pgrep -if xcodebuild.*F5A500AB-FAA5-41A0-A009-E5A8EDB8643A' didn't detect any matching processes. Return code: 1
[WebDriverAgent] 'pgrep -if F5A500AB-FAA5-41A0-A009-E5A8EDB8643A.*XCTRunner' didn't detect any matching processes. Return code: 1
[WebDriverAgent] 'pgrep -if xctest.*F5A500AB-FAA5-41A0-A009-E5A8EDB8643A' didn't detect any matching processes. Return code: 1
[WebDriverAgent] Beginning test with command 'xcodebuild build-for-testing test-without-building -project /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=F5A500AB-FAA5-41A0-A009-E5A8EDB8643A IPHONEOS_DEPLOYMENT_TARGET=15.0 GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO' in directory '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent'
[WebDriverAgent] Output from xcodebuild will only be logged if any errors are present there. To change this, use 'showXcodeLog' desired capability
[WebDriverAgent] Waiting up to 60000ms for WebDriverAgent to start
[WD Proxy] Matched '/status' to command name 'getStatus'
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[WD Proxy] connect ECONNREFUSED 127.0.0.1:8100
[WD Proxy] Matched '/status' to command name 'getStatus'
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[WD Proxy] connect ECONNREFUSED 127.0.0.1:8100
Then a long waiting with only the ECONNREFUSED error and finally failing:
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[WD Proxy] connect ECONNREFUSED 127.0.0.1:8100
[XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: connect ECONNREFUSED 127.0.0.1:8100). Retrying...
[XCUITest] UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: connect ECONNREFUSED 127.0.0.1:8100
[XCUITest] at JWProxy.command (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:274:13)
[XCUITest] at runMicrotasks ()
[XCUITest] at processTicksAndRejections (internal/process/task_queues.js:85:5)
[XCUITest] Unable to start WebDriverAgent session because of xcodebuild failure: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: connect ECONNREFUSED 127.0.0.1:8100
[XCUITest] Quitting and uninstalling WebDriverAgent
[WebDriverAgent] Shutting down sub-processes
[iOSSim] Building bundle path map
[iOSSim] The simulator has '1' bundles which have 'WebDriverAgentRunner-Runner' as their 'CFBundleName':
[iOSSim] 'com.jano.facebook.WebDriverAgentRunner.xctrunner'
[WebDriverAgent] Uninstalling WDAs: 'com.jano.facebook.WebDriverAgentRunner.xctrunner'
[XCUITest] {}
[DevCon Factory] Releasing connections for F5A500AB-FAA5-41A0-A009-E5A8EDB8643A device on any port number
[DevCon Factory] Found cached connections to release: ["F5A500AB-FAA5-41A0-A009-E5A8EDB8643A:8100"]
[DevCon Factory] Cached connections count: 0
[XCUITest] Not clearing log files. Use `clearSystemFiles` capability to turn on.
[IOSSimulatorLog] Stopping iOS log capture
[BaseDriver] Event 'newSessionStarted' logged at 1632488146662 (14:55:46 GMT+0200 (Central European Summer Time))
[MJSONWP] Encountered internal error running command: Error: Unable to start WebDriverAgent session because of xcodebuild failure: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: connect ECONNREFUSED 127.0.0.1:8100
[MJSONWP] at quitAndUninstall (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:544:15)
[MJSONWP] at /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:610:11
[MJSONWP] at wrapped (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:60:13)
[MJSONWP] at retry (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:43:13)
[MJSONWP] at retryInterval (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:70:10)
[MJSONWP] at /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:559:7
[HTTP] <-- POST /wd/hub/session 500 177858 ms - 388
[HTTP]
[HTTP] --> DELETE /wd/hub/session
To solve this issue,
We need to update our appkum on the computer ( should be 1.22.0 or above)
To see your version:
appium -v
To install / Update your appium:
npm install -g appium
This fixed the simulator part. to fix the appium desktop, you also have to update the desktop app, but now it's moved on as 2 separate app.
One for the server
https://github.com/appium/appium-desktop/releases/
And one for the inspector https://github.com/appium/appium-inspector/releases
I had a similar problem with the old appium (where the server and the inspector were combined), and with the new version, where they were taken out separately.
I solved it by adding server Capabilities:
serverCapabilities.setCapability("wdaStartupRetries", "4");
serverCapabilities.setCapability("iosInstallPause","8000" );
serverCapabilities.setCapability("wdaStartupRetryInterval", "20000");
after that, the wda session became stable
I had the same problem
I solved it by adding appium desired capabilities and I reduced the time from 120 to 60 for newCommandTimeout capabilities
my appium capabilities' last status
"newCommandTimeout": 60,
"wdaStartupRetries": 3,
"wdaStartupRetryInterval": 20000

NoSuchWindowError: Browsing context has been discarded with GeckoDriver Firefox and Protractor(Selenium)

I'm trying to run a simple test script using protractor.
Environment:
Node Version: v9.8.0
Protractor Version: 5.4.1
Angular Version: 1.x
Browser(s): Mozilla Firefox 60.1.0
Operating System and Version: HELiOS release 6.10
Here's my protractor config file.
exports.config = {
specs: ['todo-spec.js'],
capabilities: {
browserName: 'firefox',
marionette : true
}
};
This is my test script (todo-spec.js)
describe('application homepage', function() {
it('should open homepage', function() {
console.log("Opening localhost app");
browser.get('http://localhost:8080/app/');
browser.sleep(20000); // just to check if application loaded or not
});
});
This is my node_modules/protractor/node_modules/webdriver-manager/selenium/ directory looks like:
When I run my test using /path/to/protractor conf.js, I'm getting below mentioned error.
[16:51:03] I/launcher - Running 1 instances of WebDriver
[16:51:03] I/local - Starting selenium standalone server...
[16:51:04] I/local - Selenium standalone server started at http://<ip-address>:45089/wd/hub
Started
Opening localhost
F
Failures:
1) application homepage should open homepage
Message:
Failed: Browsing context has been discarded
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:13:22.693Z'
System info: host: 'HOSTNAME', ip: 'ip_address', os.name: 'Linux', os.arch: 'i386', os.version: '2.6.32-754.3.5.el6.x86_64', java.version: '1.8.0_181'
Driver info: driver.version: unknown
Stack:
NoSuchWindowError: Browsing context has been discarded
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:13:22.693Z'
System info: host: 'HOSTNAME', ip: 'ip_address', os.name: 'Linux', os.arch: 'i386', os.version: '2.6.32-754.3.5.el6.x86_64', java.version: '1.8.0_181'
Driver info: driver.version: unknown
at Object.checkLegacyResponse (/export/home/test/protractor_test_2/node_modules/selenium-webdriver/lib/error.js:546:15)
at parseHttpResponse (/export/home/test/protractor_test_2/node_modules/selenium-webdriver/lib/http.js:509:13)
at doSend.then.response (/export/home/test/protractor_test_2/node_modules/selenium-webdriver/lib/http.js:441:30)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:118:7)
From: Task: Protractor.get(http://localhost:8080/app/) - reset url
at thenableWebDriverProxy.schedule (/export/home/test/protractor_test_2/node_modules/selenium-webdriver/lib/webdriver.js:807:17)
at ProtractorBrowser.executeScriptWithDescription (/export/home/test/protractor_test_2/node_modules/protractor/built/browser.js:404:28)
at driver.controlFlow.execute.then.then.then (/export/home/test/protractor_test_2/node_modules/protractor/built/browser.js:679:25)
at ManagedPromise.invokeCallback_ (/export/home/test/protractor_test_2/node_modules/selenium-webdriver/lib/promise.js:1376:14)
at TaskQueue.execute_ (/export/home/test/protractor_test_2/node_modules/selenium-webdriver/lib/promise.js:3084:14)
at TaskQueue.executeNext_ (/export/home/test/protractor_test_2/node_modules/selenium-webdriver/lib/promise.js:3067:27)
at asyncRun (/export/home/test/protractor_test_2/node_modules/selenium-webdriver/lib/promise.js:2927:27)
at /export/home/test/protractor_test_2/node_modules/selenium-webdriver/lib/promise.js:668:7
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:118:7)
From: Task: Run it("should open homepage") in control flow
at UserContext.<anonymous> (/export/home/test/protractor_test_2/node_modules/jasminewd2/index.js:94:19)
From asynchronous test:
Error
at Suite.<anonymous> (/export/home/test/protractor_test_2/todo-spec.js:2:3)
at Object.<anonymous> (/export/home/test/protractor_test_2/todo-spec.js:1:63)
at Module._compile (module.js:649:30)
at Object.Module._extensions..js (module.js:660:10)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:501:12)
1 spec, 1 failure
Finished in 0.159 seconds
[16:51:06] I/local - Shutting down selenium standalone server.
[16:51:06] I/launcher - 0 instance(s) of WebDriver still running
[16:51:06] I/launcher - firefox #01 failed 1 test(s)
[16:51:06] I/launcher - overall: 1 failed spec(s)
[16:51:06] E/launcher - Process exited with error code 1
Any help would be appreciated.
This error message...
Failed: Browsing context has been discarded
...implies that the communication between GeckoDriver and Marionette was broken.
Some more information regarding the GeckoDriver binary version would have given us some clues about whats wrong happening. However this issue can happen due to multiple factors as follows:
As per Hang when navigation request removes the current browsing context if you have used driver.navigate().back(); when Selenium's focus was within an <iframe> this error is observed.
As per Crash during command execution results in "Internal Server Error: Failed to decode response from marionette" this issue can also occur due to ctypes checks for NULL pointer derefs.
You can find the Selenium testcase here. Perhaps instead of panicking, it would have been better to handle this more gracefully by clearing any state and returning geckodriver to accept new connections again.
As per Failed to decode response from marionette - Error to open Webdriver using python this issue can also occur if you are not using the complient version of the binaries.
This usecase
The root cause of this issue seems to be MemoryUsage. As per Intermittent awsy\test_memory_usage.py TestMemoryUsage.test_open_tabs | NoSuchWindowException: Browsing context has been discarded which is intermittent in nature. This issue was once marked as RESOLVED then again REOPENED.
As #Madhan mentioned while working with AngularJS applications and Protractor always include:
waitForAngularEnabled(true);
Finally, as per best practices while working with GeckoDriver, Selenium and Firefox Browser follow the below compatibility chart:
Supported platforms
Was able to fix this issue with below configuration.
- Protractor: v5.4.1
- Selenium JAR driver: selenium-server-standalone-3.141.59.jar
- geckodriver:geckodriver-v0.20.0-linux64
Also we need to give path of geckodrvier in protractor conf file.
geckoDriver: 'node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.20.0'
By default webdriver-manager will download latest version of geckodriver which is 0.24.0. But the needed geckdriver is v0.20.0, so I downloaded this manually and placed it inside node_modules/protractor/node_modules/webdriver-manager/selenium/ directory.
Hope this helps to people facing similar issue.

Appium - Unable to launch WebDriverAgent because of xcodebuild failure: Scripts/bootstrap.sh code 1

I am using webdriver.IO together with Appium to test an iOS hybrid App.
I get the following error before each test when it tries to spin up the iOS App:
Unable to launch WebDriverAgent because of xcodebuild failure: "Command 'Scripts/bootstrap.sh -d' exited with code 1"."
Here are the logs:
[debug] [XCUITest] The app has been installed successfully.
[debug] [BaseDriver] Event 'appInstalled' logged at 1545635044697 (02:04:04 GMT-0500 (Eastern Standard Time))
[XCUITest] Using WDA path: '/Users/MY_USER_NAME/Documents/CODE/ACTIVE/APPIUM/asialgearoid/mine2/node_modules/appium-xcuitest-driver/WebDriverAgent'
[XCUITest] Using WDA agent: '/Users/MY_USER_NAME/Documents/CODE/ACTIVE/APPIUM/asialgearoid/mine2/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj'
[debug] [XCUITest] No obsolete cached processes from previous WDA sessions listening on port 8100 have been found
[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Got an unexpected response: {"errno":"ECONNREFUSED","code":"ECONNREFUSED","syscall":"connect","address":"127.0.0.1","port":8100}
[debug] [XCUITest] WDA is not listening at 'http://localhost:8100/'
[debug] [XCUITest] WDA is currently not running. There is nothing to cache
[debug] [XCUITest] Trying to start WebDriverAgent 2 times with 10000ms interval
[debug] [BaseDriver] Event 'wdaStartAttempted' logged at 1545635044905 (02:04:04 GMT-0500 (Eastern Standard Time))
[XCUITest] Launching WebDriverAgent on the device
[debug] [XCUITest] Carthage found: '/Users/MY_USER_NAME/Documents/CODE/ACTIVE/APPIUM/asialgearoid/mine2/node_modules/.bin/carthage'
[debug] [XCUITest] Running WebDriverAgent bootstrap script to install dependencies
[XCUITest] [1mFetching dependencies
[XCUITest] Error: Command "bootstrap" does not exist.
...
[debug] [BaseDriver] Event 'wdaStartFailed' logged at 1545635057640 (02:04:17 GMT-0500 (Eastern Standard Time))
[debug] [XCUITest] Unable to launch WebDriverAgent because of xcodebuild failure: "Command 'Scripts/bootstrap.sh -d' exited with code 1".
Any idea of how to solve?
After further digging I found out how to reproduce the error:
$ cd /myTestingProject/node_modules/appium-xcuitest-driver/WebDriverAgent
$ ./Scripts/bootstrap.sh
Output:
Fetching dependencies
Error: Command "bootstrap" does not exist.
I do not know if this was your problem at the time of writing, but I had this same issue and looked up the latest update documentation. The file bootstrap.sh has been changed to build.sh
This works for me:
cd /usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent
./Scripts/build.sh -d
I tested by wiping my simulator so I could test this with a completely clean slate. I ran the above commands, relaunched the simulator, dropped a .app file onto the simulator, and the WebDriverAgent installed completely fine without any manual work opening Xcode.

Unable to launch appium configuration on iphone from Xcode

We are trying to launch a WebDriverAgent and its getting stuck at the following step (Extract of log):
[MJSONWP] Encountered internal error running command: Error: Unable to launch WebDriverAgent because of xcodebuild failure: Command 'security -v unlock-keychain -p exited with code 49
The app is getting installed on the phone.The error is only while attempting to launch from Xcode and works fine when run directly from the phone.
Code:
public void setup() throws MalformedURLException, InterruptedException { System.out.println("====Setting capabilities===="); DesiredCapabilities cap = new DesiredCapabilities(); // cap.setCapability("appium-version", "1.6.4"); cap.setCapability("platformVersion", "10.3"); // cap.setCapability("deviceName", "iPhone 6"); cap.setCapability("deviceName", "astha’s iPhone"); cap.setCapability("platformName", "iOS"); cap.setCapability("automationName", "XCUITest"); cap.setCapability("showXcodeLog", "true"); cap.setCapability("udid", "86c8805d20315df3c4f707e25ee4327a12106260"); //cap.setCapability("desiredCapabilities", "optional"); // cap.setCapability("udid","80072f1273b0ac59431f70934d9d5eec38de8a3a");
cap.setCapability("keychainPath", "/Users/atulmhetre/Documents/Certificates.p12"); //cap.setCapability("keychainPath", "/Users/atulmhetre/Library/Keychains/MyKeychain.keychain");
cap.setCapability("keychainPassword", "<password>"); /// Users/atulmhetre/Library/Keychains/ //// Users/atulmhetre/Documents/MyPrivateKey.p12 File app = new File("/Users/atulmhetre/Desktop/Sample Application/UiKitCatalog.app"); cap.setCapability("app",
"/Users/atulmhetre/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-iphoneos/IntegrationApp.app"); // cap.setCapability("app","/Users/atulmhetre/Library/Developer/Xcode/DerivedData/UIKitCatalog-akevtpkxonmoyogdvhqvrqlkacji/Build/Products/Debug-iphoneos/UIKitCatalog.app");
cap.setCapability("bundleId", "com.nihilent.IntegrationApp"); // cap.setCapability("bundleId","com.example.nihilent.UIKitCatalogMob");
cap.setCapability("noReset", true); System.out.println("====after setting===="); driver = new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"), cap); driver.findElementByName("Alerts").click();
Appium Logs:
[Appium] Welcome to Appium v1.6.4 [Appium] Non-default server args: [Appium] address: 127.0.0.1 [Appium] Appium REST http interface listener started on 127.0.0.1:4723 [HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"app":"/Users/atulmhetre/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-iphoneos/IntegrationApp.app","showXcodeLog":"true","noReset":true,"platformVersion":"10.3","automationName":"XCUITest","keychainPath":"/Users/atulmhetre/Documents/Certificates.p12","bundleId":"com.nihilent.IntegrationApp","keychainPassword":"republic123","platformName":"iOS","udid":"86c8805d20315df3c4f707e25ee4327a12106260","deviceName":"astha’s iPhone"},"requiredCapabilities":{},"capabilities":{"desiredCapabilities":{"app":"/Users/atulmhetre/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-iphoneos/IntegrationApp.app","showXcodeLog":"true","noReset":true,"platformVersion":"10.3","automationName":"XCUITest","keychainPath":"/Users/atulmhetre/Documents/Certificates.p12","bundleId":"com.nihilent.IntegrationApp","keychainPassword":"republic123","platformName":"iOS","udid":"86c8805d20315df3c4 [MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"/Users/atulmhetre/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-iphoneos/IntegrationApp.app","showXcodeLog":"true","noReset":true,"platformVersion":"10.3","automationName":"XCUITest","keychainPath":"/Users/atulmhetre/Documents/Certificates.p12","bundleId":"com.nihilent.IntegrationApp","keychainPassword":"republic123","platformName":"iOS","udid":"86c8805d20315df3c4f707e25ee4327a12106260","deviceName":"astha’s iPhone"},{},{"desiredCapabilities":{"app":"/Users/atulmhetre/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-iphoneos/IntegrationApp.app","showXcodeLog":"true","noReset":true,"platformVersion":"10.3","automationName":"XCUITest","keychainPath":"/Users/atulmhetre/Documents/Certificates.p12","bundleId":"com.nihilent.IntegrationApp","keychainPassword":"republic123","platformName":"iOS","udid":"86c8805d20315df3c4f707e25ee4327a12106260","deviceName":"astha’s iPhone"},"requiredCapabilities":{},... [BaseDriver] Event 'newSessionRequested' logged at 1494757197935 (15:49:57 GMT+0530 (IST)) [Appium] Creating new XCUITestDriver (v2.27.2) session [Appium] Capabilities: [Appium] app: '/Users/atulmhetre/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-iphoneos/IntegrationApp.app' [Appium] showXcodeLog: 'true' [Appium] noReset: true [Appium] platformVersion: '10.3' [Appium] automationName: 'XCUITest' [Appium] keychainPath: '/Users/atulmhetre/Documents/Certificates.p12' [Appium] bundleId: 'com.nihilent.IntegrationApp' [Appium] keychainPassword: 'republic123' [Appium] platformName: 'iOS' [Appium] udid: '86c8805d20315df3c4f707e25ee4327a12106260' [Appium] deviceName: 'astha’s iPhone' [XCUITest] XCUITestDriver version: 2.27.2 [BaseDriver] Capability 'showXcodeLog' changed from string to boolean. This may cause unexpected behavior [BaseDriver] Session created with session id: 8ffef180-184b-436c-8648-e4af5805b9d4 [XCUITest] Xcode version set to '8.3.2' (tools v8.1.0.0.1.1476494586) [XCUITest] iOS SDK Version set to '10.3' [BaseDriver] Event 'xcodeDetailsRetrieved' logged at 1494757198121 (15:49:58 GMT+0530 (IST)) [XCUITest] Available devices: 86c8805d20315df3c4f707e25ee4327a12106260 [XCUITest] Creating iDevice object with udid '86c8805d20315df3c4f707e25ee4327a12106260' [XCUITest] Determining device to run tests on: udid: '86c8805d20315df3c4f707e25ee4327a12106260', real device: true [BaseDriver] Using local app '/Users/atulmhetre/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-iphoneos/IntegrationApp.app' [BaseDriver] Event 'appConfigured' logged at 1494757198383 (15:49:58 GMT+0530 (IST)) [XCUITest] Checking whether app '/Users/atulmhetre/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-iphoneos/IntegrationApp.app' is actually present on file system [XCUITest] App is present [BaseDriver] Event 'resetStarted' logged at 1494757198385 (15:49:58 GMT+0530 (IST)) [XCUITest] Reset: fullReset not set. Leaving as is [BaseDriver] Event 'resetComplete' logged at 1494757198386 (15:49:58 GMT+0530 (IST)) [iOSLog] Attempting iOS device log capture via libimobiledevice idevicesyslog [iOSLog] Found idevicesyslog: '/usr/local/bin/idevicesyslog' [BaseDriver] Event 'logCaptureStarted' logged at 1494757198552 (15:49:58 GMT+0530 (IST)) [XCUITest] Setting up real device [XCUITest] Installing '/Users/atulmhetre/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-iphoneos/IntegrationApp.app' on device with UUID '86c8805d20315df3c4f707e25ee4327a12106260'... [XCUITest] The app has been installed successfully. [BaseDriver] Event 'appInstalled' logged at 1494757201209 (15:50:01 GMT+0530 (IST)) [BaseDriver] Event 'wdaStartAttempted' logged at 1494757201211 (15:50:01 GMT+0530 (IST)) [XCUITest] Using WDA path: '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent' [XCUITest] Using WDA agent: '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj' [XCUITest] Launching WebDriverAgent on the device [XCUITest] Carthage found: '/usr/local/bin/carthage' [XCUITest] Killing hanging processes [XCUITest] Setting security for iOS device [BaseDriver] Event 'wdaStartFailed' logged at 1494757201483 (15:50:01 GMT+0530 (IST))
[XCUITest] Unable to launch WebDriverAgent because of xcodebuild failure: Command 'security -v unlock-keychain -p republic123 /Users/atulmhetre/Documents/Certificates.p12' exited with code 49 [XCUITest] Quitting and uninstalling WebDriverAgent, then retrying [XCUITest] Shutting down sub-processes [XCUITest] Removing WDA application from device [BaseDriver] Event 'wdaStartAttempted' logged at 1494757211928 (15:50:11 GMT+0530 (IST)) [XCUITest] Using WDA path: '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent' [XCUITest] Using WDA agent: '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj' [XCUITest] Launching WebDriverAgent on the device [XCUITest] Carthage found: '/usr/local/bin/carthage' [XCUITest] Killing hanging processes [XCUITest] Setting security for iOS device [BaseDriver] Event 'wdaStartFailed' logged at 1494757212093 (15:50:12 GMT+0530 (IST))
[XCUITest] Unable to launch WebDriverAgent because of xcodebuild failure: Command 'security -v unlock-keychain -p republic123 /Users/atulmhetre/Documents/Certificates.p12' exited with code 49 [XCUITest] Quitting and uninstalling WebDriverAgent, then retrying [XCUITest] Shutting down sub-processes [XCUITest] Removing WDA application from device [XCUITest] Error: Unable to launch WebDriverAgent because of xcodebuild failure: Command 'security -v unlock-keychain -p republic123 /Users/atulmhetre/Documents/Certificates.p12' exited with code 49
at XCUITestDriver.quitAndUninstall$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:374:15)
at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at process._tickCallback (internal/process/next_tick.js:103:7) Error: Unable to launch WebDriverAgent because of xcodebuild failure: Command 'security -v unlock-keychain -p republic123 /Users/atulmhetre/Documents/Certificates.p12' exited with code 49
at XCUITestDriver.quitAndUninstall$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:374:15)
at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at process._tickCallback (internal/process/next_tick.js:103:7) [XCUITest] Not clearing log files. Use clearSystemFiles capability to turn on. [iOSLog] Stopping iOS log capture [MJSONWP] Encountered internal error running command: Error: Unable to launch WebDriverAgent because of xcodebuild failure: Command 'security -v unlock-keychain -p republic123 /Users/atulmhetre/Documents/Certificates.p12' exited with code 49
at XCUITestDriver.quitAndUninstall$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:374:15)
at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at process._tickCallback (internal/process/next_tick.js:103:7) [HTTP] <-- POST /wd/hub/session 500 24471 ms - 317
Appreciate your responses in advance.

Resources