learningequality / kolibri-server

A performance-boosting access layer for Kolibri with multi-core support and improved caching
4 stars 8 forks source link

Kolibri Server change port not working as expected on RPi 4 #81

Closed metodimilevqa closed 2 years ago

metodimilevqa commented 3 years ago

Observed behavior

I tried to change the HTTP_PORT by adding....

[Deployment]
HTTP_PORT = 28

... as a last row of the options.ini file. After starting the kolibri service again I tried to access Kolibri at 10.10.10.10:28 but with no success. After running the "sudo reboot" command I accessed it at 10.10.10.10:8080 but when loading the contents of options.ini the value for HTTP_PORT is still 28. I noticed that there's one more [Development] section in the options.ini file so I again stopped the service, removed the last row I added and left only this section: IMG_20201027_145358_20201027_145533343

I started the service again and tried to access Kolibri at 10.10.10.10:28 but with no success. I ran the sudo reboot command and again I was successful to access Kolibri at 10.10.10.10:8080 but the value in options.ini was HTTP_PORT = 28 which is strange.

Expected behavior

After changing the value of HTTP_PORT in options.ini Kolibri must be accessed successfully with the new port.

User-facing consequences

Errors and logs

Steps to reproduce

  1. Stop the service from the command line - sudo service kolibri-server stop
  2. Go to the main Kolibri directory and open to edit the options.ini file
  3. Add the following as a last row: [Deployment] HTTP_PORT = 28
  4. Hit Ctrl+X and then Y to save the changes
  5. Start the Kolibri service - sudo service kolibri-server start
  6. Try to access Kolibri on a browser at 10.10.10.10:28

Context

Kolibri 0.14.3 Raspberry Pi 4 OS: Raspbian GNU, Linux 10 Chrome (latest) + Firefox (latest)

jonboiser commented 3 years ago

So was Kolibri still running on port 8080 and ignored the change to options.ini?

jonboiser commented 3 years ago

@jredrejo Should I move this to the kolibri-server repository?

jredrejo commented 3 years ago

@jonboiser I am not sure that's not the way kolibri-serveris intended to change the ports, it has to be done using dpkg-reconfigure kolibri-server because only some ports (80, 8000 & 8080) are allowed. My doubt is : if kolibri only works properly (due to the autodiscovery features) on ports 80, 8000 or 8080, should kolibri raise an error when other port is used? If not, I can make kolibri-server to work on any port and you can move it to the kolibri-server repo but if kolibri should raise an error we should leave it as a kolibri issue.

jonboiser commented 3 years ago

Yeah, those are good questions. I'm not sure, but maybe the discovery stuff does assume a whitelist of ports (80, 8000, 8080).

But if somebody doesn't care about peer discovery and just wants to expose Kolibri on port 28, then that should work too.

So is the issue you can't change ports by changing options.ini or running dpkg-reconfigure kolibri-server and we should allow that?

jredrejo commented 3 years ago

Ok, with that logic, I think that manually changing ports in options.ini should work, ,but dpkg-reconfigure kolibri-servershould give only the list of good ports, so it's in the user to decide how to handle it. Let's move this to kolilbri-server

radinamatic commented 3 years ago

that's not the way kolibri-server is intended to change the ports, it has to be done using dpkg-reconfigure kolibri-server

Maybe we should also need to expand/adjust the scenarios in this Gherkin to cover that?

jredrejo commented 2 years ago

Closed by #87