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


 
Search: 

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