Skip Navigation

[Resolved] WP All Export Pro Cron job to hit Cron URL not working unless I deactivate Types

This thread is resolved. Here is a description of the problem and solution.

Problem:
You have a CPT created by Types, and deny read permissions to guests using Access to that CPT, then Export CRON Jobs run with the WP All Import plugin, do run, but do not export anything.

As soon as Access grants read permissions for guests on that CPT, OR Access is disabled, OR Access is restricting read access but you run the CRON manually in the Browser (logged in), the CRON properly runs and exports entries successfully.

Solution:
Set "read" to true for CPT guests permissions (CRON is a guest šŸ™‚ )

There is one more solution, create a role copy of administrator, create a user and write a small plugin to open a session when WP runs from CRON. 'DOING_CRON' constant will help.

This support ticket is created 6 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 ā€“ 20:00 14:00 ā€“ 20:00 14:00 ā€“ 20:00 14:00 ā€“ 20:00 14:00 ā€“ 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Tagged: 

This topic contains 55 replies, has 3 voices.

Last updated by lindsayH 6 years, 1 month ago.

Assisted by: Beda.

Author
Posts
#1108138

We cannot replicate this.

We will set up a server, you will have to replicate the issue there with the Plugins you mention, and we will fix it.

The data is on its way, please stand by.

#1108143
Bildschirmfoto 2018-09-14 um 14.55.26.png

I will need the exact data below for the CRON Job settings:
- Command
- Input to command
- When to execute
(See image attached)

I will then set up the CRON.

On the WordPress install, there is already Types and the PRO version of the export plugin.
Please set the things up so to replicate the issue (Post types, else needed)

If there is something missing let me know, I can add.
As soon I have your data, I can add the CRON.

I sent you the login data to the email of yours as you use it for this forum.
It would be nice if you could update the plugin, as I have no license.

#1108199
WP All Export - Manage Reports.png

Dear Beda

Information you requested.

Trigger URL:
hidden link
Every 24 hours

Processing URL:
hidden link
Every two minutes

More information here: hidden link
Also Scheduling Options link on the right under Info & Options in All Export > Manage Exports, select the option 'Manual Scheduling' for the URLs required - as above.

I added one Sen* Employee; Employee Name and Employee Registration Date - see screen dump and created a report in WP All Export in the back end. 1 Records Exported. This always works, it's the CRON jobs that fail. (Note: it's not exactly as I have it as can't import Forms - but for purposes of testing it should be OK).

I've updated WP All Export Pro.

Many thanks for your help.

#1108215

Thanks, also for setting up the missing parts in the site.

Something is still missing.

The CRON itself.

1. The Plugin's DOC you and the plugin link me to is always referring to IMPORTS, never exports.
2. The Plugin's DOC states:
Examples are on the Manage Imports -> Cron Scheduling screen of WP All Import.
I have no such Screen in the EXPORT plugin we installed.
There are no examples.
3. Finally, the Plugin itself, which is the main responsible for these tasks, does not provide those CRON's either, it is hence not expected to be something that the Plugin's Support Provides, even less Toolset Support could craft those.
4. The Plugin recommends:
To ask your web hosting provider to set up the cron for you, use this e-mail template:
(etc etc)

Now, I can create a CRON event for this test, but I do need to know the exact CRON command suggested for this.
I did create one, and Hope I did it right:

1. CRON one, every 24 hours (midnight of every day) with a command:

curl ''

2. CRON two, every 2 minutes, with a command:

curl ''

BUT:
- I cannot save the Export hidden link to use the manually scheduled event. It simply won't let me save it in the "Scheduling Options " PopUp under the "Info & Options" Column.
- I do not know where to put this additional information the plugin provides in the above-mentioned PopUp:
-- Trigger URL
(I did put that in CRON one, curl '')
-- Processing URL
(I did put that in CRON two, curl '')
File URL
(What should I do with this URL? Does it need a CRON as well to be created, or similar?)
Bundle URL
(Same, is this relevant?)

We have by now the site setup, the plugin instaled and the export created, the CRONs as well, but I do not see how to connect those now.
The CRON will run the first at midnight, I think (Should be GMT)

I hope I got it all right, please let me know if not, and I hope I can understand the difference if Import/Export as mentioned above after your reply šŸ™‚
I probably just miss a detail.

#1108231

1. The Plugin's DOC you and the plugin link me to is always referring to IMPORTS, never exports.
I think they use the same instructions for both. The link is on the Exports plugin. When I manually run these URLs it works perfectly.

2. The Plugin's DOC states:
Examples are on the Manage Imports -> Cron Scheduling screen of WP All Import.
I have no such Screen in the EXPORT plugin we installed.
There are no examples.
I think it's here: All Export > Manage Exports, select the option 'Manual Scheduling'

3. Finally, the Plugin itself, which is the main responsible for these tasks, does not provide those CRON's either, it is hence not expected to be something that the Plugin's Support Provides, even less Toolset Support could craft those.
They provide the CRON URLs exactly as should be used in each site's setup? Not sure what you mean here (sorry). Again if I run the URLs manually it works and also if I disable Types the CRON jobs work perfectly.

4. CRON jobs can be set up as outlined earlier in this support ticket. I'll find it and paste in below.

I hope this all helps.

#1108236

1. Great, thanks for lifting this doubt šŸ™‚
2. I think it's here: All Export > Manage Exports, select the option 'Manual Scheduling'
But should that not be the actual "setting"?
I mean, those are no curl CRON examples, that is the data I need to craft the CRON.
However, I kind of agree with you, probably they mean that.
Which is the reason I cannot "save" it
3. I mean, they state, "If you need a CRON; ask your server admin". They don't provide help or assistance with, so Toolset cannot either (however we will)
4. I could not find instructions for the particular details I asked in the thread, maybe I miss them.

Is the CRON setup as you did it as well on your server?
I assume you just did "nothing" with File URL and Bundle URL?

Then all is fine and the CRON will run this midnight, let's see what it does.

#1108237

You can use curl or wget - so for example you use
curl 'hidden link'

