General help

Invalid response value detected: url

 
Picture of Maria Gurski
Invalid response value detected: url
 

Hi, 

In a recent Moodle installation Moodle 3.3.1 (Build: 20170710) every time a student user go to his Dashboard is getting the following message:

Invalid response value detected

File:\lib\externallib.php

Line:424

 

events => Invalid response value detected: url => Invalid response value detected: Invalid external api response: the value is "http://2k12-moodle/moodle/mod/assign/view.php?id=25", the server was expecting "url" type Error code: invalidresponse * line 424 of \lib\externallib.php: invalid_response_exception thrown * line 233 of \lib\externallib.php: call to external_api::clean_returnvalue() * line 59 of \lib\ajax\service.php: call to external_api::call_external_function() events => Invalid response value detected: url => Invalid response value detected: Invalid external api response: the value is "http://2k12-moodle/moodle/mod/assign/view.php?id=25", the server was expecting "url" type Error code: invalidresponse * line 424 of \lib\externallib.php: invalid_response_exception thrown * line 233 of \lib\externallib.php: call to external_api::clean_returnvalue() * line 59 of \lib\ajax\service.php: call to external_api::call_external_function()


Thanks in advance for your help. 

 
Average of ratings: -
Picture of Maria Gurski
Re: Invalid response value detected: url
 

Also, I'm getting that error only when I add a Assignment Module Activity in any course.  


Thanks again. 

 
Average of ratings: -
Picture of Paul Holden
Re: Invalid response value detected: url
Core developersParticularly helpful MoodlersPlugin developers

Hi, 2k12-moodle is not recognised by Moodle as a valid URL hence that warning about invalid URL return type. Presumably this is caused by the presence of the dash character in the host name - this should be resolved in DNS.

 
Average of ratings: Useful (1)
Picture of Ken Task
Re: Invalid response value detected: url
Particularly helpful Moodlers

This URL ...

http://2k12-moodle/moodle/mod/assign/view.php?id=25

Looks like it's not a fully qualfied domain name ... http://2k12-moodle should have some top level domain ... like .edu, .com, .net at the end ... like http://2k12-moodle.org

That value supposedly taken from config.php file at the root of your install.

IF $CFG->wwwroot is   = 'http://2k12-moodle/moodle/';

change to:

$CFG->wwwroot   = 'http://2k12-moodle[**.yourTLD**]/moodle';

Was an assignment created using the 'shortcut' URL rather then fully qualified domain name?

'spirit of sharing', Ken

 
Average of ratings: Useful (1)
Picture of Maria Gurski
Re: Invalid response value detected: url
 

I'm not using a domain name, per se, i'm testing new version of Moodle in a non-production server, so I haven't created any domain name. Just using the raw server url. 

The thing is, I'm only having problems when I've got assignments activities on in courses. If I delete them and use any other activities, such  quizzes (as an example) the dashboard is working fine. 

Any way, I'll create a domain name and run again Moodle as you suggests. 

Thanks guys. I'll let you know the outcome. 

 
Average of ratings: -
Picture of Ken Task
Re: Invalid response value detected: url
Particularly helpful Moodlers

Once you create a valid FQDN for the server and DNS resolves it, you will have to edit config.php AND also do a admin search and replace on the DB via http://FQDN/admin/tool/replace/

Search for the error 'shortname' with http:// infront and /moodle/ at the end ... replace with the FQDN url including the /moodle/.

Assignments are one of the modules in Moodle that does a more strict check on DNS and valid URL's.

If the server doesn't need to be accessed from outside the internal private network and you are the only person evaluating, one could use the 'host' file of a workstation to associate IP address with a FQDN that's not in DNS for everyone to discover/use.   I do that often in evaluating newer versions of Moodle ... same server ... just different config for a virtual apache by another hostname ... dev.fqdn.

IF interested: https://www.howtogeek.com/howto/27350/beginner-geek-how-to-edit-your-hosts-file/

'spirit of sharing', Ken


 
Average of ratings: Useful (1)
Picture of Maria Gurski
Re: Invalid response value detected: url
 

Sorry for the late response. 

As soon I changed the domain to a FQDN and set the DNS up, the dashboard error disappear. 

Thank you for your support and help. 


Maria. 

 
Average of ratings: -