Jump to content
  • 0

Cron Task Stuck


jkirk001

Question

I realize there was another post regarding "cron stuck". But, that post died off with no response from OP. So, I thought I'd create a new post that hopefully will resolve my problem and help others having similar issue. The service that is stuck: "Provision Paid Pending Services" has been running for over an hour now. What do I need to do to resolve this?

Link to comment
Share on other sites

20 answers to this question

Recommended Posts

  • 0

Thanks Licensecart for your quick response.

 

Running the query gives a #1064 syntax error regarding near 'Limit 0, 30'. Looks like fun. The only thing that has changed between now and the when it worked was my changing email addresses in email templates to drop sub domain. When I tried to change "Edit Email Template Auto-Debit-Pending" I received "Template parse error: unexpected character in filters : "&" at 32".  At the time, I didn't think much of it. But now, it appears the two are very much related. So, it looks like I'll be busy fixing the parse error. Hopefully, that will help resolve the cron problem. Only problem is, I've not been able to find the proper file to fix said parse error.

Link to comment
Share on other sites

  • 0

Running the query gives a #1064 syntax error regarding near 'Limit 0, 30'. Looks like fun.

 

The query LicenseCart linked to doesn't contain a LIMIT clause. Make sure you run the query exactly as it's written.

 

When I tried to change "Edit Email Template Auto-Debit-Pending" I received "Template parse error: unexpected character in filters : "&" at 32".  At the time, I didn't think much of it. But now, it appears the two are very much related. So, it looks like I'll be busy fixing the parse error. Hopefully, that will help resolve the cron problem. Only problem is, I've not been able to find the proper file to fix said parse error.

 

When you receive a parse error when editing an email template, the template doesn't save until you resolve the error. If, for some reason, that parse error still exists in that email template, you will need to fix it. Edit the email template under [settings] -> [Emails]. A parse error occurs when you have entered invalid tag syntax--i.e. everything between an open and close brace: {}. The error you encountered suggests you have an invalid ampersand set.

 

