After updating the CAS module to 6.x-2.0-beta1, I can no longer run anything meaningful using drush. As I need the CAS functionality more than the drush functionality, I'm hoping for a change here.
I've added redirects to 'admin/*' and 'user' for CAS. I assume drush uses the 'admin/*' URLs and this is causing the issue. I don't mind looking through the code myself, but I'd like some help on a place to start.
Here is the exact error I receive -
drupal@xxx:~/web/vhosts/xx.xxx.xxx/html> drush -l xx.xxx.xxx dl media
<html><head><title>CAS Authentication wanted!</title></head><body><h1>CAS Authentication wanted!</h1><p>You should already have been redirected to the CAS server. Click <a href="https://xx.xxx.xxx:443/cas/login?service=http%3A%2F%2F%3Axx.xxx.xxx%2Findex.php&gateway=true">here</a> to continue.</p><hr><address>phpCAS 1.0.1 using server <a href="https://xx.xxx.xxx:443/cas/">https://xx.xxx.xxx:443/cas/</a> (CAS 2.0)</a></address></body></html>Drush command could not be completed. [error]
PHP Notice: Trying to get property of non-object in /home/drupal/web/apps/drupal-6.13/includes/common.inc on line 1769
PHP Notice: Trying to get property of non-object in /home/drupal/web/apps/drupal-6.13/includes/common.inc on line 1769
PHP Notice: Trying to get property of non-object in /home/drupal/web/apps/drupal-6.13/includes/common.inc on line 1769
Thank you,
Erik
Comments
Comment #1
jonhattanyou can start with --debug :)
Comment #2
tauno commentedI ran into the same problem. I traced it back to "Check to see if a user is already logged in?" in my CAS settings. Turning that off allowed drush to work again.
Comment #3
jonhattanComment #4
erikwebb commentedSorry, but I am still having this issue. For this particular site, my "Check to see if a user is already logged in?" option is disabled and I am running CAS 6.x-2.0-beta1 with the now new Drush 2.1. Here's the exact output I get -
Comment #5
erikwebb commentedComment #6
moshe weitzman commentedCAS is redirecting our attempt to login as anon or another user. It should not do so if user is on PHP CLI. Not a drush issue.
Comment #7
metzlerd commentedDo you know of a reliable way to determine when requests are drush requests? I've excepted cron.php runs and would happily add drush requests to the list of exceptions for CAS if that's appropriate.
Dave
(cas module maintainer)
Comment #8
cpliakas commentedI see that the 2.x branch checks for Drush, but this patch may be another way to do it using a Drush API function. Looking forward to D7, something similar now exists in core.
Thanks,
Chris
Comment #9
metzlerd commentedSounds sane
Commit to head, will roll 6.x-3-dev today.