Forum LAMS for Tech-Heads - General Forum: Re: Re: Re: Re: Re: Re: Re: Re: Error adding lams lesson activity in Moodle


 
Search: 

12: Re: Re: Re: Re: Re: Re: Re: Re: Error adding lams lesson activity in Moodle
In response to 10 09/22/08 03:40 AM
[ Reply | Forward ]
This error is just a result of Moodle using a lesson id of 0, which isn't valid.

I do remember a problem similar to this where the lamstwo module was installed with an error - basically MySQL was in strict mode, and the mdl_lamstwo table failed to get created. This resulted in Moodle always using a lesson_id of 0. Can you check if this is the case?

Failing that, can you have a look at the lams access log - there should be records of Moodle's request to the LearningDesignRepository servlet (GET request) and the LessonManager service (SOAP request). Check the return codes of these requests to see if they returned successfully. Also, you can copy the LearningDesignRepository GET request and paste it into your browser, and you should get some XML representing the sequence info.

Posted by Jun-Dir Liew

13: Re: Re: Re: Re: Re: Re: Re: Re: Re: Error adding lams lesson activity in Moodle
In response to 12 04/14/09 11:20 AM
[ Reply | Forward ]
Still getting this error, when clicking create sequence.

One user is getting this error. I can't reproduce the problem, even logging in as the particular user.

206.192.23.64 - - [14/Apr/2009:08:22:25 -0500] "GET /lams/services/LearningDesig
nRepositoryService?wsdl HTTP/1.1" 200 2836
206.192.23.64 - - [14/Apr/2009:08:22:45 -0500] "POST /lams/services/LearningDesi
gnRepositoryService HTTP/1.0" 200 42234
66.152.251.44 - mdl_ckelley [14/Apr/2009:08:22:49 -0500] "GET /lams/LoginRequest
?uid=ckelley&method=author&ts=April+14%2C2009+8%3A22+am&sid=moodle&hash=078f54bd
77556d2e0abf765ce9e5d8a9748f54df&courseid=29&country=US&lang=en&requestSrc=CCC%2
0Online%20Learning¬ifyCloseURL=http%3A//ctcconline.org/course/mod.php%3Fid%3D
29%26section%3D5%26sesskey%3DXz4UYy1itE%26add%3Dlamstwo HTTP/1.1" 302 -
66.152.251.44 - mdl_ckelley [14/Apr/2009:08:22:49 -0500] "GET /lams/home.do?meth
od=author&requestSrc=CCC+Online+Learning¬ifyCloseURL=http%3A%2F%2Fctcconline.
org%2Fcourse%2Fmod.php%3Fid%3D29%26section%3D5%26sesskey%3DXz4UYy1itE%26add%3Dla
mstwo HTTP/1.1" 200 2081

Those are the HTTP requests that I can find in the access logs. There isn't any XML I can see, what log file should I be looking in? This is the localhost_access_log

Posted by Dave Bauer

14: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Error adding lams lesson activity in Moodle
In response to 13 04/14/09 11:22 AM
[ Reply | Forward ]
I also can't find anything in the server.log that corresponds to the time of those requests in the access log.

Posted by Dave Bauer

15: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Error adding lams lesson activity in Moodle
In response to 14 04/14/09 11:48 AM
[ Reply | Forward ]
Ok, restarting LAMS seems ot have worked. Must be some sort of out-of-memory error that doesn't get written to the logs. Very strange.

Posted by Dave Bauer

16: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Error adding lams lesson activity in Moodle
In response to 15 04/15/09 06:02 PM
[ Reply | Forward ]
anything on the lams.log?

Posted by Ernie Ghiglione

17: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Error adding lams lesson activity in Moodle
In response to 16 04/15/09 07:58 PM
[ Reply | Forward ]
Just the lesson_id 0 errors but nothing to really indicate what was actually causing the error in the first place. Usually I think that occurs because of a timout in Moodle connecting to get the lesson information.

Posted by Dave Bauer

18: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Error adding lams lesson activity in Moodle
In response to 17 04/17/09 03:06 AM
[ Reply | Forward ]
We fixed a timeout problem with lesson creation recently - there's an updated version of the lamstwo module.

http://wiki.lamsfoundation.org/display/lamsdocs/Moodle#Moodle-LatestChanges

Posted by Jun-Dir Liew

19: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Error adding lams lesson activity in Moodle
In response to 18 02/06/10 04:44 PM
[ Reply | Forward ]
Hi,

Few months ago I got the same problem and fixed it by following your changes in /lamstwo/lib.php file.

