Announcement

Collapse
No announcement yet.

Clean-up Jobs are being Failed.

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

  • Clean-up Jobs are being Failed.

    Hi,

    Clean-up Jobs are not working. I have 6 months of Action History and it's making DB huge. The Scheduled Clean-up Jobs are being failed.

    Please help me fix this problem. Is there any way to run clean-up manually?

  • #2
    Hi,

    What versino of EspoCRM? Any errors in log?

    Comment


    • #3
      Originally posted by yurikuzn View Post
      Hi,

      What versino of EspoCRM? Any errors in log?
      It's 5.4.3. But the issue is from the last 6 months.

      Comment


      • #4
        Hi jscoder ,

        I'm having the same issue with failed jobs for clean-up (version 5.5.1).

        Were you able to fix it?

        Thanks.

        Comment


        • #5


          Originally posted by jscoder View Post
          The Scheduled Clean-up Jobs are being failed.
          What about this error says in the Espo error log?
          Attached Files
          Last edited by yuri; 02-04-2019, 08:07 AM.

          Comment


          • #6
            Hi Maximus ,

            Thanks for your reply. When I check the logs from the EspoCRM admin panel it just shows 2 failed jobs and 1 pending (check attached screenshot). The is no errors at the data/logs folder.

            Looking at your screenshots, do you recommend removing (deleting) the logs for the cleanup job?

            Thanks a lot.

            Comment


            • #7
              Hi Pablo,
              yes, try to delete failed jobs manually.

              Comment


              • #8
                Hi Maximus

                Thanks for the help. I have deleted both failed job logs.

                Is there any way to execute the cleanup job manually? (or I have to wait until the end of this week? ).

                Thanks.

                Comment


                • #9
                  > Is there any way to execute the cleanup job manually?
                  No. But you can change scheduling of your job.

                  Deleting failed jobs shouldn't fix the problem.

                  Comment


                  • #10
                    Hi yuri ,

                    Thanks for your reply. Any other way we can fix this failed clean-up jobs? Or any other place/file we can check for errors?

                    Thanks.

                    Comment


                    • #11
                      Hi Pablo,

                      I think there must be something in data/log after a failed run.

                      Comment


                      • #12
                        Hi yuri ,

                        I found the following errors at the log files (for the specific day of the cleanup job). However, I don't think it's related to the cleanup issue:

                        Code:
                        [2019-02-02 19:27:37] Espo.ERROR: API [POST]:/LeadCapture/:apiKey, Params:Array (     [apiKey] => 5c55ee98e1800bb14 ) , InputData: {"test":true} - No appropriate data in payload. [] []
                        [2019-02-02 19:27:37] Espo.ERROR: Display Error: No appropriate data in payload., Code: 400 URL: /crmlinkport/api/v1/LeadCapture/5c55ee98e1800bb14 [] []
                        [2019-02-02 19:27:38] Espo.ERROR: API [POST]:/LeadCapture/:apiKey, Params:Array (     [apiKey] => 5c55ee98e1800bb14 ) , InputData: {"test":true} - No appropriate data in payload. [] []
                        [2019-02-02 19:27:38] Espo.ERROR: Display Error: No appropriate data in payload., Code: 400 URL: /crmlinkport/api/v1/LeadCapture/5c55ee98e1800bb14 [] []
                        [2019-02-02 19:27:51] Espo.ERROR: API [POST]:/LeadCapture/:apiKey, Params:Array (     [apiKey] => 5c55ee98e1800bb14 ) , InputData: {"test":true} - No appropriate data in payload. [] []
                        [2019-02-02 19:27:51] Espo.ERROR: Display Error: No appropriate data in payload., Code: 400 URL: /crmlinkport/api/v1/LeadCapture/5c55ee98e1800bb14 [] []
                        [2019-02-02 19:35:40] Espo.ERROR: API [POST]:/LeadCapture/:apiKey, Params:Array (     [apiKey] => 5c55ee98e1800bb14 ) , InputData: {"test":true} - No appropriate data in payload. [] []
                        [2019-02-02 19:35:40] Espo.ERROR: Display Error: No appropriate data in payload., Code: 400 URL: /crmlinkport/api/v1/LeadCapture/5c55ee98e1800bb14 [] []
                        [2019-02-02 19:35:53] Espo.ERROR: API [POST]:/LeadCapture/:apiKey, Params:Array (     [apiKey] => 5c55ee98e1800bb14 ) , InputData: {"test":true} - No appropriate data in payload. [] []
                        [2019-02-02 19:35:53] Espo.ERROR: Display Error: No appropriate data in payload., Code: 400 URL: /crmlinkport/api/v1/LeadCapture/5c55ee98e1800bb14 [] []
                        [2019-02-02 19:56:25] Espo.ERROR: API [POST]:/LeadCapture/:apiKey, Params:Array (     [apiKey] => 5c55ee98e1800bb14 ) , InputData: {"test":true} - No appropriate data in payload. [] []
                        [2019-02-02 19:56:25] Espo.ERROR: Display Error: No appropriate data in payload., Code: 400 URL: /crmlinkport/api/v1/LeadCapture/5c55ee98e1800bb14 [] []
                        Any recommendations?

                        Thanks a lot.

                        Comment


                        • #13
                          Weird. What you can try:

                          1.Set clean up job scheduling to * * * * *.
                          2. DIsable EspoCRM cron in crontab.
                          3. Run cron manually in CLI php cron.php. Maybe you will need to run it twice with 1 minute interval.
                          4. See what is printed in console.

                          Comment


                          • #14
                            Hi,
                            I see many post with scheduled job... before install pack, delete job and so ..
                            but it's simple to make this kind of think : (I do with my skill)
                            maybe out-of-box

                            PHP Code:
                            <?php
                            namespace Espo\Custom\EntryPoints;
                            class 
                            runSql extends \Espo\Core\EntryPoints\Base

                            {

                                public static 
                            $authRequired true;

                                public function 
                            run()

                                {

                                    
                            $pdo $this->getEntityManager()->getPDO();
                                     
                            $sql "TRUNCATE TABLE job";
                                     
                            $sth $pdo->prepare($sql);
                                     
                            $sth->execute();
                                     
                            $sql "TRUNCATE TABLE scheduled_job_log_record";
                                     
                            $sth $pdo->prepare($sql);
                                     
                            $sth->execute();
                                }
                            }

                            ?>

                            Comment


                            • #15
                              Hi yuri ,

                              I followed your instructions. At step #3 I had this error:

                              Code:
                              Fatal error: Call to undefined method PDOException::getRelationType() in /home2/linkport/public_html/crmlinkport/application/Espo/Jobs/Cleanup.php on line 415
                              Looking at line 415 of Cleanup.php I see:

                              if ($e->getRelationType($relation) !== 'manyMany') continue;

                              Any ideas to fix it?

                              Thanks a lot.

                              Comment

                              Working...
                              X