I add this to CRON jobs in cPanel (it's a 'manual setup' and not done within WP All Export).

Hope this helps.

#1108767

I thinkt he CRON run:
hidden link
Last run: 09/15/2018 12:02 am
1 Records Exported
Format: csv

This issue seems not replicable, can you confirm?

In that case you will need to review this externally as it does not seem due to the Toolset

Please let me know if I miss a detail.

#1108827

Yes, it appears so. But earlier on in this call that was confirmed - but my own setup was going to be looked at by 2nd tier.

I still feel it is something to do with Toolset (or a combination of factors including Toolset) for the reasons listed below.

1. If I deactivate just the Toolset Types plugin the Cron jobs work as expected, (it runs because the external SQL query remains).

2. Post Types if registered manually the Cron jobs work, even if Types is active.

3. If I run the URLs manually all is OK.

#1110203

I not sure what you mean, what was confirmed?

Related to the 2nd Tier having a Look at your site, this is actually what happened (I am 2nd Tier), but as well, I forwarded this to the Developers, as stated here:
https://toolset.com/forums/topic/wp-all-export-pro-cron-job-to-hit-cron-url-not-working-unless-i-deactivate-types/page/2/#post-871969

However you clearly mentioned, the Developers should not act directly on the site:
https://toolset.com/forums/topic/wp-all-export-pro-cron-job-to-hit-cron-url-not-working-unless-i-deactivate-types/page/2/#post-867268

Hence, the Developer replicated the site, and was not able to replicate the issue:
https://toolset.com/forums/topic/wp-all-export-pro-cron-job-to-hit-cron-url-not-working-unless-i-deactivate-types/page/3/#post-1108138

Since neither 2nd Tier, nor the Developer, where able to replicate this, our only hope is/was to replicate this with a online site (copy of yours or similar to) - which shows it working here:
https://toolset.com/forums/topic/wp-all-export-pro-cron-job-to-hit-cron-url-not-working-unless-i-deactivate-types/page/3/#post-1108767

This points more and more towards a clear Server issue, or similar, that is not related to Toolset directly.

However, if we can see or replicate this issue, we may be able to spot a problem, but until now we cannot see the issue, hence we cannot solve it.

I will have to remove that test site soon, as it is not welcomed if I leave it unsupervised.

It is difficult for us to resolve this, since we have no replicable issue.
If we cannot replicate this on the site either, it means that probably there is a problem with the specific server you use, which we cannot assist with, unfortunately.

Please let me know if you require the test site for more time, otherwise I will have to remove it.

#1110376

Sorry I wasn't clear, it was confirmed that it ran OK in your setup #618957.

It seems strange that a manually added Post Type (with Toolset Types still active) will run OK and also when I deactivate just the Toolset Types plugin the Cron jobs work as expected.

I've setup using hidden link and this also fails (i.e. 0 Records Exported) - so this isn't running on the server? Could it be an access problem, though if I run 'manually' from the browser all works fine?

I will ask my hosting if they have any ideas at all.

I could give you access to the live site, BUT if you wanted to change anything (adding CRON jobs in the cPanel would be fine, but anything else that would\could affect database structure etc) we'd have to arrange a time either outside working hours in the UK or a specific time where I could ask them not to use. Either way I'd want to create a full backup beforehand.

Many thanks for your continued help.

#1112720

I do understand that this is indeed strange, but I checked again on the Test Site I provided, and the status is:

Last run: 09/21/2018 12:02 am
1 Records Exported
Format: csv

It runs fine I think.

We need this issue replicated to fix it.
We cannot do single Server Adjustments or Support tasks (https://toolset.com/toolset-support-policy/), but we surely want to be sure this is not a Toolset issue.
Please let me know what your Server Admins feedback, and if somehow possible, you should have a Test Instance for this Site, in any case, for future cases - because updating on live sites will sooner or later end up in a complex problem.

I suggest creating a testing instance, on your server, confirm the problem there as well, and with that we would have steps and site to solve the problem
However I strongly believe the testing site would not throw such issues, I suspect this is either the specific server, instance, or eventually a setting on your posts types, like hidden from/in queries, or similar, however, since you replicated the same kind of content on our test site and there all works fine, everything points to another issue (server, unique plugin or theme used on your site, etc)

#1112835

Hi, I've talked to our hosting provider, but we can't see that there is any issue there.

I then thought I'd set up a batch file or use Task Scheduler as appeared to be running fine when manually passing the URLs to a browser. From this I've discovered that if I run manually in a browser, it ONLY works if Iā€™m logged in to the backend of WordPress AND the trigger and processing URLS are also run in the same browser that Iā€™m logged in with.

So I don't think that it's a cron job issue per se. Maybe a permissions issue of some sort. I've referred this new finding also to WP All Export.

I'm still doing some investigative work, but will look at duplicating the site also if nothing turns up or I can't come up with an alternative.

Thank you for your continued support.

#1113072
Access Control - Employee Work Type.png

I have created a staging site, which has not yet resolved the DNS for the new domain name, but I amended my hosts file so I could investigate further.

I began to think about permissions and therefore Toolset's Access Control. It appears that if I change Managed by Access in Access Control in the Employee's Work Type to Use the default WordPress read permissions (changed from Managed by Access) it does appear to work.

As soon as the DNS is up, I'll send you the details of the staging site... but if you have any ideas re the above that would be good.

#1113582

I see, so this is as I outlined earlier, a permission issue

I asked you to replicate this issue on our test server and I thought that was the case, however, I think Access rules were not setup there as required to replicate this issue?
Can you do so, so we can fix this issue?

Best would be, as discussed, to replicate the situation on the test server, which we kindly provide and I keep online for now.

Please feedback here when the issue is replicated on the test site we provide, or, if you have concise access setting (I cannot guess, or copy by "see and have a look", I will need precise settings instructions), I can set them for you on the test site, then we can wait again until the CRONs fire and hopefully have replicable steps by then.

I assume it to be very possible that you simply control those types or exclude them from the query as I outlined in earlier replies to check on your live site.

Hence, the solution would then be to remove such restrictions or re-add the types to the respective queries.