Answers.Body: <p>I was able to reproduce your issue and fix it on my Linux install.</p>
  
  <ol>
  <li>It seems to only happen with Linux, not MacOSX.</li>
  <li>I can fix it by changing the filename of the job to be first letter caps only, i.e. not camel case. Don't make any other changes.</li>
  </ol>
  
  <p>Following the advice in various other locations, including civix or related issues, does not fix it (shortening, changing to all lower case, etc.).</p>
  
  <p>I think part of the noise of this issue is related to changes in the upcoming v4 api which are not true of the v3 api that were introduced in 4.6.</p>
  
  <p>My suspicion is that this patch is responsible for breaking things:
  <a href="https://github.com/colemanw/civicrm-core/commit/bfcb4795c83dc61e854f4268ef149b6c761636aa">https://github.com/colemanw/civicrm-core/commit/bfcb4795c83dc61e854f4268ef149b6c761636aa</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-09T16:15:47.683Z
Answers.LastActivityDate: 2015-06-09T16:15:47.683Z
Answers.UserDisplayName: Alan Dixon
Answers.Body: <p>There seem to be two issues in the question:</p>
  
  <p>1) Downloads in the extension manager fail on HTTP redirection (which in turn causes the malformed zip issue). </p>
  
  <ul>
  <li>It sounds like you already know how to work-around this issue -- by manually putting the files in place. If using this technique, you should do it consistently (for both installation and upgrade).</li>
  <li>See also: <a href="https://issues.civicrm.org/jira/browse/CRM-14126" rel="nofollow">https://issues.civicrm.org/jira/browse/CRM-14126</a> </li>
  </ul>
  
  <p>2) The API call used by the cron job is missing/unknown. This sounds like a bug for which you may want to <a href="https://github.com/iATSPayments/com.iatspayments.civicrm/issues" rel="nofollow">report</a>, but there are a few areas one might investigate:</p>
  
  <ul>
  <li>The current iATS module (<a href="https://github.com/iATSPayments/com.iatspayments.civicrm/blob/1.3.2/info.xml" rel="nofollow">v1.3.2</a>) does not advertise compatibility with Civi v4.6. The unreleased <a href="https://github.com/iATSPayments/com.iatspayments.civicrm/blob/master/info.xml" rel="nofollow">master</a> version does (but it's... unreleased).</li>
  <li>That API action has a long, multiword name. Civi v4.6 tightened the way it handles these kinds of names. <a href="https://issues.civicrm.org/jira/browse/CRM-15988" rel="nofollow">https://issues.civicrm.org/jira/browse/CRM-15988</a></li>
  <li>That API action has a long, multiword name. Calling that API requires translating from the API name (<code>Job.IatsRecurringContributions</code>) to a filename (<code>api/v3/Job/IatsRecurringContributions.php</code>). This is susceptible to edge-cases involving filename case-sensitivity (where, eg, an API+filename might work in OSX but fail in Linux).</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-09T13:23:29.937Z
Answers.Text: Hey Tim - thanks for these notes about the 4.6 changes to the API. Early on, I broke the civix naming conventions by starting some of my filenames with lower case (a possibly misguided attempt to adhere to some branding requirements ...), I wonder if that's part of the story? I'll check your links for further clues.
Answers.UserDisplayName: Alan Dixon
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-09T16:24:15.573Z
Answers.Text: The first answer is correct, but the second answer has a few red herrings and should be updated.
Answers.UserDisplayName: Alan Dixon
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-11T22:26:37.323Z
Answers.Text: The downloading of extensions issue has been broken for me for quite some time. If I remember it broke around 4.5 early in that cycle of releases.
Answers.UserDisplayName: frTommy
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-09T07:21:27.357Z
Answers.LastActivityDate: 2015-06-09T07:21:27.357Z
Answers.UserDisplayName: Tim Otten
Answers.Body: <p>I <em>was</em> having the same iATS Payment issue. I looked at what Alan <a href="https://civicrm.stackexchange.com/a/3117/159">said</a>, then renamed the Job file name, the actual .php files in the iATS Extension folder (…custom_ext/com.iatspayments.civicrm/api/v3/Job/) and now it works!</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-11T21:22:11.330Z
Answers.LastActivityDate: 2015-06-11T22:20:06.370Z
Answers.LastEditDate: 2017-04-13T12:53:13.017Z
Answers.UserDisplayName: jursulak
Answers.Body: <p>ad 1) did you do a complete rm -r everything iATS code files that you had downloaded via the Manage Extensions GUI before you unzip-ed the 1.3.2-zip file? Did you add 4.6 to its info.xml file [it only contains labels 4.4 and 4.5]? Did you clear all CiviCRM caches and go back to the Manage Extensions GUI screen and run the database updates [you had mentioned to us you upgraded from well before 1.3.2 - I bet you there are likely some of these to be dealt with].</p>
  
  <p>I think the reason the automated process failed may very well be b/c 1.3.2 is indeed not labeled as compatible with your CiviCRM core - so it's trying to stop you from installing it. </p>
  
  <p>ad 2) I would not recommend git clone master at this point - in addition to working on testing all 21 payment pathways in 4.6.x - Alan is working on adding Direct Payment Method [comes with lots of JS edits in lots of places] and I'm working on adding in some new extensive reporting features. There is just a lot going on right now. And unreleased (not in our test matrix yet). </p>
  
  <p>I'll try and reproduce your issue (installing the 1.3.2 on a 4.6.x) - If I can reproduce it I'll work on that and make it a patch re: scheduled jobs - code edits from 4.4./4.5 to 4.6 - a patch which you would then need to manually apply to your 1.3.2</p>
  
  <p><strong>New:</strong></p>
  
  <ol start="3">
  <li><p>Try deleting the iATS scheduled jobs from your /civicrm/admin/job?reset=1 - and then manually add them [using the Add New Scheduled Job button]. I just ran iATS 1.3.1 jobs on a 4.6.4ish (see screenshot).</p></li>
  <li><p>Obviously that's a workaround - we need to dig deeper to find out why these jobs don't survive the upgrade better. Perhaps scheduled jobs get stored elsewhere/differently in the CiviCRM db compared to 4.4/4.5? </p></li>
  </ol>
  
  <p><img src="https://i.sstatic.net/zCeUP.png" alt="enter image description here">
  <img src="https://i.sstatic.net/Zpnud.png" alt="enter image description here"></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-09T15:08:41.403Z
