Forum LAMS for Tech-Heads - General Forum: Re: Re: LAMS and Moodle 2.0


 
Search: 

20: Re: Re: LAMS and Moodle 2.0
In response to 19 05/04/11 04:37 AM
[ Reply | Forward ]
Greetings,

I want to introduce myself to this forum; I am a Science/Math teacher at a local secondary school. Having worked with Moodle 2.0 for a while, I am exploring LAMS to incorporate some exciting new designs to complement my current moodle lessons.
Needless to say that I am new with LAMS-Moodle(2.0) integration; and I would appreciate your assistance in getting the integration to work. Oh, I know that this integration is currently being worked on and, I have already done some exploring of the site provided by Ernie Ghiglione (thanks Ernie!).

In a nutshell, I am unable to validate the connectivity for integration while setting up the LAMS module; or start adding a LAMS lesson to a Moodle course. Please note that it is important for me to have seperate Moodle and LMS servers in order to meet organizational requirements.

Although this is a 'tech' forum, please forgive me for the detail of information provided. For future reference let me know if there was a way for me to have included such details seperately; even though I tried to put the following logs in the "Attach ?" part of this post.

My testing LAN setup has 2 virtualbox instances one for Moodle 2.0 and one for LAMS.
1. Moodle 2.0 on a recent release of Ubuntu for my moodle instance. (fatiedu.sma)
2. LAMS 2.3.4 and openfire installed using provided binary deb packages, on a different host but same release of Ubuntu (lamsedu.sma).
3. Both of the above virtual servers are on a virtualbox-internal network I have not installed firewall for this LAN interface.

Here are the open ports on fatiedu.sma (Moodle 2.0) and lamsedu.sma (LAMS/Openfire) respectively
root@fatiedu:~# nmap -v -sT 192.168.0.0/24
Starting Nmap 5.21 ( http://nmap.org ) at 2011-05-04 13:31 GST
Initiating ARP Ping Scan at 13:31

... removed entries for non-existent host ips on the network 192.168.0.0/24

Initiating Connect Scan at 13:31
Scanning 192.168.0.16 [1000 ports]
Discovered open port 8080/tcp on 192.168.0.16
Discovered open port 22/tcp on 192.168.0.16
Completed Connect Scan at 13:31, 0.26s elapsed (1000 total ports)
Nmap scan report for 192.168.0.16
Host is up (0.0048s latency).
Not shown: 998 closed ports
PORT    STATE SERVICE
22/tcp  open  ssh
8080/tcp open  http-proxy

... removed entries for non-existent host ips on the network 192.168.0.0/24

Completed Connect Scan at 13:31, 1.22s elapsed (1000 total ports)
Nmap scan report for lamsedu.sma (192.168.0.26)
Host is up (0.0017s latency).
Not shown: 984 closed ports
PORT    STATE SERVICE
22/tcp  open  ssh
1098/tcp open  unknown
1099/tcp open  unknown
4444/tcp open  krb524
4445/tcp open  unknown
5222/tcp open  unknown
5269/tcp open  unknown
7070/tcp open  realserver
7443/tcp open  unknown
7777/tcp open  unknown
8009/tcp open  ajp13
8080/tcp open  http-proxy
8083/tcp open  unknown
8093/tcp open  unknown
9090/tcp open  zeus-admin
9091/tcp open  unknown
..

Here are the integration entries as shown the mysql database on fatiedu.sma (Moodle 2.0) and lamsedu.sma (LAMS/Openfire) respectively

mysql> SELECT * FROM `moodle`.`mdl_config` WHERE ( `id` LIKE '%lamslesson%' OR `name` LIKE '%lamslesson%' OR `value` LIKE '%lamslesson%' );
+-----+--------------------------+-------------------------------+
| id  | name                    | value                        |
+-----+--------------------------+-------------------------------+
| 584 | lamslesson_serverurl    | http://lamsedu.sma:8080/lams/ |
| 585 | lamslesson_serverid      | Moodle                        |
| 586 | lamslesson_serverkey    | Moodle                        |
| 587 | lamslesson_requestsource | Moodle                        |
+-----+--------------------------+-------------------------------+
4 rows in set (0.01 sec)

mysql> use lams;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> use lams;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select * from lams_ext_server_org_map;
+-----+----------+-----------+------------+------------+--------+---------------------------------------------------------------------------------------------------+---------------------------------+-------------------------------+----------+-------+
| sid | serverid | serverkey | servername | serverdesc | prefix | userinfo_url                                                                                      | server_url                      | timeout_url                  | disabled | orgid |
+-----+----------+-----------+------------+------------+--------+---------------------------------------------------------------------------------------------------+---------------------------------+-------------------------------+----------+-------+
|  1 | Moodle  | Moodle    | Moodle    | Moodle    | mdl    | http://fatiedu.sma:8080/moodle/mod/lamslesson/userinfo.php?ts=%timestamp%&un=%username%&hs=%hash% | http://fatiedu.sma:8080/moodle/ | http://lamsedu.sma:8080/lams/ |          |    7 |
+-----+----------+-----------+------------+------------+--------+---------------------------------------------------------------------------------------------------+---------------------------------+-------------------------------+----------+-------+
1 row in set (0.00 sec)

Excerpt of lamsedu.sma:/usr/share/jboss-4.0.2/server/default/log/lams.log
....
2011-05-04 13:55:39,230 [http-0.0.0.0-8080-8:] DEBUG org.lamsfoundation.lams.webservice.xml.LearningDesignRepositoryServlet - request.getCharacterEncoding is empty, parsing username and courseName as 8859_1 to UTF-8...
2011-05-04 13:55:39,242 [http-0.0.0.0-8080-8:] DEBUG org.lamsfoundation.lams.integration.service.IntegrationService - http://fatiedu.sma:8080/moodle/mod/lamslesson/userinfo.php?ts=1304502939242&un=fatiedu&hs=41f2f8eed0b37f802af6e3b4709dd24623483661
2011-05-04 13:55:39,248 [http-0.0.0.0-8080-8:] ERROR org.lamsfoundation.lams.webservice.xml.LearningDesignRepositoryServlet - can not retreive user information
org.lamsfoundation.lams.integration.UserInfoFetchException: Fail to fetch user data from external server:Moodle - Unexpected return HTTP Status:404
    at org.lamsfoundation.lams.integration.service.IntegrationService.getUserDataFromExtServer(IntegrationService.java:336)
    at org.lamsfoundation.lams.integration.service.IntegrationService.createExtUserUseridMap(IntegrationService.java:298)
    at org.lamsfoundation.lams.integration.service.IntegrationService.getExtUserUseridMap(IntegrationService.java:169)
    at org.lamsfoundation.lams.integration.service.IntegrationService$$FastClassByCGLIB$$24924e31.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)


