cannod / moodle-drupalservices

Moodle plugin to connect to Drupal services
36 stars 25 forks source link

Fail : muser/Index: The muser resource is not available in the drupal service endpoint #37

Closed Jhereck closed 9 years ago

Jhereck commented 9 years ago

Hello.

I tried to follow the installation instructions on the wiki, drupal side and moddle side (drupal and moodle modules up to date) on a local apache server, and got the "Fail : muser/Index: The muser resource is not available in the drupal service endpoint" error after hours of debugging.....

The messages are the followings :

Success : cookies: SSO Cookie discovered properly Success : system/connect: User session data reachable and you are logged in! Success : user/login: Logged in to drupal! Fail : muser/Index: The muser resource is not available in the drupal service endpoint.

And my "Services" export (checked all of the ressources to avoid errors/problems) :

$endpoint = new stdClass(); $endpoint->disabled = FALSE; /* Edit this to true to make a default endpoint disabled initially */ $endpoint->api_version = 3; $endpoint->name = 'moodlesso'; $endpoint->server = 'rest_server'; $endpoint->path = 'moodlesso'; $endpoint->authentication = array( 'services' => 'services', ); $endpoint->server_settings = array( 'formatters' => array( 'json' => TRUE, 'xml' => TRUE, 'bencode' => FALSE, 'jsonp' => FALSE, 'php' => FALSE, ), 'parsers' => array( 'application/json' => TRUE, 'application/x-www-form-urlencoded' => TRUE, 'text/xml' => TRUE, 'application/vnd.php.serialized' => FALSE, 'application/xml' => FALSE, 'multipart/form-data' => FALSE, ), ); $endpoint->resources = array( 'comment' => array( 'operations' => array( 'create' => array( 'enabled' => '1', ), 'retrieve' => array( 'enabled' => '1', ), 'update' => array( 'enabled' => '1', ), 'delete' => array( 'enabled' => '1', ), 'index' => array( 'enabled' => '1', ), ), 'actions' => array( 'countAll' => array( 'enabled' => '1', ), 'countNew' => array( 'enabled' => '1', ), ), ), 'file' => array( 'operations' => array( 'create' => array( 'enabled' => '1', ), 'retrieve' => array( 'enabled' => '1', ), 'delete' => array( 'enabled' => '1', ), 'index' => array( 'enabled' => '1', ), ), 'actions' => array( 'create_raw' => array( 'enabled' => '1', ), ), ), 'moodlesso' => array( 'operations' => array( 'index' => array( 'enabled' => '1', ), ), ), 'node' => array( 'operations' => array( 'retrieve' => array( 'enabled' => '1', ), 'create' => array( 'enabled' => '1', ), 'update' => array( 'enabled' => '1', ), 'delete' => array( 'enabled' => '1', ), 'index' => array( 'enabled' => '1', ), ), 'relationships' => array( 'files' => array( 'enabled' => '1', ), 'comments' => array( 'enabled' => '1', ), ), 'targeted_actions' => array( 'attach_file' => array( 'enabled' => '1', ), ), ), 'system' => array( 'actions' => array( 'connect' => array( 'enabled' => '1', ), 'get_variable' => array( 'enabled' => '1', ), 'set_variable' => array( 'enabled' => '1', ), 'del_variable' => array( 'enabled' => '1', ), ), ), 'taxonomy_term' => array( 'operations' => array( 'retrieve' => array( 'enabled' => '1', ), 'create' => array( 'enabled' => '1', ), 'update' => array( 'enabled' => '1', ), 'delete' => array( 'enabled' => '1', ), 'index' => array( 'enabled' => '1', ), ), 'actions' => array( 'selectNodes' => array( 'enabled' => '1', ), ), ), 'taxonomy_vocabulary' => array( 'operations' => array( 'retrieve' => array( 'enabled' => '1', ), 'create' => array( 'enabled' => '1', ), 'update' => array( 'enabled' => '1', ), 'delete' => array( 'enabled' => '1', ), 'index' => array( 'enabled' => '1', ), ), 'actions' => array( 'getTree' => array( 'enabled' => '1', ), ), ), 'user' => array( 'operations' => array( 'retrieve' => array( 'enabled' => '1', ), 'create' => array( 'enabled' => '1', ), 'update' => array( 'enabled' => '1', ), 'delete' => array( 'enabled' => '1', ), 'index' => array( 'enabled' => '1', ), ), 'actions' => array( 'login' => array( 'enabled' => '1', ), 'logout' => array( 'enabled' => '1', ), 'token' => array( 'enabled' => '1', ), 'request_new_password' => array( 'enabled' => '1', ), 'register' => array( 'enabled' => '1', ), ), 'targeted_actions' => array( 'cancel' => array( 'enabled' => '1', ), 'password_reset' => array( 'enabled' => '1', ), 'resend_welcome_email' => array( 'enabled' => '1', ), ), ), ); $endpoint->debug = 0;

