sugarlabs / sugar

Sugar GTK shell
GNU General Public License v3.0
252 stars 240 forks source link

502 Bad Gateway - When trying to view an activity help page #931

Open shaansubbaiah opened 3 years ago

shaansubbaiah commented 3 years ago

Tested on:

  1. Sugar Live Build 0.117 (Buster/10) - VMWare Workstation
  2. Debian Bullseye/11 0.117-3 - KVM

Reproduce:

  1. altshiftH in an Activity
  2. F3 in an Activity to go to Home View -> Right click the icon under the XO -> Click View Help

If possible, please test on OLPC hardware/ native installs of Sugar to make sure its not a VM issue.

Screenshot: image

chimosky commented 3 years ago

Haven't been able to do much investigation but this also appears in the logs,

1597621834.410915 ERROR root: set_active() failed: org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
quozl commented 3 years ago

@shaansubbaiah, thanks, interesting.

@chimosky, NoReply on _setactive is https://github.com/sugarlabs/sugar/issues/840. Get used to it, nobody is interested in fixing Telepathy or even telling them about it. :grin:

shaansubbaiah commented 3 years ago

Installing the Help activity from the master branch still results in this issue. (Sugar Live Build 0.117)

Opening the activity, I am presented with this: image

Following the workflow above, I still get the 502 - Bad Gateway issue

index.html is missing, checked the directory. Have to investigate further.

quozl commented 3 years ago

Unlike other activities, the Help activity can't be installed from the repository, it has to be built. Clone it to somewhere other than ~/Activities, install python-sphinx, make html, python setup.py dist_xo, then install the bundle.

shaansubbaiah commented 3 years ago

@quozl that worked, I am now able to view the help pages for the activities. However, none of the images load while viewing the documentation from within the help activity but load when viewed from another activity/using the shortcut/ xo menu.

eg. Viewing the help page for Browse in the Help activity. image

shaansubbaiah commented 3 years ago

Seems like the image loading failure has already been reported in Help Activity #104

I can access the images through the browser using file:///usr/share/sugar/activities/Help.activity/html/images/.png

Changing the image uris in the html files from _images/<image-name>.jpg to ../images/<image-name>.jpg renders the image correctly, but it is not an appropriate fix.


Regarding the issue in Sugar, would it not be better to display some form of 'Help activity is not installed' with or without the 502 Error?

shaansubbaiah commented 3 years ago

@quozl, right now,

  1. make html copies images/ to html/_images/
  2. setup dist_xo creates an XO bundle omitting html/_images/. (images are in images/)
  3. In _resource_load_started_cb(), tries to replace 'html/_images' with 'images' in the request uri but it seems to have no effect. I haven't found a way to redirect the request uri.

One way that I've managed to fix it is by preventing setup dist_xo from omitting html/_images. images/ can then be omitted in the bundle (otherwise bundle is 2x big). Then, even the function _resource_load_started_cb() can be removed.

The only difference is that images will be in html/_images instead of images/ after installing.

quozl commented 3 years ago

Thanks. I agree. Summarising;