Emergency help needed with dreaded "unable to acquire LMS API" error!

Emergency help needed with dreaded "unable to acquire LMS API" error!

by Rick Hollahan -
Number of replies: 6

We desperately need some help figuring out what happened to our system.

The basics - Moodle 2.2 (I think), IIS 7, PHP 5.4

The situation - everything was working fine until we needed to upload a course that exceeded the Moodle file max. We took Moodle's advice and edited the php.ini file (the one located in the content\web directory of the Moodle web site (lms.preparis.com) increasing the values of post_max_size and upload_max_filesize. Ever since we did that we suddenly now get the above error every time we launch a course. First it gives the "unable to acquire LMS API" message box...upon hitting OK you get the contents of the attached file...

Any ideas why this would suddenly start happening?  Everyone who had anything to do with building and implementing our current system is long gone and our Moodle expertise is near nil.  Any help, advice or wise counsel would be very much appreciated!

Thanks in advance...

Rick

Average of ratings: -
In reply to Rick Hollahan

Re: Emergency help needed with dreaded "unable to acquire LMS API" error!

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I'm assuming (looking at the logs) that by 'uploading a course' you actually mean 'uploading a SCORM object'. Within that in mind I'm moving this to the SCORM module forum.

In reply to Rick Hollahan

Re: Emergency help needed with dreaded "unable to acquire LMS API" error!

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Rick,
changing the php.ini file even to increase those settings should be totally unrelated with your issue. Are you sure you didn't change anything in the way you are used to publish the SCORM packages?

For example, from your logs I see that you're displaying the package in popup: in the past versions, there were issues in such a configuration. Try to display the package inline to the Moodle interface to check if that is the issue.

To detect the exact version of your Moodle instance you should go to the notification page or to open the version.php file: the version should looks like 2.2 (Build: 2011120500).

HTH,
Matteo

In reply to Matteo Scaramuccia

Re: Emergency help needed with dreaded "unable to acquire LMS API" error!

by Rick Hollahan -

Hello Matteo,

First, thank you for the reply! 

The only changes we made were to the php.ini file on the IIS server.  Please forgive our ignorance but no one here knows how to change how SCORM packages are published.  Maybe we did it inadvertently.  Would you know how that could have been done so we can research? 

Thanks for the Moodle version guidance.  I looked in the version.php file and see the following:  2.2.2+ (Build: 20120427).

What logs are you referring to?  We found the php error log on IIS, would love to know if there are other logs that we should also be looking at.  Maybe it's not a fair question but can you provide any guidance as to how we could change how the packages are displayed (point us to the right help/doc)?

I don't know if this helps but we've also noticed that suddenly other php error messages are being displayed on the Moodle admin site.  Specifically the ones like this "warning: creating default object from empty value...".  According to our research these are warnings that started with php 5.4 (which we have) but its strange that they started being displayed on the site at the same time as the LMS API issue.

In researching the LMS API issue we've seen 2 primary cause threads:

- incorrect java version (I've run the "java -version" command on the web server and it says its not recognized which implies java's not even installed).

- different domains - this one seems more applicable.  The courses are launched from portal.preparis.com but Moodle is installed on lms.preparis.com.  Of course, this is how it has always been set up and again we can't see anyway we changed anything that would have affected this.  Any ideas?

Thanks again for your help Matteo!  Rick 

In reply to Rick Hollahan

Re: Emergency help needed with dreaded "unable to acquire LMS API" error!

by ben reynolds -

My small contribution is to note that IIS has its own file size limits. Search of upload file size for info from Moodle.

I am also stuck with Moodle on IIS, which is a not recommended OS.

In reply to ben reynolds

Re: Emergency help needed with dreaded "unable to acquire LMS API" error!

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Ben,
that is true but only if the settings in your php.ini file exceed the default IIS value (30000000 bytes i.e. about 28.6MB).
In that case you need to configure maxAllowedContentLength globally via http://support.microsoft.com/kb/942074 or locally by adding a Web.config file like the one below:

<system.webServer>
<security>
     <requestFiltering>
        <requestLimits maxAllowedContentLength="524288000"/>
        </requestFiltering>
    </security>
</system.webServer>

HTH,
Matteo

In reply to Rick Hollahan

Re: Emergency help needed with dreaded "unable to acquire LMS API" error!

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Rick,
just look at the display settings in the SCORM activity, https://docs.moodle.org/22/en/SCORM_settings#Display_settings, Display package - in current or new window.

I've read about the popup setting straight from the logs inside the document you've attached in the post above:

34:Sat Mar 7 00:18:17 EST 2015 - In SCORM_ScanParentsForApi, win=https://lms.preparis.com/mod/scorm/player.php?scoid=114&cm=93&;display=popup

The strange thing is that you've several "errors" which cannot be related with a small change in the php.ini file like upload file size and even they started together even if not related...

SCORM is affected by the so called Cross-Domain Issue which is due to the actual nature of the SCORM API being based on JavaScript: you can't host your content out of the domain hosting the SCORM API i.e. you need to host the files inside the LMS from which you access the content.
That being said, again it is strange that you've falled into the cross-domain issue after changing the upload file size: what do you mean when you say that the Content is launched from domain A while the LMS is hosted in domain B?

  • Do you mean that in your domain A you've links to the SCORM activities hosted in your domain B? That is legal and it should work: users will click on links pointing to domain B, another site.
  • Do you mean that the raw files are hosted in domain A and you've published a skinny SCORM package in domain B using absolute URLs in the imsmanifest.xml file? In this case you'll fall in the Cross-Domain Issue and that is true regardless the upload size set in the php.ini file.

I'm running out of ideas.

HTH,
Matteo