HELP please !!

netw3rker commented 9 years ago

You are in luck, I'm trying to avoid chores, and really need people to help test/debug the 2.x version of this plugin. Are you free to chat on skype?

netw3rker commented 9 years ago

The simple answer though is that you are using the 1.x version of this plugin (I'm guessing you didn't choose a branch before downloading the zip, or didn't switch branches after doing a git checkout). if you are using the drupal module http://drupal.org/project/moodle_sso you'll need to use the 2.x version of this plugin. Here's the code you should be using: https://github.com/cannod/moodle-drupalservices/tree/2.x-2.x-dev

Jhereck commented 9 years ago

My bad, I tried the 2.x version of the plugin and got this error when trying to go in the "Administration" menu in Moodle : "Unexpected end of input".

When deleting files of the Drupal Services module, it works again.

Edit : the database update seems to be involved : it returns a blank page instead of the completion page, after an upgrade.

netw3rker commented 9 years ago

Not sure I'm following.. So which works for you the 2.x drupalservices plugin & moodle_sso module, or a different setup?

Jhereck commented 9 years ago

The Moodle_SSO module in Drupal is ok, but the DruapServices module in Moodle cause problems in Moodle : blank page when database is upgrated, and after that it's not possible to load the "Administration" page, with the following message ""Unexpected end of input".

When deleting the folder of the DrupalServices plugin, there's no more error.

I tried a fresh install of Moodle, with the same result.

netw3rker commented 9 years ago

hopefully you put the drupalservices code back in afterwards right!? :) and does "there's no more error" mean that everything is working correctly now?

Jhereck commented 9 years ago

Of course. This is my installation process step by step :

And if i delete the "drupalservices" in the plugins/auth folder, the admin page is accessible again (so after deleting the plugin).

Jhereck commented 9 years ago

Ok tried some things, and the faulty file is "settings.php". Tried to revert to 2.1 version of the plugin in moodle, after cleaning the database, and letting the "settings.php" file of the 2.2 version : same error (blank page after databse update and cannot access the administration page). After deleting this file i can load the admin page (still with the 2.1 version). Hope it can help !

Edit : the master is ok too cause there is no "settings.php" in it, but for both 2.1 and master, the problem is the "Fail : muser/Index: The muser resource is not available in the drupal service endpoint.".

netw3rker commented 9 years ago

Haven't forgotten about ya on this. Master is behind the 2.x-2.x branch (i don't want to merge it in until I'm sure its working) and the configuration steps are completely different. I found a couple of additional bugs that may have been getting in your way too which I'll commit shortly.

also, could you turn on the 'developer' debug setting so that any and all problems can be shown. that might help explain why you are getting a whitescreen.

netw3rker commented 9 years ago

@Jhereck , I just posted a bunch of cleanup work that might help fix these bugs. Can I get you to do a fresh pull of the 2.x-2.x-dev branch & give this a shot?

netw3rker commented 9 years ago

(even more updates today)

netw3rker commented 9 years ago

@Jhereck even more updates have gone in to the 2.x-2.x-dev branch over the last couple of weeks. Can you try it out? I think your specific bug was worked out about a month ago. It'd be great to know for sure though.

netw3rker commented 9 years ago

@Jhereck I'm going to assume this issue is resolved with the latest updates. Please reopen this issue if it happens again! thanks for reporting!