Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appium server node browser is not available #5163

Closed
gleb-k opened this issue Dec 4, 2017 · 9 comments
Closed

Appium server node browser is not available #5163

gleb-k opened this issue Dec 4, 2017 · 9 comments
Labels

Comments

@gleb-k
Copy link

gleb-k commented Dec 4, 2017

- META
OS: Windows Server 2012 R2
Selenium Standalone Server: 3.8.0

## Expected Behavior -
Appium server node should be present in the list of nodes with one Safari browser slot

## Actual Behavior -
Appium server node is present, but Safari slot is not available. Additional capabilities present in configuration.

## Steps to reproduce -

  1. Start Hub with selenium-standalone-server-3.8.0.jar with default config
  2. Start appium server node - appium --nodeconfig /path/to/nodeconfig.json

nodeconfig.json

{
  "capabilities":
       [
	{
          "browserName": "safari",
          "maxInstances": 1,
          "platform":"mac",
          "platformName":"iOS",
          "platformVersion":"10.3",
          "deviceName":"iPhone 7"
        }
       ],
  "configuration":
  {
    "cleanUpCycle":2000,
    "timeout":30000,
    "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
    "url":"http://appium_server_ip_address:4723/wd/hub",
    "host": "appium_server_ip_address",
    "port": 4723,
    "maxSession": 1,
    "register": true,
    "registerCycle": 5000,
    "hubPort": 4444,
    "hubHost": "hub_ip_address"
  }
}

node configuration (from hub console):

browserTimeout: 0
debug: false
help: false
jettyMaxThreads: -1
port: 4723
role: node
timeout: 30000
enablePassThrough: true
cleanUpCycle: 2000
host: appium_server_ip_address
maxSession: 1
**capabilities: Capabilities {browserName: chrome, maxInstances: 5, seleniumProtocol: WebDriver}
capabilities: Capabilities {browserName: firefox, marionette: true, maxInstances: 5, seleniumProtocol: WebDriver}
capabilities: Capabilities {browserName: internet explorer, maxInstances: 1, platform: WINDOWS, seleniumProtocol: WebDriver}**
capabilities: Capabilities {browserName: safari, maxInstances: 1, platform: MAC, seleniumProtocol: WebDriver, technologyPreview: false}
downPollingLimit: 2
hub: http://localhost:4444
id: http://appium_server_ip_address:4723
hubHost: hub_ip_address
hubPort: 4444
nodePolling: 5000
nodeStatusCheckTimeout: 5000
proxy: org.openqa.grid.selenium.proxy.DefaultRemoteProxy
register: true
registerCycle: 5000
remoteHost: http://appium_server_ip_address:4723
unregisterIfStillDownAfter: 60000

Please note, node works as expected with 3.7.1 standalone server.

@hazmeister
Copy link

Which version of appium is the node running?

@barancev
Copy link
Member

barancev commented Dec 8, 2017

Please run the hub and the node with -debug CLI option and attach the hub and the node logs here.

@rgoerner
Copy link

rgoerner commented Dec 8, 2017

Same here with selenium 3.8.1, is there still a solution for this?

@kool79
Copy link
Contributor

kool79 commented Dec 11, 2017

Same for me for v3.8.1.
Node is appium node. Apium console (with default logging level) does not show anything wrong. Only "Appium seccessfully registered with the grid...."
Grid console (with -debug) also dont have any errors (see below)

05:28:39.841 DEBUG - getting the following registration request : {"capabilities":[{"browserName":"safari","browserVersion":"mobile","platformName":"iOS","seleniumProtocol":"WebDriver","maxInstances":1}],"configuration":{"register":true,"registerCycle":5000,"maxSession":1,"proxy":"org.openqa.grid.selenium.proxy.DefaultRemoteProxy","url":"http://ta-mac-01:4724/wd/hub","host":"ta-mac-01","port":4724,"id":"http://ta-mac-01:4724","hubHost":"ta-mac-01","hubPort":4444,"nodeStatusCheckTimeout":1000,"cleanUpCycle":5000,"browserTimeout":60,"timeout":80,"nodePolling":10000}}
05:28:39.885 DEBUG - Using class org.openqa.grid.selenium.proxy.DefaultRemoteProxy
05:28:39.890 DEBUG - starting cleanup thread
05:28:39.900 DEBUG - cleanup thread starting...
05:28:39.903 INFO - Registered a node http://ta-mac-01:4724
05:28:39.905 DEBUG - proxy added http://ta-mac-01:4724

