Shinyproxy and local MariaDB/MySQL database

Hi everyone

I am stuck with a what is probably a relatively simple problem. I have a local MariaDB database on my Ubuntu server and try to connect to it from a Shiny app running in Shinyproxy. However, I simply cannot get it to work, whenever I try to connect to the database I get the 500 Error (Container did not respond in time). My Shiny App is extremely simple and the lines that create the error whenever uncommented are

pool <- dbPool(drv = RMariaDB::MariaDB(), dbname = "mydbname", host="", user="myusername", password = "mypassword", port=3306)
print(dbGetQuery(pool, "SELECT * FROM metadata LIMIT 10") )

All the necessary libraries are installed and when I run

docker run -it --network="host" -p 3838:3838 -v /var/lib/mysql/mydbname:/var/lib/mysql/mydbname shinyproxy_rmdb_rsql

with shinyproxy_rmdb_rsql being the name of the image that I have created, everything works fine and I get the first ten lines of table metadata from mydbname returned.

The same does not work in Shinyproxy and I suspect that it has something to do with the network parameter.

My application.yml is modeled at the standard one and looks like this:

  title: Open Analytics Shiny Proxy
  landing-page: /
  heartbeat-rate: 10000
  heartbeat-timeout: 60000
  port: 8080
  authentication: ldap
  admin-groups: scientists
  # Example: 'simple' authentication configuration
  - name: jack
    password: password
    groups: scientists
  - name: jeff
    password: password
    groups: mathematicians
  # Example: 'ldap' authentication configuration
    url: ldap://,dc=com
    user-dn-pattern: uid={0}
    group-search-filter: (uniqueMember={0})
    manager-dn: cn=read-only-admin,dc=example,dc=com
    manager-password: password
  # Docker configuration
    cert-path: /home/none
    url: http://localhost:2375
    port-range-start: 20000
  - id: 01_hello
    display-name: Hello Application
    description: Application which demonstrates the basics of a Shiny app
    container-cmd: ["R", "-e", "shinyproxy::run_01_hello()"]
    container-image: openanalytics/shinyproxy-demo
    access-groups: [scientists, mathematicians]
  - id: 06_tabsets
    container-cmd: ["R", "-e", "shinyproxy::run_06_tabsets()"]
    container-image: openanalytics/shinyproxy-demo
    access-groups: scientists
  - id: mariadb_test
    display-name: Test MariaDB
    container-cmd: ["R", "-e", "shiny::runApp('/root/mariadbtest', host='', port=3838)"]
    container-image: shinyproxy_rmdb_rsql
    container-volumes: [ "/var/lib/mysql/mydbname:/var/lib/mysql/mydbname" ]
    access-groups: scientists

Many thanks in advance for any support.

1 Like