Excerpt of fatiedu.sma:/var/log/apache2/error.log
[Wed May 04 13:55:39 2011] [error] [client 192.168.56.1] Default exception handler: Call to LAMS failed: received an HTTP status of 400 Bad Request. Please check the configurations settings and/or contact your system administrator. Debug: \n* line 429 of /lib/setuplib.php: moodle_exception thrown\n* line 307 of /mod/lamslesson/lib.php: call to print_error()\n* line 152 of /mod/lamslesson/mod_form.php: call to lamslesson_get_sequences_rest()\n* line 152 of /lib/formslib.php: call to mod_lamslesson_mod_form->definition()\n* line 71 of /course/moodleform_mod.php: call to moodleform->moodleform()\n* line 219 of /course/modedit.php: call to moodleform_mod->moodleform_mod()\n, referer: http://fatiedu.sma:8080/moodle/course/view.php?id=7

Posted by Afroze Fatima Abidi

Attachments:
21: Re: Re: Re: LAMS and Moodle 2.0
In response to 20 05/05/11 11:05 PM
[ Reply | Forward ]
Hi Afroze,

Sorry for this late reply...

You can see that both LAMS and Moodle can "see" each other. However, when LAMS is trying to get the user info from your server, it's getting a 404:


org.lamsfoundation.lams.integration.UserInfoFetchException: Fail to fetch user data from external server:Moodle - Unexpected return HTTP Status:404

The issue here is the User Information URL you have set up (most likely).

So you can follow how we have set this up in our server, here's the URL we use for our demo server:


http://moodle.lamscommunity.org/moodle2/mod/lamslesson/userinfo.php?ts=%timestamp%&un=%username%&hs=%hash%

See pic:

Is your Moodle server running on port 8080?

Thanks,

