I am trying to run a drush script as a particular user. When it is run, the relative watchdog logs are displayed as coming from the 'anonymous' user. Is this expected behavior?

Comments

greg.1.anderson’s picture

Category: bug » support
Status: Active » Fixed

drush -u 1 status or drush --user=1 status. -u=1 will not parse, and therefore will run as anonymous.

awjrichards’s picture

Status: Fixed » Active

i have actually tried:
drush -u 1
drush --user=1
drush --user=awjrichards //(my username)

when i run this with 'status', it looks like it is running as the correct user. however, when i run a custom command, all of the log entries in watchdog are still showing up as anonymous.

awjrichards’s picture

Status: Active » Closed (fixed)

I actually figured this out - the problem was with the custom command using a bootstrap method that was preventing the user from authenticating