openanalytics/shinyproxy

integrating web application sqlpad result as blank page

Closed this issue · 2 comments

shinyproxy 3.1.1
docker mode

I tried to integrate the web sql ui sqlpad. See https://github.com/sqlpad/sqlpad/tree/master/docker-examples#running-from-command-line

    - id: sqlpad
      container-image: sqlpad/sqlpad:latest
      port: 3000
      container-env:
        SQLPAD_ADMIN: admin@sqlpad.com
        SQLPAD_ADMIN_PASSWORD: admin

the behavior is that:

  • the container startups successfully
  • the logs looks fine for both shiny-proxy and the container (see below)
  • the application keep running but the page is blank

from the navigator debug, (see below) the application js files are not available. When running docker run -p 3000:3000 -e "SQLPAD_ADMIN=admin@sqlpad.com" -e "SQLPAD_ADMIN_PASSWORD=admin" sqlpad/sqlpad:latest the same js files are available and the application sqlpad fine.

note that the missing js/css files link to in https://<my-shinyproxy-domain>/assets/index-b65b5adc.js path.

Screenshot-nparis_2024-08-21_09:31:39

Shinyproxy logs:

shiny-proxy-shiny-proxy-test-1  | 2024-08-21T07:36:02.486Z  INFO 1 --- [ProxyService-16] o.m.docker.client.DefaultDockerClient    : Starting container with Id: 2557291691b9f4bb61965d60fd7bbdfd0a35c837f71f0882bcfe0a0e3e47bfef
shiny-proxy-shiny-proxy-test-1  | 2024-08-21T07:36:08.408Z  WARN 1 --- [ProxyService-16] e.o.shinyproxy.ShinyProxyTestStrategy    : [user=parisni proxyId=3be22adb-95e5-4d22-b907-ebe9ff71da50 specId=sqlpad] Container unresponsive, trying again (11/20): http://2557291691b9:3000
shiny-proxy-shiny-proxy-test-1  | 2024-08-21T07:36:10.410Z  WARN 1 --- [ProxyService-16] e.o.shinyproxy.ShinyProxyTestStrategy    : [user=parisni proxyId=3be22adb-95e5-4d22-b907-ebe9ff71da50 specId=sqlpad] Container unresponsive, trying again (12/20): http://2557291691b9:3000
shiny-proxy-shiny-proxy-test-1  | 2024-08-21T07:36:12.444Z  INFO 1 --- [ProxyService-16] e.o.shinyproxy.ShinyProxyTestStrategy    : [user=parisni proxyId=3be22adb-95e5-4d22-b907-ebe9ff71da50 specId=sqlpad] Container responsive
shiny-proxy-shiny-proxy-test-1  | 2024-08-21T07:36:12.473Z  INFO 1 --- [ProxyService-16] e.o.containerproxy.service.ProxyService  : [user=parisni proxyId=3be22adb-95e5-4d22-b907-ebe9ff71da50 specId=sqlpad] Proxy activated

Sqlpad logs:

{"level":30,"time":"2024-08-21T07:36:12.143Z","pid":1,"hostname":"2557291691b9","name":"sqlpad-app","msg":"Welcome to SQLPad! Visit http://localhost:3000 to get started"}
{"level":30,"time":"2024-08-21T07:36:12.445Z","pid":1,"hostname":"2557291691b9","name":"sqlpad-web","req":{"id":1,"method":"GET","url":"/","query":{},"params":{}},"res":{"statusCode":200},"responseTime":22,"msg":"request completed"}
{"level":30,"time":"2024-08-21T07:36:12.656Z","pid":1,"hostname":"2557291691b9","name":"sqlpad-web","req":{"id":2,"method":"GET","url":"/","query":{},"params":{}},"res":{"statusCode":200},"responseTime":3,"msg":"request completed"}

Sqlpad provides a way to setup the
base url: https://github.com/sqlpad/sqlpad/blob/ed33d495f470c1029377e098c1cf5e8ec4a797f1/docs/src/pages/en/configuration.md?plain=1#L39

So i did add the env var:

      container-env:
        SQLPAD_BASE_URL: "#{proxy.getRuntimeValue('SHINYPROXY_PUBLIC_PATH').replaceFirst('/$','')}"

Now the js/css files are found, but still the page is blank
Screenshot-nparis_2024-08-21_22:16:48

also added

target-path: "#{proxy.getRuntimeValue('SHINYPROXY_PUBLIC_PATH').replaceFirst('/$','')}"

and know sounds like it now works fine

Screenshot-nparis_2024-08-21_22:19:26