h-a-graham / EAlidaR

Package to download EA liDAR data
GNU General Public License v3.0
22 stars 2 forks source link

MacOS/OSX... #30

Open piabenaud opened 3 years ago

piabenaud commented 3 years ago

Hey dude, Just tried to see if I could grab some data and hit a wall... Either a mac issue or a me issue... I specified the chrome version (87.0.4280.88). Do I need to provide more info?

`Selenium message:Unable to create new service: ChromeDriverService Build info: version: '4.0.0-alpha-2', revision: 'f148142cf8', time: '2019-07-01T21:30:10' System info: host: 'geo-01436', ip: 'fe80:0:0:0:xxx:61ff:dxxx:328%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.6', java.version: '13.0.2' Driver info: driver.version: unknown

Could not open chrome browser. Client error message: Summary: SessionNotCreatedException Detail: A new session could not be created. Further Details: run errorDetails method Check server log for further details. Error in checkError(res) : Undefined error in httr call. httr output: length(url) == 1 is not TRUE`

h-a-graham commented 3 years ago

Thanks Pia, have you tried running binman::list_versions('chromedriver') This should show different versions, can you try a few different options and see if that helps, please?

piabenaud commented 3 years ago

I had three options, two 87.x which gave the same result as above, and 88.x which returned the below. Just checked and I'm running the latest version of chrome I can.

No destination folder provided - saving to temp directory..

Scraping web portal tile tokens...

Selenium message:session not created: This version of ChromeDriver only supports Chrome version 88 Current browser version is 87.0.4280.88 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome Build info: version: '4.0.0-alpha-2', revision: 'f148142cf8', time: '2019-07-01T21:30:10' System info: host: 'geo-01436', ip: 'fe80:0:0:0:8d6:6xxx:dxx7:328%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.6', java.version: '13.0.2' Driver info: driver.version: unknown remote stacktrace: 0 chromedriver 0x0000000101d2be09 chromedriver + 2641417 1 chromedriver 0x00000001023b74b3 chromedriver + 9503923 2 chromedriver 0x0000000101ace9b3 chromedriver + 162227 3 chromedriver 0x0000000101af2a56 chromedriver + 309846 4 chromedriver 0x0000000101aeec57 chromedriver + 293975 5 chromedriver 0x0000000101aebe85 chromedriver + 282245 6 chromedriver 0x0000000101b1f074 chromedriver + 491636 7 chromedriver 0x0000000101b1a053 chromedriver + 471123 8 chromedriver 0x0000000101af4ae4 chromedriver + 318180 9 chromedriver 0x0000000101af5a87 chromedriver + 322183 10 chromedriver 0x0000000101cfbab9 chromedriver + 2443961 11 chromedriver 0x0000000101d0889f chromedriver + 2496671 12 chromedriver 0x0000000101d0855b chromedriver + 2495835 13 chromedriver 0x0000000101ce24c5 chromedriver + 2340037 14 chromedriver 0x0000000101d0947f chromedriver + 2499711 15 chromedriver 0x0000000101cf1049 chromedriver + 2400329 16 chromedriver 0x0000000101d2033f chromedriver + 2593599 17 chromedriver 0x0000000101d31523 chromedriver + 2663715 18 libsystem_pthread.dylib 0x00007fff6b7bd661 _pthread_body + 340 19 libsystem_pthread.dylib 0x00007fff6b7bd50d _pthread_body + 0 20 libsystem_pthread.dylib 0x00007fff6b7bcbf9 thread_start + 13

Could not open chrome browser. Client error message: Summary: SessionNotCreatedException Detail: A new session could not be created. Further Details: run errorDetails method Check server log for further details. Error in checkError(res) : Undefined error in httr call. httr output: length(url) == 1 is not TRUE

h-a-graham commented 3 years ago

Does this help in any way? https://stackoverflow.com/questions/60468006/r-rselenium-rsdriver-chrome-browser-error-on-mac suggests that you need to install Java SE would you mind giving that a whirl and letting me know if anything changes? Thanks!

h-a-graham commented 3 years ago

Okay, so I just installed on a different machine (still windows) and encountered a similar problem. removing the current java installation and reinstalling seemed to solve things for me... Also I recomended reinstall EAlidaR as I have made a few changes that should help. Mainly, I have specified the GIthub version of Rselenium which has more up to date drivers than on CRAN. this should help. Let me know how you get on. I'll add a note in the Readme about the JAVA issues.

h-a-graham commented 3 years ago

Also, Pia would you mind doing me a massive favour and telling me what this prints on your system, please?

Sys.info()['sysname']

system('/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version', intern=TRUE) %>% gsub("[^0-9.-]", "", .)

I'd like to add support for MacOS/OSX to the find_chrome_v function to automate the process a bit better but I have no way of testing what these functions return...

piabenaud commented 3 years ago

Right... no luck... I've updated Java and installed Java SE and still get the same result... boo...

And so far it prints "Unexpected symbol in Sys.info()['sysname'] system" ...

h-a-graham commented 3 years ago

Sorry, have edited the above code. I formatted it wrong. It should be two separate lines. Hmmm annoying about Java... Let me have a search around, I'll see what I can dig up...

piabenaud commented 3 years ago

Ah, that makes sense. I could get the first bit to run, but stupidly didn't try the second independently...

Sys.info()['sysname'] sysname "Darwin" system('/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version', intern=TRUE) %>% gsub("[^0-9.-]", "", .) sh: /Applications/Google: No such file or directory Error in system("/Applications/Google Chrome.app/Contents/MacOS/Google Chrome --version", : error in running command

piabenaud commented 3 years ago

Oh, just looking at the apps folder, it's just straight up 'Google Chrome' rather than a google/chrome.app if that helps?

piabenaud commented 3 years ago

Having a bit of a look through this and I think it's the same issue where my chrome is the latest available version 87.x but the latest driver version is 88.x, so if I specify a driver that works with my version of chrome as per the answer, the Selenium set up doesn't like it. As far as I can tell, none of the other answers will work, but I'll keep digging/have a look at your code...

h-a-graham commented 3 years ago

Right, this is perhaps a long shot... I assume you're working in Rstudio? Can you try again but running Rstudio as admin? https://github.com/ropensci/RSelenium/issues/121

h-a-graham commented 3 years ago

Okay so MacOS issues seem to be occurring lots at the moment relating to:

https://github.com/ropensci/binman/issues/7 and https://github.com/ropensci/wdman/issues/25

I'll keep an eye on these issues and see where things get to. We could consider adding support for other browsers (Firefox) but at the moment, I'm still having trouble with sending keys using the gecko driver / firefox. Ideally I want to keep things as simple as possible and support a single browser that just works across all platforms. If anyone has a work around for this, I'm all ears!

h-a-graham commented 3 years ago

Error reported by @piabenaud is: Selenium message:Timed out waiting for driver server to start. Build info: version: '4.0.0-alpha-2', revision: 'f148142cf8', time: '2019-07-01T21:30:10' System info: host: 'PIABENAUDMBP', ip: 'fe80:0:0:0:8ef:7b4:42aa:4169%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.7', java.version: '16.0.1' Driver info: driver.version: unknown Could not open chrome browser. Client error message: Summary: UnknownError Detail: An unknown server-side error occurred while processing the command. Further Details: run errorDetails method Check server log for further details. Error in checkError(res) : Undefined error in httr call. httr output: length(url) == 1 is not TRUE

None of the workarounds seem to solve the issue in this instance...

h-a-graham commented 3 years ago

So this is not yet resolved seems like the incorrect drivers are being downloaded. For now it is possible to run on MacOS by installing the ubunutu-dev branch with: devtools::install_github('h-a-graham/EAlidaR', ref='ubuntu_dev) try running a function or run wdman:::chrome_check(verbose=TRUE) This will fail.

Then download the correct driver from: https://chromedriver.chromium.org/downloads

unzip the driver folder into: /Library/Application Support/binman_chromedriver/mac64/90.0.4430.24 Or whatever the correct driver number is.

Finally whenever running the download functions in EAlidaR - make sure to use the undocumented check_selenium=FALSE

I will soon add this argument to the main branch but for now it is only in this dev branch.

Fingers crossed the upstream issues will be fixed soon and then this work around will not be reuired. will leave this open until a satisfatory solution appears... Thanks @piabenaud for your help on this.