[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: shiny-server in debian



Hi Nilesh,

Thanks for checking in and your ongoing work on this. I've been trying
to get it to work but haven't had luck yet. With this updated version,
the server still runs but now the included sample apps are not working
(the shiny app displays an initial state but is not interactive; my
own apps do not work).

Some dependencies still need updating (remove jslib-sockjs and add
node-sockjs-client).
Some manual intervention is still required:
sudo mkdir /usr/lib/shiny-server/node_modules
sudo ln -s /usr/share/nodejs/sockjs-client/ /usr/lib/shiny-server/node_modules/
sudo ln -s /usr/share/nodejs/shiny-server-client/
/usr/lib/shiny-server/node_modules/

Even with the above, this is the error that shows in the console when
running the basic included sample app:

Uncaught TypeError: global.SockJS is not a constructor
    at RobustConnection._factory (shiny-server-client.min.js:1:39593)
    at open_p (shiny-server-client.min.js:1:13970)
    at attempt (shiny-server-client.min.js:1:42948)
(anonymous)@shiny-server-client.min.js:1
open_p@shiny-server-client.min.js:1
attempt@shiny-server-client.min.js:1
setTimeout (async)
exports.retryPromise_p@shiny-server-client.min.js:1
RobustConnection._connect@shiny-server-client.min.js:1
RobustConnection@shiny-server-client.min.js:1
(anonymous)@shiny-server-client.min.js:1
(anonymous)@shiny-server-client.min.js:1
shiny.createSocket@shiny-server-client.min.js:1
value@shinyapp.ts:324
value@shinyapp.ts:277
vy@init.ts:425
(anonymous)@index.ts:56
setTimeout (async)
(anonymous)@index.ts:55
e@jquery.min.js:2
t@jquery.min.js:2
setTimeout (async)
(anonymous)@jquery.min.js:2
c@jquery.min.js:2
fireWith@jquery.min.js:2
fire@jquery.min.js:2
c@jquery.min.js:2
fireWith@jquery.min.js:2
ready@jquery.min.js:2
B@jquery.min.js:2

I have tried various things including adjusting the server
configuration, changing server protocols, trying more symlinks of
dependencies (including symlinking all of the nodejs modules to
node_modules, but have not had success. To try to diagnose the
problem, I ran npm install in the shiny-server directory. This did
result in everything working. To me this suggests we are possibly
missing a node dependency, have an out of date dependency, or they are
not linked properly (not sure exactly what npm install does aside from
fetching and identifying and installing node dependencies, and whether
some parts of this process are still needed when using local/deb
versions). Please let me know if the console error message above gives
you any hints, or if you have suggestions for me to try to narrow this
down.

I did figure out why server logging was not working. The
shiny-server.service file is missing the instruction to log. Compare
the line [1] in our version vs. [2] in version included in the
upstream repo. When [1] is replaced with [3] and the file
/var/log/shiny-server.log is created, logging works properly. Probably
we can replace shiny-server.service with the upstream version
(https://github.com/rstudio/shiny-server/blob/master/config/systemd/shiny-server.service).

[1] ExecStart=/usr/bin/shiny-server
[2] ExecStart=/usr/bin/env bash -c 'exec
/opt/shiny-server/bin/shiny-server >> /var/log/shiny-server.log 2>&1'

[3] ExecStart=/usr/bin/env bash -c 'exec
/usr/lib/shiny-server/bin/shiny-server >> /var/log/shiny-server.log
2>&1'

I'm still looking into all this but am getting stuck and any hints or
suggestions are appreciated.
Best,
Eric

On Wed, Mar 30, 2022 at 5:14 AM Nilesh Patra <nilesh@debian.org> wrote:
>
> Hi Eric,
>
> On Sun, Mar 27, 2022 at 06:18:49PM +0530, Nilesh Patra wrote:
> > > > 3. update outdated node-shiny-server-client to latest upstream
> > >
> > > Seems a wise thing to do.
> >
> > I have done so.
> >
> > @Eric, if you can try with the newer versions of these packages to check if your
> > second app looks better, that'd be much appreciated.
> > If it is, then rest stuff should be relatively easy to fix.
>
> Did you get a chance to test it with updated versions of the packages?
> I was planning to proceed to finalise this package according to the feedback.
>
> Let me know.
>
> Regards,
> Nilesh



-- 
Eric Brown MD MSc FRCPC
For encryption, OpenPGP public key available on request.


Reply to: