geosapi + shiny-server

I am currently trying to set up a leaflet mapping tool using shiny and Posit open source shiny-server.

There is a list of map layers that are hosted on geoserver and are accessed via the geosapi R package. Locally I am able to create the connection to the geoserver using the geosapi function:


This 99% of the time works, the only time it doesn't is if I have lost internet connection or if our geoserver has gone down for some reason. This normally produces the following error:


The error occurs because the follow tryCatch hits an issue so it sets gsman to NULL:

gsman <- tryCatch({
    url = baseUrl,
    #baseUrl of the Geoserver
    user = user,
    pwd = pwd,
    logger = NULL #logger, for info or debugging purpose
error = function(cond) {
  print(paste0("here ", cond))

For some unknown reason I get this same error when attempting to deploy my shiny application to my shiny-server but not when hosting it on Posit Connect. I am concerned that shiny-sever doesn't allow REST APIs or I am doing something very wrong. I'm not too sure so if anyone is able to help out that would be amazing!

Server -> Ubuntu 21.10
R -> 4.1.2
Shiny -> 1.7.3
geosapi -> 0.6.4
Shiny-Server ->
Node.js -> 12.22.6

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.