But when I open /grid/api/proxy?id=.... endpoint I saw that capabilities equals to empty array.
Issue is in platformName capability, which is set to "iOS" in appium-node config. When I changed platform name to "MAC" then node+slot become visible in condole.
Note: current issue is maybe related to #4557 (i.e. fix is not fully implemented)

Appium version is 1.7.1

P.S. I have the similar config but without 'platform' which is deprecated:

"capabilities": [ {
          "browserName": "safari",
          "browserVersion": "mobile",
          "platformName":"iOS",
           "seleniumProtocol":"WebDriver"
          "maxInstances": 1
        } ],
  .....
}

@kool79
Copy link
Contributor

kool79 commented Dec 14, 2017

I suggest to rename topic of the issue to "Cannot register node(slot) with platform/platformName = iOS"

@gleb-k
Copy link
Author

gleb-k commented Dec 15, 2017

Appium 1.7.1

Grid hub console output:

02:58:28.976 INFO - Selenium build info: version: '3.8.1', revision: '6e95a6684b
02:58:28.977 INFO - Launching Selenium Grid hub
2017-12-11 02:58:29.725:INFO::main: Logging initialized @1057ms to org.seleniumh
q.jetty9.util.log.StdErrLog
02:58:29.740 INFO - Will listen on 4444
2017-12-11 02:58:29.792:INFO:osjs.Server:main: jetty-9.4.7.v20170914
2017-12-11 02:58:29.819:INFO:osjs.session:main: DefaultSessionIdManager workerNa
me=node0
2017-12-11 02:58:29.819:INFO:osjs.session:main: No SessionScavenger set, using d
efaults
2017-12-11 02:58:29.822:INFO:osjs.session:main: Scavenging every 660000ms
2017-12-11 02:58:29.829:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletC
ontextHandler@60704c{/,null,AVAILABLE}
2017-12-11 02:58:29.845:INFO:osjs.AbstractConnector:main: Started ServerConnecto
r@2f177a4b{HTTP/1.1,[http/1.1]}{0.0.0.0:4444}
2017-12-11 02:58:29.864:INFO:osjs.Server:main: Started @1196ms
02:58:29.864 INFO - Nodes should register to http://grid_hub_ip:4444/grid/regis
ter/
02:58:29.864 INFO - Selenium Grid hub is up and running
02:58:47.425 DEBUG - getting the following registration request : {"capabilitie
s":[{"browserName":"safari","maxInstances":1,"platform":"mac","platformName":"iO
S","platformVersion":"10.3","deviceName":"iPhone 7"}],"configuration":{"cleanUpC
ycle":2000,"timeout":30000,"proxy":"org.openqa.grid.selenium.proxy.DefaultRemote
Proxy","url":"http://appium_node_ip:4723/wd/hub","host":"appium_node_ip","port":4723,"maxS
ession":1,"register":true,"registerCycle":5000,"hubPort":4444,"hubHost":"grid_hub_ip","id":"http://appium_node_ip:4723"}}
02:58:47.495 DEBUG - Using class org.openqa.grid.selenium.proxy.DefaultRemotePro
xy
02:58:47.499 DEBUG - starting cleanup thread
02:58:47.500 DEBUG - cleanup thread starting...
02:58:47.502 INFO - Registered a node http://appium_node_ip:4723
02:58:47.504 DEBUG - proxy added http://appium_node_ip:4723
02:58:52.506 DEBUG - Closing connections idle longer than 100 MILLISECONDS
02:58:52.516 DEBUG - CookieSpec selected: default
02:58:52.523 DEBUG - Auth cache not set in the context
02:58:52.525 DEBUG - Connection request: [route: {}->http://appium_node_ip:4723][tota
l kept alive: 0; route allocated: 0 of 2000; total allocated: 0 of 2000]
02:58:52.535 DEBUG - Connection leased: [id: 0][route: {}->http://appium_node_ip:4723
][total kept alive: 0; route allocated: 1 of 2000; total allocated: 1 of 2000]
02:58:52.536 DEBUG - Opening connection {}->http://appium_node_ip:4723
02:58:52.538 DEBUG - Connecting to /appium_node_ip:4723
02:58:52.548 DEBUG - Connection established grid_hub_ip:60993<->appium_node_ip:4723
02:58:52.548 DEBUG - http-outgoing-0: set socket timeout to 5000
02:58:52.549 DEBUG - Executing request GET /wd/hub/status HTTP/1.1
02:58:52.549 DEBUG - Target auth state: UNCHALLENGED
02:58:52.550 DEBUG - Proxy auth state: UNCHALLENGED
02:58:52.552 DEBUG - http-outgoing-0 >> GET /wd/hub/status HTTP/1.1
02:58:52.552 DEBUG - http-outgoing-0 >> Host: appium_node_ip:4723
02:58:52.552 DEBUG - http-outgoing-0 >> Connection: Keep-Alive
02:58:52.553 DEBUG - http-outgoing-0 >> User-Agent: Apache-HttpClient/4.5.3 (Jav
a/1.8.0_144)
02:58:52.553 DEBUG - http-outgoing-0 >> Accept-Encoding: gzip,deflate
02:58:52.554 DEBUG - http-outgoing-0 >> "GET /wd/hub/status HTTP/1.1[\r][\n]"
02:58:52.554 DEBUG - http-outgoing-0 >> "Host: appium_node_ip:4723[\r][\n]"
02:58:52.555 DEBUG - http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
02:58:52.555 DEBUG - http-outgoing-0 >> "User-Agent: Apache-HttpClient/4.5.3 (Ja
va/1.8.0_144)[\r][\n]"
02:58:52.555 DEBUG - http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"
02:58:52.556 DEBUG - http-outgoing-0 >> "[\r][\n]"
02:58:52.593 DEBUG - http-outgoing-0 << "HTTP/1.1 200 OK[\r][\n]"
02:58:52.593 DEBUG - http-outgoing-0 << "X-Powered-By: Express[\r][\n]"
02:58:52.594 DEBUG - http-outgoing-0 << "Access-Control-Allow-Origin: *[\r][\n]"

