Closed (fixed)
Project:
Drupad
Version:
6.x-1.4
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
26 Jun 2010 at 16:01 UTC
Updated:
17 Sep 2010 at 21:00 UTC
Jump to comment: Most recent file
I downloaded the module, installed and enabled it, bought the app and filled in my site's details. I tried accessing my site but got a message that said "Oops... The request did not succeed."
Not sure what I'm doing wrong. I followed the installation instructions on the site but I can't seem to get it work.
Any ideas on how I can get the app to work?
| Comment | File | Size | Author |
|---|---|---|---|
| #49 | drupad.module.1.1.diff | 453 bytes | jchatard |
| #32 | drupad_logout_if_not_authorized.patch | 740 bytes | jchatard |
| #33 | drupad_logout_if_not_authorized_corrected.patch | 776 bytes | jchatard |
Comments
Comment #1
ken hawkins commentedThis may be that you did not type http:// in the site address field?
Comment #2
DMacpherson commentedNope, even with the http:// it doesn't work for me. It tries to connect and then... nothing. Just the same error message.
Ps. I should mention my specs. Running drpual 6.17 and using iPhone 3GS with ios 4.
Comment #3
DMacpherson commentedOkay, I discovered something interesting.
The original site I tested the module and app on was on a shared webhost (1&1).
I tried the module and app on another site of mine on a virtual server and it worked.
Any idea why it wouldn't work on the shared host? Anyone else having problems getting this to work on a shared host?
Comment #4
jchatard commentedHi, DMacpherson.
This is strange, can you check in Dblog entries if you find any error message?
Also, can you try to access the config callback of the module and paste the response from your server?
You do this by requesting from a web browser the following URL:
http://mydomain.com/?q=drupad/check-config/1.0Depending on weither or not you are logged in, you'll be prompt you login and password, and then you should see a JSON response which could look like the following:
{"meta":{"version":"1.0","version_match":true},"content":{"callbacks":["comments","content","users","updates","status-report","offline","cron-tasks","dblog","backup"],"modules":["comment","mollom","node","user","update","system","dblog","backup_migrate"]}}This is the callback that let the application know what your Drupal site is able to handle and automatically setup the application features.
So tell me if you have any error message at this point.
Thanks,
Jérémy
Comment #5
DMacpherson commentedHi Jérémy,
Thanks for getting back to me.
I couldn't find any errors in the dblog.
However, the callback works and here's the results:
{"meta":{"version":"1.0","version_match":true},"content":{"callbacks":["comments","content","users","status-report","offline","cron-tasks"],"modules":["comment","node","user","system"]}}Comment #6
jchatard commentedDamned! This looks good.
Do you have any authenfication layer on top of your installation?
Any strange module? What are your module versions?
Jérémy
Comment #7
edhaber commentedI'm having this same problem. I tailed the log on the server and saw the request for ?q=drupad/check-config/1.0
I tried that myself and it returned this:
Content-Type: text/javascript
Here are the modules from drush up (some are out of date)
This site is running on slicehost.
Comment #8
jchatard commentedI just made a test with Global redirect 6.x-1.2 as you @edhaber, but this doesn't seems to be a problem as I already handle redirection in the app.
I'm really sorry to ask you that guys, but as the config URL "looks" good when you try it in a browser, can just re-double-check the login and password you gave in the app?
Also try to not include any trailing slash in the URL (but shouldn't be a problem also).
I know this is a boring task since there's no "Site edit" feature for now but... (Edit feature is comming in the next release).
Thanks,
Jérémy
Comment #9
edhaber commentedA little additional testing. I have two servers with the same site that are configured slightly differently. This works on one site and gets the "The request did not succeed" on another.
The server that works:
Debian
Apache/2.2.9
PHP/5.2.13-0.dotdeb.1 (mod_php)
The server that fails
Debian
Apache/2.2.9
PHP/5.2.6-1+lenny8. (php_cgi)
They are both run as apache virtualhosts. The one that doesn't work is using suexec so that php is running under a separate user for each site. This might be similar to other shared hosts.
I'll setup a simple default drupal site and see if it has the same problem on that server.
-Ed
Comment #10
edhaber commentedI setup a default drupal install with only the drupad module installed and enabled. This worked on one server and failed on another.
Comment #11
edhaber commentedAccess Log
the 401 is unauthorized. I've checked the password several times and copy and pasted from an email.
-Ed
Comment #12
DMacpherson commentedNothing out of the ordinary. Standard Drupal user authentication methods. Nothing fancy as far as modules goes.
I did another test... something I didn't think of... I previously tested the callback while logged into my shared hosting site... So I logged out and tried the callback again. This time I got a login request and tried my username and password. It didn't work.
I checked my shared hosting phpinfo config and I don't think it's setup to allow $_SERVER["PHP_AUTH_USER"] or $_SERVER["PHP_AUTH_USER"], possibly for security reasons OR possibly because it's a limited shared host and they want people to fork out for something more expensive.
Comment #13
jchatard commentedHi,
Can you try by adding the following directive in your .htaccess file or Vhost config file:
And let me know if this does the trick?
Changing issue from iPhone app component to code (module).
Thanks,
Jérémy
Comment #14
DMacpherson commentedHi Jeremy,
I tried what you said and it doesn't seem to work, same symptoms.
- DMacpherson
Comment #15
jchatard commented@DMacpherson with mod_rewrite.c enabled?
Comment #16
jchatard commentedJust made a test on fresh Drupal install with PHP F/CGI, and it works like a charm.
@edhaber Can you give me an access to a not working Drupal instance so that I can test/debug with your hosting? (FTP, URL) If it's Ok for you, mail me: drupad AT breek.fr
Thanks,
Jérémy
Comment #17
edhaber commented"The HTTP Authentication hooks in PHP are only available when it is running as an Apache module and is hence not available in the CGI version."
http://php.net/manual/en/features.http-auth.php
You can check your shared host. They are probably running PHP as CGI. I'm doing it on my server so I can run php as a different user for each site.
I think this is a problem in the module and in the iPhone app. I tried that rewrite rule and it does pass the http authentication to the CGI as a get parameter, but it breaks clean urls. I'm sure there is a way to fix that too.
Drupal doesn't use HTTP authentication, but instead posts the username and password in form results. Why not change the app and the module to expect the credentials as a POST variable and then you don't have to try to work around problems with HTTP auth with CGI. The XMLRPC that is build in also just takes the username and password and calls user_authenticate
Comment #18
jchatard commentedOh just one more try,
Can you put the .htaccess directive right after Drupal rewrite, like this (last line in this example):
Let me know please if Authentication works and Clean URLs keep doing their jobs.
Thanks,
Jérémy
Comment #19
edhaber commentedThat does fix it.
Comment #20
jchatard commentedOk great!
Will wait a bit for people to test to be sure this solves most situations.
Jérémy
Comment #21
DMacpherson commentedI tried the fix in #18 and it doesn't work for me. I even tried a fresh Drupal install using nothing but core installation and Drupal. Still nada.
I'm pretty sure I've got mod_rewrite enabled because clean URLs is enabled for my site.
This sounds like what's going on. Is there anyway I can know for sure?
By the way, thanks Jérémy for helping out with this. Your app works extremely well on my stand-alone webserver and I can see myself using it regularly.
Comment #22
jchatard commented@DMacpherson,
If you can give me an access (uid login + FTP) of a sample Drupal installation on your hosting which causes trouble I could give it a try and maybe find a fix/workaround (mail me at: drupad AT breek.fr).
Because I have a feeling that you are not and won't be the only one using Drupal on a shared hosting. So if we can find a suitable solution, that would be perfect.
By the way as edhaber suggested I could go with other implementations such as XMLRPC, but to be honest:
This is why I really want to try to fix this that way.
Jérémy
Comment #23
felipep commentedI had the same problem on a shared server, but I changed the htaccess as explained by jchatard and it worked thanks, and great app :D
Comment #24
sewid commentedThe modified .htaccess file does not work for me :-(
I get an access denied error, but username and password is correct.
One interesting thing, when I go to:
http://www.domain.de/drupad/check-config/1.0, I get an access denied error, when I go to http://domain.de/drupad/check-config/1.0, I get:
{"meta":{"version":"1.0","version_match":true},"content":{"callbacks":["comments","content","users","updates","status-report","offline","cron-tasks"],"modules":["comment","node","user","update","system"]}}
The app doesn't work either with www. nor without it.
Best regards,
Sebastian
Comment #25
silentway commentedI tried the htaccess fix in #18 and it didn't work for me either (still "Oops... The request did not succeed.").
D6.17. iPhone 3G, iOS 3.1.3.
No sign of Drupad attempts in my dblog but the callback works.
Also tried enabling my update status module (I turn it off sometimes for speed issues). Not the problem. But Drupad is smart enough to spot that in the settings anyway.
Comment #26
sewid commentedAs addition, I've got D6.17, iPhone 3GS, iOS 4
Comment #27
jchatard commentedCan you guys, tell what hosting provider do you use?
And also what hosting plan?
I really need to test a failing install. So I need to register such a plan to give it a try.
Thanks,
Jérémy
Comment #28
sewid commentedHi Jérémy,
I've got my own webserver and a hosted drupal instance there is not working with the app.
If you want, I can create (today in the evening) an empty drupal installation for you to test it.
Best regards,
Sebastian
Comment #29
jchatard commented@sewid yes yes! I want this!
Send me details at: drupad AT breek.fr
Thanks,
Jérémy
Comment #30
jchatard commentedI think @sewid has his problem solved, he still needs to confirm but, I think he does.
@silentway can you please confirm that you are using PHP with CGI?
Can you give me your list of modules, status report info, etc.
Thanks,
Jérémy
Comment #31
sewid commentedI thing I found the source of the problem. The problem is the drupad_init()-function. There's a check for:
if (arg(0) == 'drupad' && user_is_anonymous()) {...
And because of - I don't know why - user_is_anonymous() returns false. So, the login sequence is skipped. I tried (quick and dirty) this:
global $user;
$user = drupal_anonymous_user();
if (arg(0) == 'drupad' && user_is_anonymous()) {
And everything went fine. In this way, the login sequence can't be skipped.
Comment #32
jchatard commentedHi all,
DON'T USE THIS PATCH, TAKE THE ONE FROM MY NEXT MESSAGE
Just to explain what @sewid just found, and I think this may be the reason why some of you can't login with Drupad.
There is one thing to remember before going to the code though: for now Drupad is only usable with user account 1, or at least with user uid defined in
function drupad_authorize().So let imagine the following sequence:
- launch Drupad
- create a new profile / site with a valid user BUT not uid 1 account
- you tap the site, you go through
drupad_init(), which tries to log you in- it does, because you are a valid user
- but once you're logged in, the module needs to check weither or not you are authorized, which is handled by
function drupad_authorize(), in our scenario, you're not, so it returns false- the application tells you to the request didn't succeed
But you now know you were mistaken on the user account to use. So you change that, with the right account and the right password.
And as sewid just pointed out, your Drupal session is still alive so the module doesn't need to log you in. Abviously it should.
So here is a patch that I want you people to test against your current module version.
What it does is pretty simple, if you are logged in and not authorized, it logs you out :-)
I need your feedback on this.
Oh and remember if you are using CGI you still the .htaccess line (the last one):
PS: many thanks @sewid for your debuging!
Thanks,
Jérémy
DON'T USE THIS PATCH, TAKE THE ONE FROM MY NEXT MESSAGE
Comment #33
jchatard commentedSorry, the previous patch contained a bug, use this one instead please.
And if you applied the previous one, plus replace with this one.
Thanks,
Jérémy
Comment #34
DMacpherson commentedTried the patch but it still didn't work for me
I think the module was fine in the beginning because I tried it on a site on my dedicated server and it worked perfectly.
Nonetheless, tomorrow I'll make a new drupal install on my 1&1 account and e-mail you some access details, Jérémy.
Comment #35
damienmckennaHaving this problem too. Will see what I can find.
Comment #36
yurtboy commentedWorked fine for me after I changed the user id to the one I was trying to log in as.
"There is one thing to remember before going to the code though: for now Drupad is only usable with user account 1, or at least with user uid defined in function drupad_authorize()."
Comment #32
Comment #37
patrickroma commenteddoesn't work also for me
Comment #38
jchatard commentedHi patrickroma,
Could give me some more detail on your configuration.
Are you using CGI? Did you try the .htaccess rule?
Are you logging with uid == 1?
Can you test by truncating the "sessions" table from your Drupal installation?
Thanks,
Jérémy
Comment #39
silentway commentedHi- Sorry I missed a few days here... My server is on a shared apache host, and is running PHP 5 with CGI (But not FastCGI). Mod_security is on.
Modules are primarily the Acquia distro, with a handful added to that. Cron has been run, caches have been cleared...
MySQL database 5.1.39
PHP 5.2.13
PHP memory limit 90M
PHP register globals Disabled
Comment #40
Hartsa commentedDoesn't work for me either
MySQL database 5.0.77
PHP 5.2.8
PHP memory limit 128M
PHP register globals Disabled
CGI/FastCGI
and my other site witch won't work
MySQL database 5.0.45
PHP 5.2.8
PHP memory limit 64M
PHP register globals Disabled
CGI/FastCGI
Comment #41
deverman commentedHi I can't login I'm using user account 1 getting pretty much the same errors.
Comment #42
jchatard commentedRe-set to active.
Ok guys, can you make the following test for me please:
Because if you have mod_rewrite enable, there is really no reason why this wouldn't work.
Thanks,
Jérémy
Comment #43
Hartsa commentedI did all this two times no luck...
Comment #44
jchatard commentedHi guys,
Really sorry that this still doesn't work for some of you. But once again, if you want me to fix this issue, I need one of your non-working environment!.
So please, if one of you can give me access to a Drupal installation that is not working (or a fresh one dedicated to me) it will help everyone out there. I need to make some debugging!
Thanks,
Jérémy
Comment #45
howartp commentedHi Jérémy,
I just came back here to give you login details to any one of my four 'oops' drupad sites, but I just followed through these instructions and #18 has worked on two of them (#33 on it's own didn't work - I haven't tried #18 on it's own because I'd already applied #33); I haven't tried the other two sites but they are with the same host so likely to work.
Would it be of any benefit to you to see my remaining sites in their unfixed state before I apply the two fixes above to them?
Peter
Comment #46
jchatard commentedNo no, go ahead. If the attached patch solves your problems, it just means that it works.
Glad it's ok for you now!
Thanks for the feedback!
Jeremy
Comment #47
jchatard commentedOk people,
IMPORTANT: Update the module to version 6.x-1.1 before doing the following
Thanks to Lukas Prelovsky who allowed me to debug right on his server, I think I found the reason why some of you are unable to login.
It seems that on some Apache versions/configuration the $_GET['HTTP_AUTHORIZATION'] we setup in your .htaccess file is forwarded to $_SERVER['REDIRECT_HTTP_AUTHORIZATION'].
So please test this, here a full recap of the procedure.
1. Be sure that mod_rewrite is enabled on your config
2. Make the #32 htaccess stuff
3. Apply the patch in comment #48
5. Truncate your sessions table.
6. Quit the iPhone application
7. And try again
Hope it does the trick.
I wait for your feedbacks!
Thanks,
Jérémy
Comment #48
jchatard commentedJust marking new module version
Comment #49
jchatard commentedHere is the patch to apply for version 6.x-1.1
Comment #50
toomanypets commentedFollowed instructions in #47, applied patch #49 to 6.x-1.1. Trying to login as user account 1 -- no joy. "Oops... The request did not succeed."
Comment #51
toomanypets commentedJust read #838310: Caches failed attempts. Exited the app, re-opened, tried again -- success!
Comment #52
toomanypets commentedBy the way...
This is a marvelous application; very well done.
Thanks!
Comment #53
jchatard commented@toomanypets cool!
Thank you!
Jérémy
Comment #54
CinemaSaville commentedHi Jeremy,
I downloaded 6.x-1.1. Rewrote .htaccess. Applied the patch. Truncated the sessions table and exited the app. But it still doesn't work. I get the oops message.
Can you help me out here, please?
Thanks,
Jeremy
Comment #55
jchatard commentedHi @CinemaSaville,
The best way I can help you is by sending me (via mail: drupad (AAAAAAT) breek.fr) connection information for one of your installation that doesn't work (on the same server) dedicated to me. No production site of course.
Jérémy
Comment #56
pcsupport commentedInstalled latest version of drupad and module.
Still getting the oops message with htaccess file modified and unmodified. Session table have been truncated but not sure where the patch (post 49) is to go.
Help!
Comment #57
Hartsa commentedNow with these new updates, still, login failed .....B-(
Comment #58
jchatard commentedHi all,
The best way I can help you is to give me access (FTP) to a clone of your installation. I really need to test in your server config.
Drop me a line + details to drupad A|T breek.fr
Thanks
Jeremy
Comment #59
pcsupport commentedEmail sent to you with login details etc.
Comment #60
jchatard commentedThanks @pcsupport for your site access.
Can you people try the newly uploaded module 1.3 (http://drupal.org/node/860906). It may help you.
Please note that if the app directly crashes once you touch your site name, please read this thread #860242: iPhone app crashes the update should be available soon.
Thanks,
Jérémy
Comment #61
bavarian commentedsame problem since many weeks back and also with the 1.3 version ... frustrating !
Comment #62
CinemaSaville commentedMe too. : (
Comment #63
jchatard commented@bavarian and @CinemaSaville if you have this problem and have read this thread, you know how I can help you.
Jeremy
Comment #64
pcsupport commentedDownloaded and installed the updated module but no luck.
I'l wait till the updated app appears!
Comment #65
damienmckennaRunning the latest v6.x-1.3 code with the v1.1 app I'm still getting the error on my site. FYI I'm using a Dreamhost shared-hosting account (not a VPS) and am using the latest release of Pressflow rather than Drupal.
Anyway, I made the following change to drupad.module:
All that gets logged is:
As you can tell from that, the first IF statement of drupad_init() resolves as TRUE and executes, but then none of the subsequent IF statements match.
Comment #66
damienmckennaAn update. I added two extra lines to drupad_init() to find out the $_SERVER and $_GET variables:
$_SERVER:
$_GET:
Comment #67
damienmckennaFYI I applied the .htaccess file change noted in comment #47 above and it worked!! Excellent news!
Comment #68
pcsupport commentedErmm, this may be what they class as a user 'stupidity' event…. I went into the user permissions in drupal, ticked both drupad boxes and it now works!
Comment #69
jchatard commentedOk people, I just pushed 6.x-1.4 of the module, if you can't connect, please refer the README.txt for a new workaround.
Hope it will help you!
Jérémy
Comment #70
Hartsa commentedWith latest module and latest app and codesnippet 2 both my sites work ok. Thanks
Comment #71
jchatard commentedNice!
Jérémy
Comment #72
bavarian commentedno luck at all wih any code-snippet ...
Comment #73
jchatard commentedAny chance you send me your server access? So that I can help you.
Jeremy
Comment #74
jchatard commented@bavarian,
I'm leaving for holiday time. If people could help you check settings, like in the .htaccess file this would be cool.
Unfortunately, I won't have any computer during vacations, just my iPhone, so I won't be able to help you for that period.
I'll keep reading the threads though, and reacting.
Hope you're gonna make it.
And of course if still no success when I come back, I'll help you.
Jérémy
Comment #75
DMacpherson commentedJeremy,
Just wanted to drop you a line because I was very slack in putting together a test site for you. Sorry.
I did, however, try the new versions of Drupal app and module and IT WORKS FOR MY SHARED HOSTING SITES!
Brilliant job, mate!
- Daniel
Comment #76
CinemaSaville commentedComment #77
jchatard commented