I ran into the same issue with
/webwork2/instructorXMLHandler: Forbidden
being reported when trying to use the library browser in a running Docker container available with a real hostname, but no such problem when using the same WW code on Docker on my laptop via "localhost".
The Docker container had the hostname set in Dockerfile via an environment variable like this:
WEBWORK_ROOT_URL=https://myhostname.mydomain
In this case, when using the selector boxes in the library browser the
browser would give an error:
/webwork2/instructorXMLHandler: Forbidden
There were error messages in /var/log/apache2/error.log similar to what
appears below.
The error messages show that there were "routing" problems between the "server" and the target network address. The other (non-Docker) problems of this nature may also be related to similar issues, in which case editing /etc/hosts on the server may help fix them.
Adding a "hostname" line to the "app:" block of docker-compose.yml
hostname: myhostname.mydomain
solved this problem.
Explanation: The WW server inside the docker container is trying to connect to itself on its public web address, but without the "hostname" set in docker-compose.yml it does not know how to connect to that host.
An alternative solution would be to map the FQDN used to the external IP address using "extra_hosts" in docker-compose.yml, but that would needlessly route the traffic out of the docker framework and then back in. (I did not test if it works.)
In the long run, it may make sense to instead use "alias" and set up a network configuration in the docker-compose.yml by hand, as an alias can be shared by multiple "replicas".
See:
See the sections "domainname, hostname" (start of section name) and "ALIASES"
Note: A network-wide alias can be shared by multiple containers
=====================
From: /var/log/apache2/error.log
=====================
There were a lot of errors
Errors:
500 Can't connect to myhostname.mydomain:443 at /opt/webwork/webwork2/lib/WebworkClient.pm line 292.
End Errors
xmlrpcCall to listSetProblems returned no result for
[Mon Nov 19 20:22:36.111578 2018] [perl:error] [pid 1299] [client 213.57.108.112:1952] [/webwork2/instructorXMLHandler] xmlrpcCall to listSe
tProblems returned no result for \n * in WeBWorK::ContentGenerator::instructorXMLHandler::content called at line 233 of /opt/webwork/webwork
2/lib/WeBWorK/ContentGenerator.pm\n * in WeBWorK::ContentGenerator::go called at line 384 of /opt/webwork/webwork2/lib/WeBWorK.pm, referer:
https://myhostname.mydomain/webwork2/test_001/instructor/setmaker/?user=USERNAME&key=SECRET_KEY&effectiveUser=USERNAME
=====================
There were a lot of errors
Errors:
500 Can't connect to myhostname.mydomain:443 at /opt/webwork/webwork2/lib/WebworkClient.pm line 292.
End Errors
xmlrpcCall to searchLib returned no result for
[Wed Nov 21 15:54:26.079333 2018] [perl:error] [pid 1515] [client 132.68.115.60:54758] [/webwork2/instructorXMLHandler] xmlrpcCall to search
Lib returned no result for \n * in WeBWorK::ContentGenerator::instructorXMLHandler::content called at line 233 of /opt/webwork/webwork2/lib/
WeBWorK/ContentGenerator.pm\n * in WeBWorK::ContentGenerator::go called at line 384 of /opt/webwork/webwork2/lib/WeBWorK.pm, referer: http:/
/myhostname.mydomain/webwork2/test_001/instructor/setmaker/?user=USERNAME&effectiveUser=USERNAME&key=SECRET_KEY