Answers.Text: K! will try it! Sounds very promising. It occured to me to do that very thing awhile back, just never did. I'll report back in a few...
Answers.UserDisplayName: John Richardson
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-09T15:27:21.177Z
Answers.Text: I am getting: "Given API command is not defined" Error. I am putting: "Job" and "IatsRecurringContributions" in the API call fields. i.e. "api.job.IatsRecurringContributions" in the API call. What's wrong?
Answers.UserDisplayName: John Richardson
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-09T15:34:42.667Z
Answers.Text: Let me add another screenshot to my post.
Answers.UserDisplayName: KarinG - Semper IT
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-09T15:39:08.000Z
Answers.Text: PS - I just confirmed that adding 1.3.2 to a new D7/4.6.4-ish scheduled the iATS scheduled jobs are working fine on OS X [relevant b/c of Tim's note above].
Answers.UserDisplayName: KarinG - Semper IT
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-09T15:50:56.280Z
Answers.Text: Still get error.
Answers.UserDisplayName: John Richardson
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-09T16:00:01.207Z
Answers.Text: See my screen shot above in the original post.
Answers.UserDisplayName: John Richardson
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-09T16:31:52.860Z
Answers.Text: My issue is apparently an old one. Don't know why I am still having it: https://issues.civicrm.org/jira/browse/CRM-10790
Answers.UserDisplayName: John Richardson
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-10T18:48:00.470Z
Answers.Text: No, not the same issue. Just a similar symptom.
Answers.UserDisplayName: Alan Dixon
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-09T12:42:55.417Z
Answers.LastActivityDate: 2015-06-09T15:35:44.483Z
Answers.LastEditDate: 2015-06-09T15:35:44.483Z
Answers.UserDisplayName: KarinG - Semper IT
Body: <p>I am using civicrm ver. 4.6.2 on Drupal 7; PHP version is 5.3.29, safe mode is off and open_basedir is not set:</p>
  
  <p>When I try to upgrade through extensions manager I get: </p>
  
  <p>WARNING: The downloader may be unable to download files which require HTTP redirection. This may be a configuration issue with PHP's open_basedir or safe_mode.</p>
  
  <p>Unable to extract the extension.</p>
  
  <p>Extension Upgrade Failed
  Download failed - ZIP file is unavailable or malformed</p>
  
  <p>Also, the scheduled jobs for iatapayments fail:</p>
  
  <p>Entity: Job Action: IatsRecurringContributions
  Summary
  Finished execution of Call Job.IatsRecurringContributions API with result: Failure, Error message: API (Job, iatsrecurringcontributions) does not exist (join the API team and implement it!)
  Details</p>
  
  <p>Parameters parsed (and passed to API method): 
  a:1:{s:7:"version";i:3;}</p>
  
  <p>Full message: 
  Finished execution of Call Job.IatsRecurringContributions API with result: Failure, Error message: API (Job, iatsrecurringcontributions) does not exist (join the API team and implement it!)</p>
  
  <p>I believe problems must be related. Anyone know how to resolve this? I believe my resource directories and urls are configured properly. Everything is in the right place.</p>
  
  <p><img src="https://i.sstatic.net/fvSXr.png" alt="enter image description here"></p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-06-07T23:02:29.690Z
Comments.Text: Can u add your civicrm version and the cms you are running it with
Comments.UserDisplayName: Donald Lobo
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-06-08T07:11:54.503Z
Comments.Text: Do you have ftp access and could you check wether the Iats payment extension is still there? It looked like your code files might be broken but that is my first guess
Comments.UserDisplayName: Jaap Jansma - CiviCooP
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-06-08T10:54:10.010Z
Comments.Text: Thanks. The files are definitely there. Put them there myself. I can't use the extension manager, so I have to manually put the files in place.
Comments.UserDisplayName: John Richardson
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-06-08T19:19:18.047Z
Comments.Text: Still struggling with this :(. The scheduled jobs are there, in their proper place, but the scheduled job cron does not find them. Any thoughts? Other jobs are found and executed, just not those two.
Comments.UserDisplayName: John Richardson
Tags: <civicontribute><extension><cron-job>
Title: Extension Manager fails and so do certain scheduled jobs
ThreadText: # Extension Manager fails and so do certain scheduled jobs
  
  (Asked by: username_0 on 2015-06-07)
  
  I am using civicrm ver. 4.6.2 on Drupal 7; PHP version is 5.3.29, safe mode is off and open\_basedir is not set:
  
  When I try to upgrade through extensions manager I get:
  
  WARNING: The downloader may be unable to download files which require HTTP redirection. This may be a configuration issue with PHP's open\_basedir or safe\_mode.
  
  Unable to extract the extension.
  
  Extension Upgrade Failed
  Download failed - ZIP file is unavailable or malformed
  
  Also, the scheduled jobs for iatapayments fail:
  
  Entity: Job Action: IatsRecurringContributions
  Summary
  Finished execution of Call Job.IatsRecurringContributions API with result: Failure, Error message: API (Job, iatsrecurringcontributions) does not exist (join the API team and implement it!)
  Details
  
  Parameters parsed (and passed to API method):
  a:1:{s:7:"version";i:3;}
  
  Full message:
  Finished execution of Call Job.IatsRecurringContributions API with result: Failure, Error message: API (Job, iatsrecurringcontributions) does not exist (join the API team and implement it!)
  
  I believe problems must be related. Anyone know how to resolve this? I believe my resource directories and urls are configured properly. Everything is in the right place.
  
  ![enter image description here](https://i.sstatic.net/fvSXr.png)
  
  **Tags:** civicontribute, extension, cron-job
  
  > **Comments:**
  > **username_1**: Can u add your civicrm version and the cms you are running it with  
  > **username_2**: Do you have ftp access and could you check wether the Iats payment extension is still there? It looked like your code files might be broken but that is my first guess  
  > **username_0**: Thanks. The files are definitely there. Put them there myself. I can't use the extension manager, so I have to manually put the files in place.  
  > **username_0**: Still struggling with this :(. The scheduled jobs are there, in their proper place, but the scheduled job cron does not find them. Any thoughts? Other jobs are found and executed, just not those two.  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_3 on 2015-06-09. Score: 6
  
  I was able to reproduce your issue and fix it on my Linux install.
  
  1. It seems to only happen with Linux, not MacOSX.
  2. I can fix it by changing the filename of the job to be first letter caps only, i.e. not camel case. Don't make any other changes.
  
  Following the advice in various other locations, including civix or related issues, does not fix it (shortening, changing to all lower case, etc.).
  
  I think part of the noise of this issue is related to changes in the upcoming v4 api which are not true of the v3 api that were introduced in 4.6.
  
  My suspicion is that this patch is responsible for breaking things:
  <https://github.com/colemanw/civicrm-core/commit/bfcb4795c83dc61e854f4268ef149b6c761636aa>
  
  
  ---
  
  ### Answer by username_4 on 2015-06-09. Score: 1
  
  There seem to be two issues in the question:
  
  1) Downloads in the extension manager fail on HTTP redirection (which in turn causes the malformed zip issue).
  
  * It sounds like you already know how to work-around this issue -- by manually putting the files in place. If using this technique, you should do it consistently (for both installation and upgrade).
  * See also: <https://issues.civicrm.org/jira/browse/CRM-14126>
  
  2) The API call used by the cron job is missing/unknown. This sounds like a bug for which you may want to [report](https://github.com/iATSPayments/com.iatspayments.civicrm/issues), but there are a few areas one might investigate:
  
  * The current iATS module ([v1.3.2](https://github.com/iATSPayments/com.iatspayments.civicrm/blob/1.3.2/info.xml)) does not advertise compatibility with Civi v4.6. The unreleased [master](https://github.com/iATSPayments/com.iatspayments.civicrm/blob/master/info.xml) version does (but it's... unreleased).
  * That API action has a long, multiword name. Civi v4.6 tightened the way it handles these kinds of names. <https://issues.civicrm.org/jira/browse/CRM-15988>
  * That API action has a long, multiword name. Calling that API requires translating from the API name (`Job.IatsRecurringContributions`) to a filename (`api/v3/Job/IatsRecurringContributions.php`). This is susceptible to edge-cases involving filename case-sensitivity (where, eg, an API+filename might work in OSX but fail in Linux).
  
  > **Comments:**
  > **username_3**: Hey Tim - thanks for these notes about the 4.6 changes to the API. Early on, I broke the civix naming conventions by starting some of my filenames with lower case (a possibly misguided attempt to adhere to some branding requirements ...), I wonder if that's part of the story? I'll check your links for further clues.  
  > **username_3**: The first answer is correct, but the second answer has a few red herrings and should be updated.  
  > **username_5**: The downloading of extensions issue has been broken for me for quite some time. If I remember it broke around 4.5 early in that cycle of releases.  
  
  ---
  
  ### Answer by username_6 on 2015-06-11. Score: 0
  
  I *was* having the same iATS Payment issue. I looked at what Alan [said](https://civicrm.stackexchange.com/a/3117/159), then renamed the Job file name, the actual .php files in the iATS Extension folder (…custom\_ext/com.iatspayments.civicrm/api/v3/Job/) and now it works!
  
  
  ---
  
  ### Answer by username_7 on 2015-06-09. Score: 0
  
  ad 1) did you do a complete rm -r everything iATS code files that you had downloaded via the Manage Extensions GUI before you unzip-ed the 1.3.2-zip file? Did you add 4.6 to its info.xml file [it only contains labels 4.4 and 4.5]? Did you clear all CiviCRM caches and go back to the Manage Extensions GUI screen and run the database updates [you had mentioned to us you upgraded from well before 1.3.2 - I bet you there are likely some of these to be dealt with].
  
  I think the reason the automated process failed may very well be b/c 1.3.2 is indeed not labeled as compatible with your CiviCRM core - so it's trying to stop you from installing it.
  
  ad 2) I would not recommend git clone master at this point - in addition to working on testing all 21 payment pathways in 4.6.x - Alan is working on adding Direct Payment Method [comes with lots of JS edits in lots of places] and I'm working on adding in some new extensive reporting features. There is just a lot going on right now. And unreleased (not in our test matrix yet).
  
  I'll try and reproduce your issue (installing the 1.3.2 on a 4.6.x) - If I can reproduce it I'll work on that and make it a patch re: scheduled jobs - code edits from 4.4./4.5 to 4.6 - a patch which you would then need to manually apply to your 1.3.2
  
  **New:**
  
  3. Try deleting the iATS scheduled jobs from your /civicrm/admin/job?reset=1 - and then manually add them [using the Add New Scheduled Job button]. I just ran iATS 1.3.1 jobs on a 4.6.4ish (see screenshot).
  4. Obviously that's a workaround - we need to dig deeper to find out why these jobs don't survive the upgrade better. Perhaps scheduled jobs get stored elsewhere/differently in the CiviCRM db compared to 4.4/4.5?
  
  ![enter image description here](https://i.sstatic.net/zCeUP.png)
  ![enter image description here](https://i.sstatic.net/Zpnud.png)
  
  > **Comments:**
  > **username_0**: K! will try it! Sounds very promising. It occured to me to do that very thing awhile back, just never did. I'll report back in a few...  
  > **username_0**: I am getting: "Given API command is not defined" Error. I am putting: "Job" and "IatsRecurringContributions" in the API call fields. i.e. "api.job.IatsRecurringContributions" in the API call. What's wrong?  
  > **username_7**: Let me add another screenshot to my post.  
  > **username_7**: PS - I just confirmed that adding 1.3.2 to a new D7/4.6.4-ish scheduled the iATS scheduled jobs are working fine on OS X [relevant b/c of Tim's note above].  
  > **username_0**: Still get error.  
  > **username_0**: See my screen shot above in the original post.  
  > **username_0**: My issue is apparently an old one. Don't know why I am still having it: https://issues.civicrm.org/jira/browse/CRM-10790  
  > **username_3**: No, not the same issue. Just a similar symptom.  
  
  ---
  
  