You said that you edited the "Auto Debit Pending" email template when you received the parse error, but the cron task for "Provision Paid Pending Services" is failing. That cron task does not send that email template, so I am more inclined to believe that you have a problem with one of these email templates instead:

  • Service Creation (or the package welcome email set for one of the package's that attempted to get provisioned)
  • Suspension Error
  • Unsuspension Error
  • Creation Error
  • Cancellation Error
Link to comment
Share on other sites

  • 0

Unfortunately, I have yet to properly resolve this issue. Cron has been working properly only after changing emails back to @subdomain.domain.com. I am using the default email template:

Hi {contact.first_name},

This is a reminder that a payment is scheduled to be charged to your account on {autodebit_date} in the amount of {amount_formatted} for invoice #{invoice.id_code}.

{% if payment_account.account_type == "ach" %}Your {payment_account.type} Account ending in {payment_account.last4} will be processed on this date. If we should use a different payment method, or if you need to make a change to this account, please login to our client area at http://{client_url} to make the correction at your earliest convenience.{% else %}Your {payment_account.type} ending in {payment_account.last4} will be processed on this date. If we should use a different payment method, or if you need to make a change to this account, please login to our client area at http://{client_url} to make the correction at your earliest convenience.{% endif %}

If you'd like to disable automatic payments, you may do so by logging into your account at http://{client_url}.

Thank you for your continued business!

I can find no ampersand set here. Only if I delete the if...else statement, will it save and allow cron to properly run with emails changed to @domain.com. But, this is not viable solution. Maybe I'm missing something here. But; since all emails are default, I would think changing emails from @subdomain.domain.com to @domain.com shouldn't have any effect on cron or email templates. At this point I am at a loss.

Link to comment
Share on other sites

  • 0

You're right, the behavior you're experiencing doesn't make sense.

 

Did you check both the "HTML" and "Text" versions of the email template? Are you using multiple languages in your installation, or just English, US?

 

Are you sure the "Scheduled Payment Reminder" email template is the one causing the issue? This template is only sent, at most, once a day to specific clients that have an open invoice and a payment account set for autodebit--and then, it is only sent X number of days before the invoice is automatically set to be autodebited as defined in your payment due notice settings. All of these criteria can make it difficult to consistently test whether this is the offending template.

 

I would try to run the query to check the cron log again:

SELECT * FROM `log_cron` WHERE `run_id` !=0 AND `end_date` IS NULL ORDER BY `start_date` DESC LIMIT 0,30;

Or try using a database tool (e.g. phpmyadmin) to check the `log_cron` table for tasks whose `end_date` column contains NULL.

Link to comment
Share on other sites

  • 0

Found two that did not run:  "Apply Payments to Open Invoices Oct 01, 2015 10:46:32 AM" & "Provision Paid Pending Services Oct 02, 2015 5:46:35 AM". This happened only after I changed email addresses to @domain.com. Only using English. The "Scheduled Payment Reminder" does not allow edit and only saves when I completely remove the "HTML" or delete the "if...else" statement from "HTML". Other templates affected by "if...else" include: "An order has been received" & "An order has been received (mobile)".

Link to comment
Share on other sites

  • 0

Found two that did not run:  "Apply Payments to Open Invoices Oct 01, 2015 10:46:32 AM" & "Provision Paid Pending Services Oct 02, 2015 5:46:35 AM". This happened only after I changed email addresses to @domain.com.

 

Changing the address shouldn't affect whether it leads to an error. Did you look over the Service Creation email template as well as the Package Welcome Email template(s) from which the pending services would be created? Do they contain any invalid tags/syntax issues?

 

What would be best is to see the exact error that is caused when the cron is running those tasks. You should first enable PHP error_reporting by updating your config file (/config/blesta.php). At the top, there should be this line:

Configure::errorReporting(0);

Change it to:

Configure::errorReporting(-1);

Since those two failed tasks currently have a NULL `end_date`, you can physically delete those, and ONLY those, records from the `log_cron` table. What you should then do is run the cron manually from [settings] -> [system] -> [Automation] immediately, before the automatic cron tries to run them again. By running it manually, any errors that are encountered will be displayed in your browser.

 

 

The "Scheduled Payment Reminder" does not allow edit and only saves when I completely remove the "HTML" or delete the "if...else" statement from "HTML". Other templates affected by "if...else" include: "An order has been received" & "An order has been received (mobile)".

 

Updating those email templates does not save? What is the error?

 

The conditional syntax, i.e. if..else, must follow the correct format and end with a concluding endif. The concluding endif is what most people seem to overlook when making changes. See Customizing Emails.

e.g.

{% if invoice.status == 'active' %}
This invoice is active.
{% else %}
This invoice is not active.
{% endif %}
Link to comment
Share on other sites

  • 0

Unfortunately, since the HTML has been deleted and I am unable to put them back in place, running cron manually produces:

"Attempting to run all tasks for Kirkpatrick & Davis, LLC.
All tasks have been completed.
Attempting to run all system tasks.
All system tasks have been completed".

 

Any attempt to edit those email templates produce: "Template parse error: unexpected character in filters : "&" at 32". All if...else statements are concluded with {% endif %}. Service created email template and Package welcome email templates contain no errors. At this point, it is tempting to backup my client theme, delete Blesta and its database, and start from scratch. One last ditch effort before moving on. I really don't want to have to switch to different CRM, But if all else fails, I see no other option.

Link to comment
Share on other sites

  • 0

Well, this isn't good. After clean install, I am unable to make ANY changes (content or email address) to "Scheduled Payment Reminder", "An order has been received", or "An order has been received (mobile)". Even without any packages or services, I should at least be able to change the email address.

Link to comment
Share on other sites

  • 0

Well, this isn't good. After clean install, I am unable to make ANY changes (content or email address) to "Scheduled Payment Reminder", "An order has been received", or "An order has been received (mobile)". Even without any packages or services, I should at least be able to change the email address.

 

Sounds like you are missing a file or your database is corrupted.

Link to comment
Share on other sites

  • 0

Yes, it would seem so.  Except:

1. Blesta and database were both completely removed.

2. This is a clean install (including database).

3. Everything is default configuration.

4. This problem persists regardless of Softaculous or manual install.

 

For whatever reason Blesta does not properly function for me. In spite of my liking how it looks and feels, I cannot allow that to interfere with business decisions. I shouldn't have to fight my way through a program to force it to work properly, I've spent way too much time on this. Time to cut my losses and move on.

Link to comment
Share on other sites

  • 0

Regarding e-mail template issue I was able to reproduce error with e-mail template in your post and I got same error as you(Template parse error: unexpected character in filters.......),fix is simple just switch to source(first icon in html editor) and than add your code and it shoud work(It work for me at least).When you add/paste new lines in HTML editor it add also span tags,<p> tags, "&" character insted space..etc.

 

Screen S.

 

When add/paste directly in to HTML gives error

scrr.jpg

 

Switch to Source

scrr0.jpg

 

 

Now work

scrr1.jpg

 

Link to comment
Share on other sites

  • 0

As nelsa pointed out, copying/pasting HTML into the WYSIWYG editor is not satisfactory because it can produce alternative HTML, different from what you've pasted, which may create invalid tag syntax. For instance, it might enter a paragraph inside a tag and produce something like "{%<p> if invoice.status == 'active' %}</p>". This is not visible except when viewing the Source, so it is always best to make direct HTML changes while in Source mode. I presumed the OP's issue was experienced with default templates, but I'm more convinced this is the cause instead.

Link to comment
Share on other sites

  • 0

Thank you for your replies. Licensecart - I agree with your practice of pasting it in the text tab first and then copy/paste into html. It usually does work. Tyson - Not trying to be argumentative, but; it was not a copy/paste issue. This IS caused by the default template. It never accepted ANY modification of content or change of email address. Had it allowed for changes, I might be able to understand your position. But, blaming the user is NEVER a good method in support or customer service.

 

That being said, I have moved on and switched to a different CRM.
 

Link to comment
Share on other sites

  • 0

Thank you for your replies. Licensecart - I agree with your practice of pasting it in the text tab first and then copy/paste into html. It usually does work. Tyson - Not trying to be argumentative, but; it was not a copy/paste issue. This IS caused by the default template. It never accepted ANY modification of content or change of email address. Had it allowed for changes, I might be able to understand your position. But, blaming the user is NEVER a good method in support or customer service.

 

That being said, I have moved on and switched to a different CRM.

 

 

Nobody is blaming you, we're just trying to help figure out the issue. If you open a ticket with your Blesta login details, I would be happy to take a look and see if I can determine the cause.

Link to comment
Share on other sites

  • 0

Thank you for your replies. Licensecart - I agree with your practice of pasting it in the text tab first and then copy/paste into html. It usually does work. Tyson - Not trying to be argumentative, but; it was not a copy/paste issue. This IS caused by the default template. It never accepted ANY modification of content or change of email address. Had it allowed for changes, I might be able to understand your position. But, blaming the user is NEVER a good method in support or customer service.

 

That being said, I have moved on and switched to a different CRM.

 

 

No-one has blamed you (user) it's normally the simplest reason though, two customers had issues one was a incorrect password, the other was copy and pasting pure html. So you never know.

Link to comment
Share on other sites

  • 0

Nobody is blaming you, we're just trying to help figure out the issue. If you open a ticket with your Blesta login details, I would be happy to take a look and see if I can determine the cause.

I did open a ticket (Ticket #1853980) on 10/02. You replied to initial entry. I replied with more info. It has now been 4 days without a reply from you. As for nobody blaming me, it sure comes across as if he is doing just that.

 

No-one has blamed you (user) it's normally the simplest reason though, two customers had issues one was a incorrect password, the other was copy and pasting pure html. So you never know.

I've been it the IT industry since 1995. I too have had many occasions where customers would make simple mistakes (incorrect passwords, unplugged systems and wondering why system won't boot, monitor unplugged, etc). Yes, the simplest errors tend to be the cause of most problems. And the simple solutions tend to be the correct solutions. But I NEVER blamed them or even insinuated it might have been their fault. To do so is just bad form. That's Customer Service-101.

Link to comment
Share on other sites

  • 0

I did open a ticket (Ticket #1853980) on 10/02. You replied to initial entry. I replied with more info. It has now been 4 days without a reply from you. As for nobody blaming me, it sure comes across as if he is doing just that.

Blesta only reply in the opening hours so after 5pm PST they won't reply until 9am Monday.

 

I've been it the IT industry since 1995. I too have had many occasions where customers would make simple mistakes (incorrect passwords, unplugged systems and wondering why system won't boot, monitor unplugged, etc). Yes, the simplest errors tend to be the cause of most problems. And the simple solutions tend to be the correct solutions. But I NEVER blamed them or even insinuated it might have been their fault. To do so is just bad form. That's Customer Service-101.

If you think they are blaming you, I feel sorry for you. Really do, if you think asking if you've done a simple task is blaming you, then you need to learn how to provide support… How did you ask your clients if they tried it? Because maybe they thought you was blaming them.

Link to comment
Share on other sites

  • 0

I often find reading text to be a poor medium for communication. As 70% of communication is miscommunication, the lack of non-verbals, tone of voice, and propensity to read between the lines, the likelihood for miscommunication only increases and it can be easy to misinterpret the meaning of words to come to an alternate, and unfortunately mistaken, conclusion. I believe that is the case here, as I am not placing blame or fault on anyone. I am merely trying to gather information and offer possible solutions along with my reasoning behind them.

 

You mentioned:

 

This IS caused by the default template. It never accepted ANY modification of content or change of email address. Had it allowed for changes, I might be able to understand your position.

 

I just tested the email template on a new Blesta installation, but sadly, was unable to experience this issue myself. If it is indeed an issue with the default template, we would like to fix it immediately. That said, I have not had anyone else come forward yet with the same problem, so I only have your information to work from.

 

That being said, I have moved on and switched to a different CRM.

 

I wish you the best of luck with your new system.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...