Re: shiny-server in debian

2022-03-24 Thread Nilesh Patra
Also adding andreas to the loop in case he has time to check.
Andreas, if you happen to build shiny-server, please remember to add

https://people.debian.org/~nilesh/shiny-server/

to your pbuilder extra-repos.

On Fri, Mar 25, 2022 at 11:10:04AM +0530, Nilesh Patra wrote:
> Hi Eric,
> 
> thanks for the feedback
> 
> On Thu, Mar 24, 2022 at 09:40:30PM -0400, Eric Brown wrote:
> > First, there are missing symlinks at /srv/shiny-server. I think the
> > expected behaviour is for there to be symbolic links to an index.html
> > [...]
> 
> I don't think this can happen in the debian land, unfortunately. Debian 
> packages
> are not supposed to install anything to /srv
> The closest thing I could find highlighting it is this lintian tag[1]
> 
> [1]: https://lintian.debian.org/tags/dir-or-file-in-srv
> 
> > When I move the sample files or my own shiny apps to
> > /srv/shiny-server, the folder that determines what is hosted, the
> > server does serve the pages and they render properly. However, when
> > interacting with the shiny app, it is clear they are not working
> > properly. The are unresponsive, don't update/produce results and
> > ultimately timeout/freeze. When I look at the web browser console, it
> > appears that certain internal javascript files are not being found
> > (e.g. __assets__/sockjs-0.3.4.min.js).
> 
> This should be trivial to fix, however I do not have time to do that
> at the moment.
> @Andrius, if you are reading this, could you please make according changes in 
> d/links?
> 
> > Finally, I noticed that the server logging is not fully working. The
> > server is supposed to log to /var/log/shiny-server.log but there is no
> > such file. On the other hand, it does properly log each individual
> > app's R output to /var/log/shiny-server/app_name-*.log.
> 
> Maybe something is messed in the config files, again no time to check.
> I only chimed in to get the package building, and did not check on the rest of
> the things, unfortunately I am out of time now, sorry :(
> 
> > I hope this is helpful
> 
> Indeed, thanks for the help.
> 
> Regards,
> Nilesh




signature.asc
Description: PGP signature


Re: shiny-server in debian

2022-03-24 Thread Nilesh Patra
Hi Eric,

thanks for the feedback

On Thu, Mar 24, 2022 at 09:40:30PM -0400, Eric Brown wrote:
> First, there are missing symlinks at /srv/shiny-server. I think the
> expected behaviour is for there to be symbolic links to an index.html
> [...]

I don't think this can happen in the debian land, unfortunately. Debian packages
are not supposed to install anything to /srv
The closest thing I could find highlighting it is this lintian tag[1]

[1]: https://lintian.debian.org/tags/dir-or-file-in-srv

> When I move the sample files or my own shiny apps to
> /srv/shiny-server, the folder that determines what is hosted, the
> server does serve the pages and they render properly. However, when
> interacting with the shiny app, it is clear they are not working
> properly. The are unresponsive, don't update/produce results and
> ultimately timeout/freeze. When I look at the web browser console, it
> appears that certain internal javascript files are not being found
> (e.g. __assets__/sockjs-0.3.4.min.js).

This should be trivial to fix, however I do not have time to do that
at the moment.
@Andrius, if you are reading this, could you please make according changes in 
d/links?

> Finally, I noticed that the server logging is not fully working. The
> server is supposed to log to /var/log/shiny-server.log but there is no
> such file. On the other hand, it does properly log each individual
> app's R output to /var/log/shiny-server/app_name-*.log.

Maybe something is messed in the config files, again no time to check.
I only chimed in to get the package building, and did not check on the rest of
the things, unfortunately I am out of time now, sorry :(

> I hope this is helpful

Indeed, thanks for the help.

Regards,
Nilesh


signature.asc
Description: PGP signature


Re: shiny-server in debian

2022-03-24 Thread Eric Brown
Hi again,

As previously noted, using your above-linked repo, shiny-server
installs on a new debian sid VM without error. However it doesn't
fully work as expected. Here are a few issues I have noticed.

First, there are missing symlinks at /srv/shiny-server. I think the
expected behaviour is for there to be symbolic links to an index.html
file and a sample apps folder in this location (specifically these
files https://github.com/rstudio/shiny-server/tree/master/samples),
which I believe is configured here
(https://github.com/rstudio/shiny-server/blob/master/packaging/debian-control/postinst.in)

When I move the sample files or my own shiny apps to
/srv/shiny-server, the folder that determines what is hosted, the
server does serve the pages and they render properly. However, when
interacting with the shiny app, it is clear they are not working
properly. The are unresponsive, don't update/produce results and
ultimately timeout/freeze. When I look at the web browser console, it
appears that certain internal javascript files are not being found
(e.g. __assets__/sockjs-0.3.4.min.js).

Finally, I noticed that the server logging is not fully working. The
server is supposed to log to /var/log/shiny-server.log but there is no
such file. On the other hand, it does properly log each individual
app's R output to /var/log/shiny-server/app_name-*.log.

I wonder whether these issues relate to patching it to use the Debian
node dependencies rather than its upstream internal install process?

I hope this is helpful and let me know if you need any clarifications.

Best,
Eric


On Thu, Mar 24, 2022 at 2:33 PM Eric Brown  wrote:
>
> Hi Nilesh,
> This is fantastic. I can say right off the bat that it installed and ran just 
> fine when I used your repo per the README. I’m going to do it again on a 
> fresh Debian and try my apps, just to be sure because I had been playing 
> around with some dependencies on this current install.
> Thanks for all your work on this.
> Best,
> Eric
>
> On Thu, Mar 24, 2022 at 13:33 Nilesh Patra  wrote:
>>
>> Hi Eric,
>>
>> On 3/24/22 10:05 PM, Eric Brown wrote:
>> > Hi Nilesh,
>> >
>> > I'm not sure whether you are running the current shiny-server version
>> > on salsa (upstream 1.5.14.948) but if so, the errors may be because it
>> > is out of date and subsequent to that release there were some changes
>> > to the iputils.js file
>> > (https://github.com/rstudio/shiny-server/commit/fba8b83ccd58eba1c2118884b25669a1d99ea202).
>> > I wonder if updating to the latest upstream release might fix these
>> > errors?
>>
>> Thanks that helped.
>> I backported selective fixes and got all tests passing and the package 
>> building \o/
>>
>> Since you volunteered to test the package once, I have hosted the '.deb' and 
>> other '.deb'
>> of its dependencies which are not available in the archive here:
>>
>> https://people.debian.org/~nilesh/shiny-server/
>>
>> Readme should help you pull it w/o hassles. If you want to directly install 
>> the '.debs' they are in the
>> pool dir
>>
>> https://people.debian.org/~nilesh/shiny-server/pool/main/
>>
>> Could you please test this? That'd be very helpful.
>>
>> Regards,
>> Nilesh
>>
>>
>>
> --
> Eric Brown MD MSc FRCPC
> For encryption, OpenPGP public key available on request.



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



Re: shiny-server in debian

2022-03-24 Thread Eric Brown
Hi Nilesh,
This is fantastic. I can say right off the bat that it installed and ran
just fine when I used your repo per the README. I’m going to do it again on
a fresh Debian and try my apps, just to be sure because I had been playing
around with some dependencies on this current install.
Thanks for all your work on this.
Best,
Eric

On Thu, Mar 24, 2022 at 13:33 Nilesh Patra  wrote:

> Hi Eric,
>
> On 3/24/22 10:05 PM, Eric Brown wrote:
> > Hi Nilesh,
> >
> > I'm not sure whether you are running the current shiny-server version
> > on salsa (upstream 1.5.14.948) but if so, the errors may be because it
> > is out of date and subsequent to that release there were some changes
> > to the iputils.js file
> > (
> https://github.com/rstudio/shiny-server/commit/fba8b83ccd58eba1c2118884b25669a1d99ea202
> ).
> > I wonder if updating to the latest upstream release might fix these
> > errors?
>
> Thanks that helped.
> I backported selective fixes and got all tests passing and the package
> building \o/
>
> Since you volunteered to test the package once, I have hosted the '.deb'
> and other '.deb'
> of its dependencies which are not available in the archive here:
>
> https://people.debian.org/~nilesh/shiny-server/
>
> Readme should help you pull it w/o hassles. If you want to directly
> install the '.debs' they are in the
> pool dir
>
> https://people.debian.org/~nilesh/shiny-server/pool/main/
>
> Could you please test this? That'd be very helpful.
>
> Regards,
> Nilesh
>
>
>
> --
Eric Brown MD MSc FRCPC
For encryption, OpenPGP public key available on request.


Re: shiny-server in debian

2022-03-24 Thread Nilesh Patra

Hi Eric,

On 3/24/22 10:05 PM, Eric Brown wrote:

Hi Nilesh,

I'm not sure whether you are running the current shiny-server version
on salsa (upstream 1.5.14.948) but if so, the errors may be because it
is out of date and subsequent to that release there were some changes
to the iputils.js file
(https://github.com/rstudio/shiny-server/commit/fba8b83ccd58eba1c2118884b25669a1d99ea202).
I wonder if updating to the latest upstream release might fix these
errors?


Thanks that helped.
I backported selective fixes and got all tests passing and the package building 
\o/

Since you volunteered to test the package once, I have hosted the '.deb' and 
other '.deb'
of its dependencies which are not available in the archive here:

https://people.debian.org/~nilesh/shiny-server/

Readme should help you pull it w/o hassles. If you want to directly install the 
'.debs' they are in the
pool dir

https://people.debian.org/~nilesh/shiny-server/pool/main/

Could you please test this? That'd be very helpful.

Regards,
Nilesh





OpenPGP_signature
Description: OpenPGP digital signature


Re: shiny-server in debian

2022-03-24 Thread Eric Brown
Hi Nilesh,

I'm not sure whether you are running the current shiny-server version
on salsa (upstream 1.5.14.948) but if so, the errors may be because it
is out of date and subsequent to that release there were some changes
to the iputils.js file
(https://github.com/rstudio/shiny-server/commit/fba8b83ccd58eba1c2118884b25669a1d99ea202).
I wonder if updating to the latest upstream release might fix these
errors?

Best,
Eric

On Thu, Mar 24, 2022 at 6:36 AM Andrius Merkys  wrote:
>
> Hi Nilesh,
>
> On 2022-03-24 12:03, Nilesh Patra wrote:
> > On 3/24/22 3:09 PM, Nilesh Patra wrote:
> >> I figured out the problem. It is so because the debian package
> >> node-send is patched[1]
> >> to use node-mime-types instead of node-mime (not sure why)
> >>
> >> I just filed a bug report (with you in x-debbugs-cc) to possibly fix
> >> it in node-send.
>
> Thanks for debugging this.
>
> > After fixing this locally, there are few failing tests (majority pass,
> > thankfully)
> > on similar lines of:
> >
> > |  1) iputil
> > |   validates addresses:
> > | TypeError: (intermediate value).isValid is not a function
> > |  at Object.isValid (lib/core/iputil.js:35:29)
> > |  at /home/nilesh/packages/shinyserv/shiny-server/test/iputil.js:32:36
> > |  at Array.forEach ()
> >
> > But right now I have no time to further debug this. Would be great if
> > you can take a look.
>
> I gave this a glance, but I cannot understand the problem, alas.
>
> Best,
> Andrius



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



Re: shiny-server in debian

2022-03-24 Thread Andrius Merkys
Hi Nilesh,

On 2022-03-24 12:03, Nilesh Patra wrote:
> On 3/24/22 3:09 PM, Nilesh Patra wrote:
>> I figured out the problem. It is so because the debian package
>> node-send is patched[1]
>> to use node-mime-types instead of node-mime (not sure why)
>>
>> I just filed a bug report (with you in x-debbugs-cc) to possibly fix
>> it in node-send.

Thanks for debugging this.

> After fixing this locally, there are few failing tests (majority pass,
> thankfully)
> on similar lines of:
> 
> |  1) iputil
> |   validates addresses:
> | TypeError: (intermediate value).isValid is not a function
> |  at Object.isValid (lib/core/iputil.js:35:29)
> |  at /home/nilesh/packages/shinyserv/shiny-server/test/iputil.js:32:36
> |  at Array.forEach ()
> 
> But right now I have no time to further debug this. Would be great if
> you can take a look.

I gave this a glance, but I cannot understand the problem, alas.

Best,
Andrius



Re: shiny-server in debian

2022-03-24 Thread Nilesh Patra

On 3/24/22 3:09 PM, Nilesh Patra wrote:

On Thu, Mar 24, 2022 at 10:12:13AM +0200, Andrius Merkys wrote:

Oh right, it is 'node-send' which needs patching:
[...]
However, I have no idea how to fix this in 'node-send'.


I figured out the problem. It is so because the debian package node-send is 
patched[1]
to use node-mime-types instead of node-mime (not sure why)

I just filed a bug report (with you in x-debbugs-cc) to possibly fix it in 
node-send.


After fixing this locally, there are few failing tests (majority pass, 
thankfully)
on similar lines of:

|  1) iputil
|   validates addresses:
| TypeError: (intermediate value).isValid is not a function
|  at Object.isValid (lib/core/iputil.js:35:29)
|  at /home/nilesh/packages/shinyserv/shiny-server/test/iputil.js:32:36
|  at Array.forEach ()

But right now I have no time to further debug this. Would be great if you can 
take a look.

Nilesh



OpenPGP_signature
Description: OpenPGP digital signature


Re: shiny-server in debian

2022-03-24 Thread Nilesh Patra
On Thu, Mar 24, 2022 at 10:12:13AM +0200, Andrius Merkys wrote:
> Oh right, it is 'node-send' which needs patching:
> [...]
> However, I have no idea how to fix this in 'node-send'.

I figured out the problem. It is so because the debian package node-send is 
patched[1]
to use node-mime-types instead of node-mime (not sure why)

I just filed a bug report (with you in x-debbugs-cc) to possibly fix it in 
node-send.

[1]: 
https://salsa.debian.org/js-team/node-send/-/blob/master/debian/patches/0001-use_ms_from_debug.patch#L15

Regards,
Nilesh


signature.asc
Description: PGP signature


Re: shiny-server in debian

2022-03-24 Thread Andrius Merkys
Hi Nilesh,

On 2022-03-24 10:04, Nilesh Patra wrote:
> On Thu, Mar 24, 2022 at 08:41:01AM +0200, Andrius Merkys wrote:
>> Looking deeper into it, the problem seems to be that node-mime-types has
>> dropped define() in v2.0.0, as per
>> /usr/share/doc/node-mime-types/HISTORY.md.gz:
>>
>> 2.0.0 / 2014-09-02
>> ==
>>
>>   * Use `mime-db`
>>   * Remove `.define()`
> I am a bit confused -- the error seems to stem from 'node-send' package right?

Oh right, it is 'node-send' which needs patching:

$ cat test.js
var send = require('send')
var mime_types = require('mime-types')
var mime = require('mime')

console.log(send.mime.define)
console.log(mime_types.define)
console.log(mime.define)

$ nodejs test.js
undefined
undefined
[Function: bound ]

However, I have no idea how to fix this in 'node-send'.

Best,
Andrius



Re: shiny-server in debian

2022-03-24 Thread Nilesh Patra
Hi Andrius,

On Thu, Mar 24, 2022 at 08:41:01AM +0200, Andrius Merkys wrote:
> Looking deeper into it, the problem seems to be that node-mime-types has
> dropped define() in v2.0.0, as per
> /usr/share/doc/node-mime-types/HISTORY.md.gz:
> 
> 2.0.0 / 2014-09-02
> ==
> 
>   * Use `mime-db`
>   * Remove `.define()`

I am a bit confused -- the error seems to stem from 'node-send' package right?
node-send uses mime in its code, and mime has a define function

> var mime = require('mime')
undefined
> mime.define
[Function: bound ]

Even on doing a grep, I am seeing mime-types v2

npm-shrinkwrap.json:1552:"mime-types": {
npm-shrinkwrap.json:1554:  "resolved": 
"https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz;,

Please let me know what I am missing here.

Regards,
Nilesh 


signature.asc
Description: PGP signature


Re: shiny-server in debian

2022-03-24 Thread Andrius Merkys
Hi Nilesh,

On 2022-03-24 00:25, Nilesh Patra wrote:
> I uploaded rewire to NEW. On testing locally with rewire, I get:
> 
> | TypeError: send.mime.define is not a function
> |at Object. 
> (/home/nilesh/packages/shinyserv/shiny-server/lib/router/directory-router.js:27:11)
> |at Module._compile (internal/modules/cjs/loader.js:999:30)
> |at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
> |at Module.load (internal/modules/cjs/loader.js:863:32)
> 
> Does not quite ring a bell, maybe wil take a look next weekend.

Thanks a lot for packaging rewire! I confirm I get the same error.
Looking deeper into it, the problem seems to be that node-mime-types has
dropped define() in v2.0.0, as per
/usr/share/doc/node-mime-types/HISTORY.md.gz:

2.0.0 / 2014-09-02
==

  * Use `mime-db`
  * Remove `.define()`

So shiny-server needs to be patched to register 'text/R' mimetype in
more up-to-date manner.

Best,
Andrius