Clean-up Jobs are being Failed.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jscoder
    Junior Member
    • Dec 2017
    • 7

    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?
  • yuri
    Member
    • Mar 2014
    • 8453

    #2
    Hi,

    What versino of EspoCRM? Any errors in log?
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • jscoder
      Junior Member
      • Dec 2017
      • 7

      #3
      Originally posted by yurikuzn
      Hi,

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

      Comment

      • Pablo
        Senior Member
        • Aug 2015
        • 177

        #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

        • Maximus
          Senior Member
          • Nov 2018
          • 2731

          #5


          Originally posted by jscoder
          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

          • Pablo
            Senior Member
            • Aug 2015
            • 177

            #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

            • Maximus
              Senior Member
              • Nov 2018
              • 2731

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

              Comment

              • Pablo
                Senior Member
                • Aug 2015
                • 177

                #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

                • yuri
                  Member
                  • Mar 2014
                  • 8453

                  #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.
                  If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

                  Comment

                  • Pablo
                    Senior Member
                    • Aug 2015
                    • 177

                    #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

                    • yuri
                      Member
                      • Mar 2014
                      • 8453

                      #11
                      Hi Pablo,

                      I think there must be something in data/log after a failed run.
                      If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

                      Comment

                      • Pablo
                        Senior Member
                        • Aug 2015
                        • 177

                        #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

                        • yuri
                          Member
                          • Mar 2014
                          • 8453

                          #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.
                          If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

                          Comment

                          • item
                            Active Community Member
                            • Mar 2017
                            • 1476

                            #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();
                                }
                            }
                            
                            ?>
                            If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

                            Comment

                            • Pablo
                              Senior Member
                              • Aug 2015
                              • 177

                              #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...