02:58:52.594 DEBUG - http-outgoing-0 << "Access-Control-Allow-Methods: GET,POST,
PUT,OPTIONS,DELETE[\r][\n]"
02:58:52.595 DEBUG - http-outgoing-0 << "Access-Control-Allow-Headers: origin, c
ontent-type, accept[\r][\n]"
02:58:52.595 DEBUG - http-outgoing-0 << "Content-Type: application/json; charset
=utf-8[\r][\n]"
02:58:52.596 DEBUG - http-outgoing-0 << "Content-Length: 83[\r][\n]"
02:58:52.596 DEBUG - http-outgoing-0 << "ETag: W/"53-t4S7rxlcLaigcijFcZ8qA3rUrvU
"[\r][\n]"
02:58:52.597 DEBUG - http-outgoing-0 << "Date: Mon, 11 Dec 2017 08:00:18 GMT[\r]
[\n]"
02:58:52.597 DEBUG - http-outgoing-0 << "Connection: keep-alive[\r][\n]"
02:58:52.598 DEBUG - http-outgoing-0 << "[\r][\n]"
02:58:52.598 DEBUG - http-outgoing-0 << "{"status":0,"value":{"build":{"version"
:"1.7.1","revision":null}},"sessionId":null}"
02:58:52.600 DEBUG - http-outgoing-0 << HTTP/1.1 200 OK
02:58:52.601 DEBUG - http-outgoing-0 << X-Powered-By: Express
02:58:52.601 DEBUG - http-outgoing-0 << Access-Control-Allow-Origin: *
02:58:52.601 DEBUG - http-outgoing-0 << Access-Control-Allow-Methods: GET,POST,P
UT,OPTIONS,DELETE
02:58:52.602 DEBUG - http-outgoing-0 << Access-Control-Allow-Headers: origin, co
ntent-type, accept
02:58:52.602 DEBUG - http-outgoing-0 << Content-Type: application/json; charset=
utf-8
02:58:52.603 DEBUG - http-outgoing-0 << Content-Length: 83
02:58:52.603 DEBUG - http-outgoing-0 << ETag: W/"53-t4S7rxlcLaigcijFcZ8qA3rUrvU"