Recently, I have created much longer lesson in LAMS and tried to added to Moodle as a lesson but I got the same error. Obviously, I can add short lessons but not this long one.

Can you suggest me any way to do this please.

Thank you,
Muesser (University of Greenwich)

Posted by Muesser Cemal Nat

20: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Error adding lams lesson activity in Moodle
In response to 19 02/08/10 01:26 AM
[ Reply | Forward ]
Hi Muesser,

I guess you're referring to the fix in here, http://bugs.lamsfoundation.org/browse/LDEV-2086? That should have addressed the timeout issue, unless the default in soap library of the Moodle version you're using has somehow changed.

Are there any errors in the lams logs? What does the error text in Moodle say? Is the lesson created on the LAMS side? You can check that last one by logging in as the user in LAMS (hint: first login as sysadmin in LAMS then use 'find user' to find their account and login as them).

Posted by Jun-Dir Liew

21: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Error adding lams lesson activity in Moodle
In response to 20 02/09/10 11:38 AM
[ Reply | Forward ]
Hi,

Thank you for your quick response.

Error on Moodle side: lamstwo_get_lesson: HTTP Error: socket read of headers timed out

Error in LAMS log: 2010-02-09 17:15:14,200 [http-0.0.0.0-8080-2:] ERROR org.lamsfoundation.lams.tool.mc.service.McServicePOJO - mcSession does not exist yet: 1527

I am admin and I created the lesson in LAMS.

In fact this is exactly the same error that I got before this fix (http://bugs.lamsfoundation.org/browse/LDEV-2086?).

Moddle's verison is 1.9.4+ and nusoap.php has the following code regarding conection timeout(has not been changed!):

function connect($connection_timeout=0,$response_timeout=30){
// For PHP 4.3 with OpenSSL, change https scheme to ssl, then treat like
// "regular" socket.
// TODO: disabled for now because OpenSSL must be *compiled* in (not just
// loaded), and until PHP5 stream_get_wrappers is not available.
// if ($this->scheme == 'https') {
// if (version_compare(phpversion(), '4.3.0') >= 0) {
// if (extension_loaded('openssl')) {
// $this->scheme = 'ssl';
// $this->debug('Using SSL over OpenSSL');
// }
// }
// }

Posted by Muesser Cemal Nat

22: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Error adding lams lesson activity in Moodle
In response to 21 02/09/10 06:07 PM
[ Reply | Forward ]
Perhaps we need to increase the 30 second response timeout as a workaround. In moodle/mod/lamstwo/lib.php, can you add two arguments to the soap_client constructor?

In the function 'lamstwo_get_soap_client', make the line that says

$s = new soap_client($wsdl,true,false,false,false,false);

into

$s = new soap_client($wsdl,true,false,false,false,false,0,0);

and we'll see if setting the response timeout to unlimited (0) works for you.

Thanks,

Posted by Jun-Dir Liew

23: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Error adding lams lesson activity in Moodle
In response to 22 02/10/10 09:52 AM
[ Reply | Forward ]
As suggested in the latest fix (http://bugs.lamsfoundation.org/browse/LDEV-2086?) I was changed the following line;

$s = new soap_client($wsdl,true,false,false,false,false,3,3);

to

$s = new soap_client($wsdl,true,false,false,false,false,5,5); based on the fix.

But now I removed numbers and made it;
$s = new soap_client($wsdl,true,false,false,false,false);

and it works now :)

Thank you very much,

Posted by Muesser Cemal Nat

24: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Error adding lams lesson activity in Moodle
In response to 22 03/10/10 06:23 AM
[ Reply | Forward ]
Hi,

it's me again and I am having the same problem. Because this time my lesson's size is bigger.

I tried all possibilities above but none of them worked :(

Can you suggest me any other solution? Or if you know can I add it manually?

Thank you,
Muesser

Posted by Muesser Cemal Nat

25: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Error adding lams lesson activity in Moodle
In response to 24 03/10/10 06:08 PM
[ Reply | Forward ]
Try increasing the value for 'default_socket_timeout' in your php.ini. There is another call using the PHP function file_get_contents when you add a lesson, which calls a LAMS URL - but it isn't a soap call like the add lesson call itself.

Posted by Jun-Dir Liew

26: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Error adding lams lesson activity in Moodle
In response to 25 03/11/10 10:41 AM
[ Reply | Forward ]
Hi,

Thanks for your reply.

I solved the problem by increasing the timeout and response_timeout values in nusoap.php.

Regards,
Muesser

Posted by Muesser Cemal Nat

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