I cannot use external tool in Moodle 3.2.2. help!

Re: I cannot use external tool in Moodle 3.2.2. help!

by Ken Task -
Number of replies: 8
Picture of Particularly helpful Moodlers

This part:

"I filled only activity name, tool URL, consumer key, and secret.(This is like LTI 1.1.)"

please provide specifics ... to all of them ... the actual entries you made.

Tuner output ... one that catches my eye:

[!!] Aborted connections: 9.73%  (11/113)

Indicates there might be some issues in connectivity between the Moodle code on the web server and the DB server.   Apache error logs might also show that.

and this one:

Reduce or eliminate unclosed connections and network issues

Is the DB server on the same server as the moodle code it should be using socket connections.

'spirit of sharing', Ken

In reply to Ken Task

Re: I cannot use external tool in Moodle 3.2.2. help!

by 浅野 真之 -

> please provide specifics ... to all of them ... the actual entries you made.

I'm sorry. I tell you about them.
Activity name : LTItest
Tool URLhttp://49.212.209.129/tool.php
Consumer key : 12345
Shared secret : secret
other forms : empty or default value(I don't change default customize of moodle 3.2.2+).

Masayuki Asano.




In reply to 浅野 真之

Re: I cannot use external tool in Moodle 3.2.2. help!

by Ken Task -
Picture of Particularly helpful Moodlers

Thank you! ;)

In a test from command line to that URL and php script ... the following is returned ...

<p style="color:red">Could not establish context: <p>
<p>Base String:<br/>
<br/></p>
<pre>
Raw POST Parameters:
A lot of info about server where I tried to use it ... not disclosed here for obvious reasons.

Raw GET Parameters:

Nothing here.

So ... what is one supposed to see?

'spirit of sharing', Ken

In reply to Ken Task

Re: I cannot use external tool in Moodle 3.2.2. help!

by 浅野 真之 -

thank you for your report!
It is the response that I want.

The program is checking tool about LTI 1.1 POST values.
It made and provided IMS GLC two years ago.
Latest moodle use LTI 2.0. So, your launch might not catch normally it.


I often checked Apache error_log when you advised about it. But, There was not found new message except 'Potential coding error -
active database transaction detected during request shutdown:\n* line 105 of /course/modlib.php: call to moodle_database->start_delegated_transaction()\n* line
161 of /course/modedit.php: call to add_moduleinfo()\n, referer: http://160.16.110.61/moodle/course/modedit.php?add=lti&type=&course=2&section=0&return=0&sr=0"'...

I wander that I can add the other activity(Quiz,chat,and more...) to courses.
But,I cannot add only external tools to courses.

Would you mind to check php.ini and my.cnf of my moodle server?  

In reply to 浅野 真之

Re: I cannot use external tool in Moodle 3.2.2. help!

by Ken Task -
Picture of Particularly helpful Moodlers

Huh?   Really?  That was the response you expected?   Uhhhh .... you could have done this test yourself from command line on a Mac or Linux!

Not sure what I'd be looking for nor what to suggest for config files as guessing settings isn't a good practice.   So I'll decline the invite.

Appears you have linux ... install MySQLTuner to check DB.

Someone else has reported a similar error as yours

"transaction detected during request shutdown"

A discussion about it ... 2014 ... but that was about quiz ...

https://moodle.org/mod/forum/discuss.php?d=263351

The line reported (161) is in this bit of code:

    if (!empty($fromform->update)) {
        list($cm, $fromform) = update_moduleinfo($cm, $fromform, $course, $mfor$
    } else if (!empty($fromform->add)) {
*161        $fromform = add_moduleinfo($fromform, $course, $mform);
    } else {
        print_error('invaliddata');
    }

Google finds quite a few hits on transaction detected during request shutdown' ...

https://www.google.com/search?q=transaction+detected+during+request+shutdown&ie=utf-8&oe=utf-8

So ??????

'spirit of sharing', Ken

In reply to Ken Task

Re: I cannot use external tool in Moodle 3.2.2. help!

by 浅野 真之 -
Mr Ken


what I was NOT able to understand happened in my moodle.

As a result, My problem was resolved.
I could launch LTI formatted data from my moodle 3.2.2+ server to tool provider's server.

[What I did]

I added the code into course/modlib.php (106~108).
<the code>

if(!isset($transaction)){

                echo "<script>alert('invalid_error!');</script>";

    }

Why did my moodle moved by the code to alert???

In reply to 浅野 真之

Re: I cannot use external tool in Moodle 3.2.2. help!

by Ken Task -
Picture of Particularly helpful Moodlers

Not sure I understand the question, but suggest if you think it's a bug please report it in tracker.

https://tracker.moodle.org/secure/Dashboard.jspa

When you do, you'll have to provide steps for someone to be able to replicate the problem so you'll have to disclose info ... other wise, no one who is a true programmer can test.

Am not a coder.

'spirit of sharing', Ken

In reply to Ken Task

Re: I cannot use external tool in Moodle 3.2.2. help!

by 浅野 真之 -

Mr.Ken

I cannot judge whether these error is bug or not. And. The problem doesn't resolve essentially.Because, It was unstable to add LTI tool.(My check was not enough...sorry.)

But, I report Moodle Tracker these phenomenon. Because, honestly speaking, I think that my skill and knowledge about moodle is not enough to resolve the problem. I can only report that There is the problem.

But, at least, I could add LTI tool. This is the fact. I cannot thank you enough for this.

Thank you!

masayuki asano