02:58:52.603 DEBUG - http-outgoing-0 << Date: Mon, 11 Dec 2017 08:00:18 GMT
02:58:52.604 DEBUG - http-outgoing-0 << Connection: keep-alive
02:58:52.607 DEBUG - Connection can be kept alive indefinitely
02:58:52.610 DEBUG - Connection [id: 0][route: {}->http://appium_node_ip:4723] can be
kept alive indefinitely
02:58:52.610 DEBUG - Connection released: [id: 0][route: {}->http://appium_node_ip:47
23][total kept alive: 1; route allocated: 1 of 2000; total allocated: 1 of 2000]

02:58:57.612 DEBUG - Closing connections idle longer than 100 MILLISECONDS
02:58:57.613 DEBUG - http-outgoing-0: Close connection
02:58:57.615 DEBUG - CookieSpec selected: default
02:58:57.615 DEBUG - Auth cache not set in the context
02:58:57.616 DEBUG - Connection request: [route: {}->http://appium_node_ip:4723][tota
l kept alive: 0; route allocated: 0 of 2000; total allocated: 0 of 2000]
02:58:57.616 DEBUG - Connection leased: [id: 1][route: {}->http://appium_node_ip:4723
][total kept alive: 0; route allocated: 1 of 2000; total allocated: 1 of 2000]
02:58:57.617 DEBUG - Opening connection {}->http://appium_node_ip:4723
02:58:57.618 DEBUG - Connecting to /appium_node_ip:4723
02:58:57.627 DEBUG - Connection established grid_hub_ip:60994<->appium_node_ip:4723
02:58:57.627 DEBUG - http-outgoing-1: set socket timeout to 5000
02:58:57.627 DEBUG - Executing request GET /wd/hub/status HTTP/1.1
02:58:57.628 DEBUG - Target auth state: UNCHALLENGED
02:58:57.628 DEBUG - Proxy auth state: UNCHALLENGED
02:58:57.628 DEBUG - http-outgoing-1 >> GET /wd/hub/status HTTP/1.1
02:58:57.629 DEBUG - http-outgoing-1 >> Host: appium_node_ip:4723
02:58:57.629 DEBUG - http-outgoing-1 >> Connection: Keep-Alive
02:58:57.630 DEBUG - http-outgoing-1 >> User-Agent: Apache-HttpClient/4.5.3 (Jav
a/1.8.0_144)
02:58:57.630 DEBUG - http-outgoing-1 >> Accept-Encoding: gzip,deflate
02:58:57.630 DEBUG - http-outgoing-1 >> "GET /wd/hub/status HTTP/1.1[\r][\n]"
02:58:57.631 DEBUG - http-outgoing-1 >> "Host: appium_node_ip:4723[\r][\n]"
02:58:57.631 DEBUG - http-outgoing-1 >> "Connection: Keep-Alive[\r][\n]"
02:58:57.631 DEBUG - http-outgoing-1 >> "User-Agent: Apache-HttpClient/4.5.3 (Ja
va/1.8.0_144)[\r][\n]"
02:58:57.632 DEBUG - http-outgoing-1 >> "Accept-Encoding: gzip,deflate[\r][\n]"
02:58:57.632 DEBUG - http-outgoing-1 >> "[\r][\n]"
02:58:57.657 DEBUG - http-outgoing-1 << "HTTP/1.1 200 OK[\r][\n]"
02:58:57.658 DEBUG - http-outgoing-1 << "X-Powered-By: Express[\r][\n]"
02:58:57.658 DEBUG - http-outgoing-1 << "Access-Control-Allow-Origin: *[\r][\n]"

