I can see in the drush output that there are several (redundant?) drush commands that I could - in theory - use to invoke node_export, but I get a permissions denied error:
You do not have permission to perform a Node export on one or more of these nodes. No nodes exported.

Invoking Drush can do so many other things without a permissions-denied message that I hadn't considered the "user" drush is working as. Which user is that? My own username on the shell of the server? My site-based username? A third entity of some sort?

How do I specify that drush should be given specific permissions? I created a user in the Drupal site that matches the user I log in as to access the shell, and gave that full admin permissions on the site, but that didn't help Drush invoke node_export.

Comments

danielb’s picture

I don't actually use drush myself, so I can't help specifically with that. I thought drush people knew what they were doing.
User 1 has the permission to do everything, so I would use that. Could this help ? https://drupal.org/node/872892
Sounds like by default you are the anonymous user (and therefore can do bugger all)?

Once you know what user you are, we can work out the permission problem from there...

PS, the commands aren't redundant. There was some disagreement on what the commands should be called, so I added all the aliases people wanted.

glottus’s picture

Thanks for clarification on the multiple commands - it isn't immediately apparent that they're synonymous with each other.

I'm gradually learning what I can do with Drush, but with the same installation and configurations, I used it today to do things like download and install dev versions of certain modules, cleared cache, reset an admin password, and even ran some updates on core.

BUT, when I tried to invoke node_export, I got the first permissions errors I've seen since starting out using drush in the past month or so.

Running "drush -u 1 node-export" apparently got past the permissions problem (thanks for the link), but I hadn't understood that node_export would default to trying to export ALL the nodes if I didn't specify any at all - it churned away for a while before coming back with a "Fatal error: Allowed memory size of 94371840 bytes exhausted" message.

Perhaps the default could be to simply display the help message and exit? Require some sort of input beyond what I typed above for it to actually try and do anything. That might make it easier for noobs to this module to learn more about how to use it.

danielb’s picture

Status: Active » Fixed

Well those are some good points, the thing is though that the drush integration was heavily contributed to by experienced drush users, so I don't want to deviate too much from the expected behaviour, even though as you say that one can catch noobies out. It doesn't break anything so it's just a learning experience. I suppose if I keep getting complaints we might have to seek advice about what to do, but I'd rather hear from more drush users before changing anything.

Status: Fixed » Closed (fixed)

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