Closed jheasly closed 8 years ago
I've dealt with this, but I think it was on an old server I just killed. Oops. I usually use the full path to the virtualenv executable:
0 12 * * * cd /home/me/.virtualenvs/my-project && /home/me/.virtualenvs/my-project/bin/tarbell publish production
That should get all the right Python paths and config stuff. The other thing you can do is set CREDENTIALS_PATH
in your tarbell_config.py
. I think I've done that before.
Hrm. In addition to setting the CREDENTIALS_PATH
I tried the cron one-liner (where the first arg is the location of the tarbell project and the second is the virtualenv'd path to tarbell, right?) and I'm still getting the same EOFError: EOF when reading a line
error.
For some reason, the return get_drive_api_from_client_secrets(settings.client_secrets_path)
is not coming back with the oauth
object. I've compared my and the shell's sys.path
(identical) and environmental variables and am not seeing any difference of consequence, but I guess, by definition, there is/are ...
Aha! ⚡ So it seems, if you're running from cron
from anywhere, even if from your local development server, you must do the tarbell credentials > ~/.tarbell/credentials.json
bit. Is this the case? It seems to be. Once I did that, my cron
setup worked fine.
If this is indeed the case, I suggest a note be added to the Remote configuration page, and I'm perfectly willing to do a PR for that. Oy ...
Yes, PR would be awesome. Thanks!
Are there any examples of how to set up a virtualenv'd tarbell cron? The problem seems to be some kind of environmental/path issue that keeps the Google OAuth
client_secrets.json
authorization from being loaded. When I run the script from the command line it works fine. When I run it from that same user'scron
it tries to do the Web browser launch thing (" ... browser tab to walk through the OAuth 2.0 process ... ") 'cause apparently theclient_secrets.json
load failed.Seems to be falling down around
get_drive_api_from_client_secrets()
: https://github.com/tarbell-project/tarbell/blob/master/tarbell/oauth.py#L37Here's the error:
Here's the script: