2

(ETA httpie in subject and tags, as it seems like it would be an issue with httpie's content being different in the corn context.)

I'm at a loss as to how to troubleshoot this further.

I'm using OAuth credentials to send a github API call with httpie. The call returns the expected response when I run it from the command line, but in a script called from cron it fails with a 404 "not found" response, which the API docs indicate is likely an authentication issue.

The call looks like this:

/usr/local/bin/http --auth joeuser:xxxx-AuthToken-xxxx https://github.ourplace.net/api/v3/user/orgs

I can't find anything obvious in the github api documentation that indicates what might be missing from the impoverished cron environment, or something like that, to cause the problem. I can paste the same call at the command prompt and get the expected list of organizations.

Any ideas, or troubleshooting suggestions?

Thanks.

Scott
  • 1,247
  • 3
  • 10
  • 21
  • 1
    Hmm, does the -1 mean a downvote? Not sure why that would happen. I did a good bit of digging and trial and error while thinking it was a problem on the github side or something with the credentials locally, then when I got away from it in the car to drive home it came to me that it was more likely an httpie problem. Seems like "getting stuck on the wrong track" and asking for troubleshooting help isn't a bad thing... – Scott Jun 25 '15 at 05:22

1 Answers1

3

Looks like I needed to use the --ignore-stdin option to http when using http in a cron job, that fixed the problem.

Scott
  • 1,247
  • 3
  • 10
  • 21