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

CommentFileSizeAuthor
#8 cas-571518-8.patch740 bytescpliakas

Comments

jonhattan’s picture

you can start with --debug :)

tauno’s picture

I 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.

jonhattan’s picture

Status: Active » Closed (fixed)
erikwebb’s picture

Version: All-Versions-2.0 » All-Versions-2.1
Issue tags: +cas

Sorry, 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 -

drupal@xxx:~/web/vhosts/xxx.xxx.xxx.edu/html> drush --debug -l xxx.xxx.xxx.edu update
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.035 sec]                                           [bootstrap]
Initialized Drupal 6.13 root directory at /home/drupal/web/vhosts/xxx.xxx.xxx.edu/html [0.047 sec]        [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.051 sec]                                           [bootstrap]
Initialized Drupal site xxx.xxx.xxx.edu at sites/xxx.xxx.xxx.edu [0.124 sec]                        [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.128 sec]                                  [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.136 sec]                                       [bootstrap]
Successfully connected to the Drupal database. [0.136 sec]                                                   [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.146 sec]                                           [bootstrap]
session_start(): Cannot send session cookie - headers already sent by (output started at                     [warning]
/home/drupal/drush/includes/drush.inc:482) [0.148 sec]
session_start(): Cannot send session cache limiter - headers already sent (output started at                 [warning]
/home/drupal/drush/includes/drush.inc:482) [0.148 sec]
Cannot modify header information - headers already sent by (output started at                                [warning]
/home/drupal/drush/includes/drush.inc:482) [0.153 sec]
Cannot modify header information - headers already sent by (output started at                                [warning]
/home/drupal/drush/includes/drush.inc:482) [0.153 sec]
Cannot modify header information - headers already sent by (output started at                                [warning]
/home/drupal/drush/includes/drush.inc:482) [0.153 sec]
Cannot modify header information - headers already sent by (output started at                                [warning]
/home/drupal/drush/includes/drush.inc:482) [0.153 sec]
<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://xxx.xxx.edu:443/cas/login?service=http%3A%2F%xxx.xxx.xxx.edu%3A%2Findex.php&gateway=true">here</a> to continue.</p><hr><address>phpCAS 1.0.1 using server <a href="https://xxx.xxx.edu:443/cas/">https://xxx.xxx.edu:443/cas/</a> (CAS 2.0)</a></address></body></html>Drush command could not be completed. [0.332 sec]                                                            [error]
erikwebb’s picture

Status: Closed (fixed) » Active
moshe weitzman’s picture

Project: Drush » CAS
Version: All-Versions-2.1 » 6.x-2.x-dev
Component: Interoperability » Code

CAS 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.

metzlerd’s picture

Do 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)

cpliakas’s picture

Status: Active » Needs review
StatusFileSize
new740 bytes

I 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

metzlerd’s picture

Version: 6.x-2.x-dev » 6.x-3.x-dev
Status: Needs review » Fixed

Sounds sane

Commit to head, will roll 6.x-3-dev today.

Status: Fixed » Closed (fixed)
Issue tags: -cas

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit d41fcd0 on 7.x-1.x, master, 8.x-1.x by metzlerd:
    #571518 Change the way drush is detected.