02:58:57.658 DEBUG - http-outgoing-1 << "Access-Control-Allow-Methods: GET,POST,
PUT,OPTIONS,DELETE[\r][\n]"
02:58:57.659 DEBUG - http-outgoing-1 << "Access-Control-Allow-Headers: origin, c
ontent-type, accept[\r][\n]"
02:58:57.659 DEBUG - http-outgoing-1 << "Content-Type: application/json; charset
=utf-8[\r][\n]"
02:58:57.660 DEBUG - http-outgoing-1 << "Content-Length: 83[\r][\n]"
02:58:57.660 DEBUG - http-outgoing-1 << "ETag: W/"53-t4S7rxlcLaigcijFcZ8qA3rUrvU
"[\r][\n]"
02:58:57.661 DEBUG - http-outgoing-1 << "Date: Mon, 11 Dec 2017 08:00:24 GMT[\r]
[\n]"
02:58:57.662 DEBUG - http-outgoing-1 << "Connection: keep-alive[\r][\n]"
02:58:57.662 DEBUG - http-outgoing-1 << "[\r][\n]"
02:58:57.662 DEBUG - http-outgoing-1 << "{"status":0,"value":{"build":{"version"
:"1.7.1","revision":null}},"sessionId":null}"
02:58:57.663 DEBUG - http-outgoing-1 << HTTP/1.1 200 OK
02:58:57.664 DEBUG - http-outgoing-1 << X-Powered-By: Express
02:58:57.664 DEBUG - http-outgoing-1 << Access-Control-Allow-Origin: *
02:58:57.665 DEBUG - http-outgoing-1 << Access-Control-Allow-Methods: GET,POST,P
UT,OPTIONS,DELETE
02:58:57.667 DEBUG - http-outgoing-1 << Access-Control-Allow-Headers: origin, co
ntent-type, accept
02:58:57.668 DEBUG - http-outgoing-1 << Content-Type: application/json; charset=
utf-8
02:58:57.669 DEBUG - http-outgoing-1 << Content-Length: 83
02:58:57.669 DEBUG - http-outgoing-1 << ETag: W/"53-t4S7rxlcLaigcijFcZ8qA3rUrvU"

02:58:57.670 DEBUG - http-outgoing-1 << Date: Mon, 11 Dec 2017 08:00:24 GMT
02:58:57.670 DEBUG - http-outgoing-1 << Connection: keep-alive
02:58:57.671 DEBUG - Connection can be kept alive indefinitely
02:58:57.672 DEBUG - Connection [id: 1][route: {}->http://appium_node_ip:4723] can be
kept alive indefinitely
02:58:57.673 DEBUG - Connection released: [id: 1][route: {}->http://appium_node_ip:47
23][total kept alive: 1; route allocated: 1 of 2000; total allocated: 1 of 2000]

Appium node console output:

appium --nodeconfig /path/to/nodeconfig.json --debug
[Appium] Welcome to Appium v1.7.1
[Appium] Non-default server args:
[Appium] nodeconfig: /path/to/nodeconfig.json
[Appium] debugLogSpacing: true
[debug] [Appium] Starting auto register thread for grid. Will try to register every 5000 ms.
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[debug] [Appium] Appium successfully registered with the grid on grid_ip:4444
[HTTP] --> GET /wd/hub/status {}
[debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: []
[debug] [MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.7.1","revision":null}}
[HTTP] <-- GET /wd/hub/status 200 17 ms - 83
[HTTP] --> GET /wd/hub/status {}

@rgoerner
Copy link

@kool79
This is not only iOS problem, same with android here.

@barancev
Copy link
Member

I think I know what causes this issue, it's a side effect of the commit dcb4792
This change was designed for node only, but apparently it runs on hub too :(
Working on a fix...

@kool79
Copy link
Contributor

kool79 commented Dec 21, 2017

@barancev , please, look at comments for 182ed38, especially to dropCapabilitiesThatDoenNotMatchCurrentPlatform(). It seems we still have an issue (details in comment)

@lock lock bot locked and limited conversation to collaborators Aug 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants