cytoscape / RCy3

New version of RCy3, redesigned and collaboratively maintained by Cytoscape developer community
MIT License
50 stars 20 forks source link

Cannot connect to Cytoscape via cyREST #219

Closed kaijagahm closed 8 months ago

kaijagahm commented 8 months ago

Hi there! I'm having trouble using any functions in RCy3 because of, apparently, a problem connecting to Cytoscape.

Here is an example:

library(RCy3)
#> Warning: package 'RCy3' was built under R version 4.3.2
cytoscapePing()
#> Oh no! I can't find Cytoscape. RCy3 can not continue!
#> Please check that Cytoscape is running, CyREST is installed and your base.url parameter is correct.
#> Error in value[[3L]](cond): object 'res' not found
#> Error in cyrestGET("version", base.url = base.url): object 'res' not found

Created on 2024-02-27 with reprex v2.1.0

I just installed Cytoscape and RCy3 yesterday and reinstalled R today, so I don't think I have old versions. Based on the indicator to check whether CyREST was installed, I attempted to manually install it, but I ran into an error with Java when I did that. Here is my sessionInfo().

sessionInfo()
#> R version 4.3.2 (2023-10-31)
#> Platform: aarch64-apple-darwin20 (64-bit)
#> Running under: macOS Monterey 12.2.1
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRblas.0.dylib 
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0
#> 
#> locale:
#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#> 
#> time zone: America/Los_Angeles
#> tzcode source: internal
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] digest_0.6.34     fastmap_1.1.1     xfun_0.42         glue_1.7.0       
#>  [5] knitr_1.45        htmltools_0.5.7   rmarkdown_2.25    lifecycle_1.0.4  
#>  [9] cli_3.6.2         reprex_2.1.0      withr_3.0.0       compiler_4.3.2   
#> [13] rstudioapi_0.15.0 tools_4.3.2       evaluate_0.23     yaml_2.3.8       
#> [17] rlang_1.1.3       fs_1.6.3

Created on 2024-02-27 with reprex v2.1.0

Any thoughts on what might be going wrong?

bdemchak commented 8 months ago

Could it be that you have an application that has already taken port 1234? Cytoscape/CyREST listen on than port for RCy3/py4cytoscape requests.

kaijagahm commented 8 months ago

Entirely possible. Do you know how I would go about checking that? I have a very rudimentary understanding of ports.

bdemchak commented 8 months ago

This would depend on whether you're on a Mac or PC. I don't have a Mac, but the commands would translate closely.

netstat -a | find "1234"

Try this when Cytoscape is not running. If this command produces any output, you know that there's a process already listening on that port.

If you find a listener on port 1234, you can find out which application it is if you have administrator privileges. Use this command:

netstat -ab

This will output to the console. Look for the listener for 1234 and see the application name on the next line.

Good luck!

kaijagahm commented 8 months ago

I tried that, and it looks like there is nothing using port 1234.

coleslaw481 commented 8 months ago

This might be a stupid question, but is Cytoscape running? If it is, when Cytoscape starts a dialog may appear that asks if it should allow network connections (be sure to click allow)

kaijagahm commented 8 months ago

Cytoscape is running, yes. But I got no such dialog. I can go digging around in the settings and see if I can find it, though.

AlexanderPico commented 8 months ago

Usually a restart of Cytoscape works resolve this issue. If not, I would next try a complete reboot.

kaijagahm commented 8 months ago

I've already tried restarting Cytoscape; you're saying a reboot of the computer? I can try that now.

kaijagahm commented 8 months ago

Aha! That fixed it! I restarted my computer and now the connection works.

Thank you all for your (very prompt) help. I appreciate it.