Ernie

Posted by Ernie Ghiglione

22: Re: Re: Re: Re: LAMS and Moodle 2.0
In response to 21 05/06/11 04:45 AM
[ Reply | Forward ]
Hi Ernie, Thanks for your response, your assistance is appreciated.

1. My LAMS setup for integrations is identical (besides the server and moodle2 part) to the link you have in the dem0 -
http://fatiedu.sma:8080/moodle/mod/lamslesson/userinfo.php?ts=%timestamp%&un=%username%&hs=%hash%
http://moodle.lamscommunity.org/moodle2/mod/lamslesson/userinfo.php?ts=%timestamp%&un=%username%&hs=%hash%

2. I am required to put moodle and lams on seperate server virtual/ip for keeping the server, database etc. isolated. Can you confirm that your demo has moodle and lms on seperate server/ip instances as well. Please note that my setup works fine 'if and when' I put both moodle and lams on the same server/ip.

3. I have made sure to remove .htaccess from moodle web/date folders, ports 8080 are open on both servers and there is no firewall on this 192.168.0/ network

4. tail -f /usr/share/jboss-4.0.2/server/default/log/localhost_access_log.2011-05-06.log
192.168.0.26 - - [06/May/2011:13:47:56 +0400] "GET /moodle/mod/lamslesson/userinfo.php?ts=1304675276943&un=fatiedu&hs=ceb3a00f660d23572d179243b0754089c520062b HTTP/1.1" 404 1055
192.168.0.16 - - [06/May/2011:13:47:56 +0400] "GET /lams//services/xml/LearningDesignRepository?serverId=moodle&datetime=May+06%2C2011+1%3A47+pm&hashValue=efe9794c684ff696037558b2854d305de058d864&username=fatiedu&courseId=7&courseName=Unit-5+Atomic+Physics+12%2F2010&mode=2&country=AE&lang=en HTTP/1.0" 400 1068
Note 192.168.0.16 (fatiedu.sma) is Moodle server; and 192.168.0.16 (lamsedu.sma) is LAMS server
Interestingly the first 'GET' log has valid URL, and I get valid data back appending it to moodle; however when I do the same for second 'GET' to LMS it resluts in the following error -- (how did you attach the graphics, well, here is the text)
HTTP Status 400 - can not retreive user information
type Status report
message can not retreive user information
description The request sent by the client was syntactically incorrect (can not retreive user information).
Apache Tomcat/5.5.9

Let me know if you have any suggestions, and thanks again for your help. I will put the moodle and lms on the same server in the meantime to get it going for prototyping my lesson plans.

I am impressed with LMS have big plans to use it in my lesson designs. I intend to get familiar with LMS pretty fast and will pitch in with assisting on your project as well.

Regards,

Posted by Afroze Fatima Abidi

23: Re: Re: Re: Re: Re: LAMS and Moodle 2.0
In response to 22 05/06/11 08:26 AM
[ Reply | Forward ]
Hi Afroze,


1. My LAMS setup for integrations is identical (besides the server and moodle2 part) to the link you have in the dem0 -
http://fatiedu.sma:8080/moodle/mod/lamslesson/userinfo.php?ts=%timestamp%&un=%username%&hs=%hash%

Hmmm... so you are running your moodle server on port 8080?


2. I am required to put moodle and lams on seperate server virtual/ip for keeping the server, database etc. isolated.

No, your are not. You can keep them in separate boxes, IPs and even countries if you like. The only thing, of course, is that both servers should be able to make ports (in and out) on their respective ports.

So if you are running moodle on port 80, then your LAMS server should be allowed to make outgoing calls on port 80. And if LAMS runs on port 8080, then your Moodle server should be allowed to call out on that port.


3. I have made sure to remove .htaccess from moodle web/date folders, ports 8080 are open on both servers and there is no firewall on this 192.168.0/ network

I don't think this is a network issue as you are getting a response... either a 404 or a 400, but a response.


192.168.0.26 - - [06/May/2011:13:47:56 +0400] "GET /moodle/mod/lamslesson/userinfo.php?ts=1304675276943&un=fatiedu&hs=ceb3a00f660d23572d179243b0754089c520062b HTTP/1.1" 404 1055

Ok, so this call is made from LAMS to Moodle to retrieve the user's information. Moodle is returning a 404? So maybe this page does not exist? Can you confirm that the path for your moodle server is correct?


