#14358: Notebook server should run Java for JMol inside temporary directory
----------------------------------+----------------------------------
       Reporter:  ppurka          |        Owner:  jason, mpatel, was
           Type:  defect          |       Status:  needs_review
       Priority:  major           |    Milestone:  sage-5.13
      Component:  graphics        |   Resolution:
       Keywords:                  |    Merged in:
        Authors:  Jeroen Demeyer  |    Reviewers:
Report Upstream:  N/A             |  Work issues:
         Branch:                  |       Commit:
   Dependencies:                  |     Stopgaps:
----------------------------------+----------------------------------
Description changed by jdemeyer:

Old description:

> When a Sage notebook server needs to create a static 3D image, it runs
> JMol server-side to create this image (if Java is available). However, it
> does this inside a directory to which the worker process might not have
> access to.
>
> ----
>
> '''Old report''' (before we diagnosed the problem):
>
> We have been running the sage worksheets as an unprivileged user. The
> setup is as follows.
>
> 1. A user, say user1, starts the sage server using
> {{{
> sage -n port=8888 accounts=True interface=''
> server_pool=['sagenb@localhost'] openid=True automatic_login=False
> port_tries=0 directory=/home/user1/a.sagenb
> }}}
> 2. Because of the server_pool command, any worksheet is opened as an
> unprivileged user called ''sagenb''. Here is some more info on how to set
> up the environment.
>  1. Create user sagenb by doing (as root)
> {{{
> $ groupadd sagenb
> $ useradd -g sagenb -m sagenb
> }}}
>  2. Create a ssh key for user1
> {{{
> $ ssh-keygen -t rsa # run as user1 and make it passwordless
> }}}
>  3. Copy the id_rsa.pub to `~sagenb/.ssh/authorized_keys`.
> {{{
> $ cp -a ~user1/.ssh/id_rsa.pub /tmp/authorized_keys # Run as user1
> $ mkdir ~sagenb/.ssh # Run as sagenb
> $ cp /tmp/authorized_keys .ssh # Run as sagenb
> }}}
> 3. With default sage-5.2 there is no problem with this and everything
> works.
> 4. With sage-5.2 + "#13121 without new jmol", jmol works but one needs to
> close the worksheet and then reopen the worksheet and then the jmol pops
> up.
> 5. With sage-5.2 + #13121, jmol works partially:
>  1. First, the static image can not be created and there is a permission
> denied error. See [attachment:permission_error.jpg].
>  2. However, once the 3D output is toggled, jmol loads fine. The
> permission denied error is still there.
>  3. The error obtained is of the form
> {{{
> script ERROR: script ERROR: io error reading
> /home/user1/a.sagenb/home/__store__/0/09/098/098f/te\
> st/0/cells/7/sage0-size500-499889951.jmol.zip|SCRIPT:
> java.io.FileNotFoundException:
> /home/user1/a.sagenb/home/__store__/0/09/098/098f/te\
> st/0/cells/7/sage0-size500-499889951.jmol.zip (Permission denied)
> Sleeping...Make Interactive
> }}}
> 6. When run locally, i.e., without server_pool, the jmol loads and runs
> fine. For instance, this is fine:
> {{{
> sage -n directory=a.sagenb
> }}}
>
> This problem has made it difficult for me to upgrade a server from 5.2
> and I think the error is introduced by some change in jmol. The error
> itself stems from some java component. A diff of the changes between the
> directory `$SAGE_ROOT/devel/sagenb/sagenb/data/sage3d` for sage-5.2 and
> sage-5.7.rc0 has not yielded any difference. So, I believe the difference
> is really in the jmol spkg introduced in #12299.
>
> I have traced it back and reproduced it in sage-5.2 + new notebook + new
> jmol. Although I wrote sage-5.2 above, the error is present in all the
> sage versions I have tried - sage-5.4 till sage-5.9.beta0.

New description:

 When a Sage notebook server needs to create a static 3D image, it runs
 JMol server-side to create this image (if Java is available). However, it
 does this inside a directory to which the worker process might not have
 access to.

 '''Apply''' [attachment:14358_java.patch]

 ----

 '''Old report''' (before we diagnosed the problem):

 We have been running the sage worksheets as an unprivileged user. The
 setup is as follows.

 1. A user, say user1, starts the sage server using
 {{{
 sage -n port=8888 accounts=True interface=''
 server_pool=['sagenb@localhost'] openid=True automatic_login=False
 port_tries=0 directory=/home/user1/a.sagenb
 }}}
 2. Because of the server_pool command, any worksheet is opened as an
 unprivileged user called ''sagenb''. Here is some more info on how to set
 up the environment.
  1. Create user sagenb by doing (as root)
 {{{
 $ groupadd sagenb
 $ useradd -g sagenb -m sagenb
 }}}
  2. Create a ssh key for user1
 {{{
 $ ssh-keygen -t rsa # run as user1 and make it passwordless
 }}}
  3. Copy the id_rsa.pub to `~sagenb/.ssh/authorized_keys`.
 {{{
 $ cp -a ~user1/.ssh/id_rsa.pub /tmp/authorized_keys # Run as user1
 $ mkdir ~sagenb/.ssh # Run as sagenb
 $ cp /tmp/authorized_keys .ssh # Run as sagenb
 }}}
 3. With default sage-5.2 there is no problem with this and everything
 works.
 4. With sage-5.2 + "#13121 without new jmol", jmol works but one needs to
 close the worksheet and then reopen the worksheet and then the jmol pops
 up.
 5. With sage-5.2 + #13121, jmol works partially:
  1. First, the static image can not be created and there is a permission
 denied error. See [attachment:permission_error.jpg].
  2. However, once the 3D output is toggled, jmol loads fine. The
 permission denied error is still there.
  3. The error obtained is of the form
 {{{
 script ERROR: script ERROR: io error reading
 /home/user1/a.sagenb/home/__store__/0/09/098/098f/te\
 st/0/cells/7/sage0-size500-499889951.jmol.zip|SCRIPT:
 java.io.FileNotFoundException:
 /home/user1/a.sagenb/home/__store__/0/09/098/098f/te\
 st/0/cells/7/sage0-size500-499889951.jmol.zip (Permission denied)
 Sleeping...Make Interactive
 }}}
 6. When run locally, i.e., without server_pool, the jmol loads and runs
 fine. For instance, this is fine:
 {{{
 sage -n directory=a.sagenb
 }}}

 This problem has made it difficult for me to upgrade a server from 5.2 and
 I think the error is introduced by some change in jmol. The error itself
 stems from some java component. A diff of the changes between the
 directory `$SAGE_ROOT/devel/sagenb/sagenb/data/sage3d` for sage-5.2 and
 sage-5.7.rc0 has not yielded any difference. So, I believe the difference
 is really in the jmol spkg introduced in #12299.

 I have traced it back and reproduced it in sage-5.2 + new notebook + new
 jmol. Although I wrote sage-5.2 above, the error is present in all the
 sage versions I have tried - sage-5.4 till sage-5.9.beta0.

--

--
Ticket URL: <http://trac.sagemath.org/ticket/14358#comment:32>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to