Announcement

Collapse
No announcement yet.

Workflows are not being triggered

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Workflows are not being triggered

    Hello,

    Problem1:
    I am not sure what happened but my workflow stopped working without any obvious reason. It was running every 10 minutes and now I am just checking it and last time when it was triggered was on the 8th of November. Till that time it was working without any problem. We have not changed anything connected with this workflow so I have no idea what could have gone wrong. Screen1 - settings of the workflow(it was working perfectly as you can see in the logs on screen2)

    Problem2:
    I am trying to run a scheduled workflow to update all opportunities. There is no complex action(screen3) and the target report contains approx 3000 opportunities. I was using tons of similar workflows in past without any problem. But this one just refuses to be triggered.

    Do you guys have any idea what could have happened that our scheduled workflow stopped working and I am not able to set a new scheduled workflow? Is there a possibility that we ran out of memory for logs or something like that? I am just not able to run a super simple workflow where I am 100% sure everything is set correctly.

    Thanks a lot for the investigation.

    edit: Now I am checking other workflows, and every scheduled workflow stopped working on the 8th of November. It looks like we really ran out of memory or something like that...
    Attached Files
    Last edited by Jakub Grufik; 11-11-2022, 10:08 AM.

  • #2
    Have you made un upgrade on that date? or installed a new extension at the same date?
    Software Engineering, working with Espocrm since 2014
    CEO @ Eblasoft Ltd.
    Contact Me

    Comment


    • #3
      eymen-elkum hello,

      we have not made any upgrades or installation of extensions in past 3 weeks.

      Comment


      • #4
        I had the same problem several times with clients, took lot of work and tries, then suddenly worked, I have no specific idea which action made it work, last time I made all the actions with no luck.
        Maybe Yuri have some insight on this
        Software Engineering, working with Espocrm since 2014
        CEO @ Eblasoft Ltd.
        Contact Me

        Comment


        • #5
          Hi Jakub Grufik,

          Please go to Administration > Scheduled Jobs > Run Scheduled Workflows Job and turn it off (change its status to Inactive), make a rebuild, then turn it back on (change its status to Active​). Then test the this Job on some test workflow (with * * * * * Scheduling, for example).

          Comment


          • eymen-elkum
            eymen-elkum commented
            Editing a comment
            Thank you for the information, I have tried steps with no change

        • #6
          hey lazovic, thanks a lot for the suggestion.

          Tried to follow your steps and it did not help.

          However, Run scheduled workflows seems to be working (screen1)
          Attached Files

          Comment


          • #7
            Jakub Grufik,

            Perhaps there is some information in the server logs and in the instance logs. You may need to turn on the debug mode for the logs so that we can get more information about this issue.

            Comment


            • #8
              I managed to make it work, but this is not the best solution:
              Go to the file application/Espo/Modules/Advanced/Jobs/RunScheduledWorkflows.php
              comment this line as in attached picture.

              yuri may have better idea how to solve it by updating the lastRun value on the record directly or something else.
              Attached Files
              Software Engineering, working with Espocrm since 2014
              CEO @ Eblasoft Ltd.
              Contact Me

              Comment


              • #9
                Hello,
                after upgrading to 7.2.7 still no change.

                If there is no other solution than commenting the line in code as suggested above, we will have to do it that way. yuri any insights, please?

                Comment


                • eymen-elkum
                  eymen-elkum commented
                  Editing a comment
                  I have uncomment the line and the problem still resolved, after 2 days

                • Jakub Grufik
                  Jakub Grufik commented
                  Editing a comment
                  oki, will try it then

              • #10
                eymen-elkum​ hello man, please could you help me on what are exact steps to be followed when I want to apply this change?(I am editing source code for the first time)

                I went to application/Espo/Modules/Advanced/Jobs/RunScheduledWorkflows.php downloaded that file, commented the line, uploaded edited file to the server and then rebuilt backend directly from CRM. Is it correct, please?

                edit: I am using FTP
                Last edited by Jakub Grufik; 11-15-2022, 09:53 AM.

                Comment


                • Jakub Grufik
                  Jakub Grufik commented
                  Editing a comment
                  I did this and unfortunately, workflows still do not work

              • #11
                I have finally access to the code, to error logs and everything so I am more than ready to solve this issue

                Comment


                • Jakub Grufik
                  Jakub Grufik commented
                  Editing a comment
                  hello man, could you help me a bit please? do I have to turn on debug mode to be able to get more information? another thing is: how to trigger some error logs for those scheduled workflows if they do not work? do you think there is some error log tracked at the time the workflow should actually run? thanks

                • rabii
                  rabii commented
                  Editing a comment
                  Yes if there is anything wrong with a specific scheduled cron job then it will provide info about what happened under data/logs this will give you an insight what went wrong. if you could share the log errors we might be able to figure out how it could fixed. Is it only workflow scheduled cron job that is not working or is it all scheduled cron jobs ?

                • Jakub Grufik
                  Jakub Grufik commented
                  Editing a comment
                  I am not sure tbh because atm we use mostly scheduled workflows..
                  it looks like the job "Run Scheduled Workflows" is somehow being triggered according to logs..it is being run every 5mins - just workflows dont work..
                  I can definitely share the logs, not sure if there will be enough info about the problem because I have not turned on the debug mode yet.

              • #12
                I found this in docs, but I have no idea how to follow necessary steps
                https://docs.espocrm.com/administrat...re-not-working

                Do you think it could be our problem?

                Comment


                • rabii
                  rabii commented
                  Editing a comment
                  did you try this https://docs.espocrm.com/administrat...re-not-working
                  also check under your setting if cron jobs are disabled.

                • Jakub Grufik
                  Jakub Grufik commented
                  Editing a comment
                  I did not because I have no clue how to log via SSH, iam using FTP.. I am more like pre-junior dev so there is a lot of things I am not experienced with that is why I am asking a lot about things that may seem simple to you

                • Jakub Grufik
                  Jakub Grufik commented
                  Editing a comment
                  Disable Cron is unchecked in settings so I think its OK

              • #13
                rabii here is the screen of logs for the job that seems to be triggered every 5 mins but is not running scheduled workflows as it should(probably).

                Here are logs for last week(scheduled workflows stopped working on 8th Nov) https://easyupload.io/m/134510

                Thanks a lot for your time!
                Attached Files

                Comment


                • #14
                  I found the cron.php file on our server. It does not contain the line mentioned in Administration->Scheduled Jobs
                  Code:
                  [B]* * * * * cd /data/7/5/7575340d-2d72-4955-9959-98ec6389749c/crmsys.sk/sub/esmero; /usr/php74/bin/php -f cron.php > /dev/null 2>&1[/B]​
                  But I was not the one who was implementing this system in our company so I have no clue if I am checking the correct file or not and if everything was set correctly at the beginning
                  Attached Files

                  Comment


                  • rabii
                    rabii commented
                    Editing a comment
                    Can you go to the CRM directory and check the data/logs this is where you will find the error logs of the CRM. see attached screenshot

                  • Jakub Grufik
                    Jakub Grufik commented
                    Editing a comment
                    it is attached in the previous reply above https://easyupload.io/m/134510

                • #15
                  rabii hello man, right now I turned on debug mode for logs so I can send you another logs in a few hours if you would be so kind and you will check it, please. I really need to resolve it asao because a lot of our workflows do not work at the moment and they are not working for 8 days already

                  Comment

                  Working...
                  X