Community

Error 404: could not find the controller

Hi,

I just installed Drupal 7 with "push notifications" module (and dependencies) : http://drupal.org/project/push_notifications

I should be able to "register" to notifications using url :
http://SERVER/mobile_data/push_notifications

as explained in the tutorial I followed (by the author of the module) :
http://www.danielhanold.com/story/drupal-7-push-notifications-how-to-reg...

But when I use this URL, I get ERROR 404 "could not find the controller" (in my example drupal.local references 127.0.0.1) :

$ wget -O- drupal.local/mobile_data/push_notifications --post-data "type=android&token=$TOKEN"
--2012-12-14 14:49:12--  http://drupal.local/mobile_data/push_notifications
Resolving
drupal.local (drupal.local)... 127.0.0.1
Connecting to drupal.local (drupal.local)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 404 Not found: Could not find the controller.
2012-12-14 14:49:18 ERROR 404: Not found: Could not find the controller..

I have the same error when I use any url :
drupal.local/mobile_data/anything_sdflhjsfjksd
drupal.local/azertyuiop/anything_sdflhjsfjks

So I think I missed something in drupal configuration (or at least "Rest server" on which depends "push notifications").

Thanks for your help.

Comments

Any idea ?

Any idea ?

Same here

Exact same issue.

Specific to push_notifications

I have the same error when I use any url :
drupal.local/mobile_data/anything_sdflhjsfjksd
drupal.local/azertyuiop/anything_sdflhjsfjks

This is not true anymore.

$ wget -O- drupal.local/mobile_data/anything_sdflhjsfjksd
...
ERROR 404: Not found: Could not find resource anything_sdflhjsfjksd.

$ wget -O- drupal.local/mobile_data/user
...
401 Unauthorized: Access denied for user anonymous
Authorization failed.

(and it correctly prints the user list if I authorize anonymous access)

But :

$ wget -O- drupal.local/mobile_data/push_notifications
...
ERROR 404: Not found: Could not find the controller.

It seems it is a bug specific to push_notifications.

updates

I manage to get an empty response by directly POSTing to the endpoint ("mobile_data" in your case), but I get a 404 (not found) if I POST to the required resource (push_notifications), and a 401 (unauthorized) if I create an alias to the resource and POST into it.

to illustrate:
1) POST to some.url/mobile_data:
empty response (I.E. can reach the endpoint, but no particular resource, so no good...)

2) POST to some.url/mobile_data/push_notifications:
404 not found (controller not found, or to my understanding, can't access the push_notifications resource!)

3) POST to some.url/mobile_data/push (the alias I set in Admin | Structure | Services | Resources for push_notifications):
401 not authorized. this is the most progress I made. first, from my terminal:

dd_dent@dentlap:~$ wget -O- --post-data 'token=test&type=android' some.url/mobile_data/push
--2012-12-20 19:47:13--  some.url/mobile_data/push
Resolving some.url (some.url)... some.ip
Connecting to some.url (some.url)|some.ip|:80... connected.
HTTP request sent, awaiting response... 401 Unauthorized: Access denied for user anonymous
Authorization failed

First note that I replaced any references to any real IP or domain, and replaced with what I used thus far.
I will try to push from the App I'm working on and will update as necessary, but it would appear that I can now reach the resource (controller), which is better that not finding it at all...

Solved!

goto People | PERMISSIONS, scroll down to "Push Notifications", and mark down whichever permissions you want ( add / remove device token), and after a LONG week of tinkering, it works!

nobody click here