Interestingly the first 'GET' log has valid URL, and I get valid data back appending it to moodle

Are you saying that Moodle is indeed returning the user info?


however when I do the same for second 'GET' to LMS it resluts in the following error -- (how did you attach the graphics, well, here is the text)
HTTP Status 400 - can not retreive user information
type Status report
message can not retreive user information
description The request sent by the client was syntactically incorrect (can not retreive user information).
Apache Tomcat/5.5.9

RIght, so it's when Moodle is requesting data from LAMS that you are getting the error.


/lams//services/xml/LearningDesignRepository?serverId=moodle&datetime=May+06%2C2011+1%3A47+pm&hashValue=efe9794c684ff696037558b2854d305de058d864&username=fatiedu&courseId=7&courseName=Unit-5+Atomic+Physics+12%2F2010&mode=2&country=AE

I think there are parameter missing. Let me double check with the integration specs to see why this is happening. I'll get back to you shortly.

Thanks,

Ernie

Posted by Ernie Ghiglione

24: Re: Re: Re: Re: Re: Re: LAMS and Moodle 2.0
In response to 23 05/06/11 12:59 PM
[ Reply | Forward ]
Hi Ernie;

Thanks for your response,

I looked at the 'integration specs'

"Every time a LMS user attempts to access LAMS, LAMS will check to see if the user exists in its database. If the user has not been created in LAMS, LAMS will make a call to the external application to retrieve user information and create the user on the fly. Therefore you will need to set up a user information servlet on the LMS side that will return user information to LAMS"

OK, so a corresponding user will need to be created in LAMS, may be on a fly by an 'information servlet'. I am not sure if I have to set up that or if it is a part of integration that is already in place.

I am attaching some details/observations along with lams.log on this.

Thanks for your help. Let me know if I can do more chasing into this.

Regards,

Posted by Afroze Fatima Abidi

Attachments:
25: Re: Re: Re: Re: Re: Re: Re: LAMS and Moodle 2.0
In response to 24 05/06/11 09:28 PM
[ Reply | Forward ]
Hi Afroze,

I think the error is here:


2011-05-06 22:36:32,901 [http-0.0.0.0-8080-4:] DEBUG org.lamsfoundation.lams.integration.service.IntegrationService - http://fatiedu.sma:8080/moodle/mod/lamslesson/userinfo.php?ts=1304706992900&un=fatiedu&hs=28dd88676daf61419cba19b8b535238a02306a37
2011-05-06 22:36:32,909 [http-0.0.0.0-8080-4:] ERROR org.lamsfoundation.lams.webservice.xml.LearningDesignRepositoryServlet - can not retreive user information
org.lamsfoundation.lams.integration.UserInfoFetchException: Fail to fetch user data from external server:moodle - Unexpected return HTTP Status:404

For some reason when LAMS is calling Moodle to get the user's details, it's getting a 404.

You mentioned before that if you call the URL (http://fatiedu.sma:8080/moodle/mod/lamslesson/userinfo.php?ts=1304706992900&un=fatiedu&hs=28dd88676daf61419cba19b8b535238a02306a37) from your browser you are getting the user data... is this correct?

If so, then are you using a proxy in your network?

Thanks,

Ernie

Posted by Ernie Ghiglione

26: Re: Re: Re: Re: Re: Re: Re: Re: LAMS and Moodle 2.0
In response to 25 05/08/11 12:28 AM
[ Reply | Forward ]
Hi Ernie;

I should have used nslookup or host commands instead of ping to confirm network connectivity . There was a problem with reverse lookup between the moodle and lams hosts.

Installed dnsmasq, reworked /etc/hosts, cleaned caches, used nslookup and dig to confirm connectivity -- problem resolved. I am starting to work on my lesson prototypes as I post this message.

Appreciate your help and thanks for pointing me in the right direction.

Regards,

Posted by Afroze Fatima Abidi

27: Re: LAMS and Moodle 2.0
In response to 26 05/08/11 12:54 AM
[ Reply | Forward ]
Great! Glad it's all working. Would love to hear if you have any feedback to improve this.

Thanks,

Ernie

Posted by Ernie Ghiglione

Reply to first post on this page
Back to LAMS for Tech-Heads - General Forum