Catchable fatal error with crontab

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PhilipB
    Junior Member
    • Jun 2019
    • 1

    Catchable fatal error with crontab

    Hello,
    I have a problem with the crontab. Since not all ssh commands are allowed on my server, I have to run the crons via a php file:

    <?php
    exec("/usr/bin/php -d memory_limit=1024M /www/***/***/espocrm/cron.php >> log.txt 2>&1");
    ?>

    As far everything is fine.
    But unfortunately, I get the following error message:

    PHP Catchable fatal error: Argument 1 passed to Espo\Core\Container::get() must be an instance of Espo\Core\string, string given, called in /www/***/***/espocrm/application/Espo/Core/Application.php on line 48 and defined in /www/***/***/espocrm/application/Espo/Core/Container.php on line 41

    Catchable fatal error: Argument 1 passed to Espo\Core\Container::get() must be an instance of Espo\Core\string, string given, called in /www/***/***/espocrm/application/Espo/Core/Application.php on line 48 and defined in /www/***/***/espocrm/application/Espo/Core/Container.php on line 41

    Line 48 is: $GLOBALS['log'] = $this->getContainer()->get('log');
    And line 41 is: public function get(string $name)

    Can someone help me with this?
    Thank you very much.
    Philip
  • Maximus
    Senior Member
    • Nov 2018
    • 2731

    #2
    Hello.
    Have you tried this way https://www.espocrm.com/documentatio...re-not-working?

    Comment

    • m@x
      Junior Member
      • Sep 2019
      • 2

      #3
      Hello, i have the same problem, when I try to execute via ssh cron.php on my shared hosting I recive the follow error:
      Catchable fatal error: Argument 1 passed to Espo\Core\Container::get() must be an instance of Espo\Core\string, string given, called in /home/crm/application/Espo/Core/Application.php on line 48 and defined in /home/public_html/crm/application/Espo/Core/Container.php on line 41
      My hosting cannot allow me to execute the script with other privileges.
      The same error it appears when I try to execut any php file in the folder.
      thanx in advantage if anyone can help me
      Last edited by m@x; 09-18-2019, 11:47 AM.

      Comment

      • hamilton
        Junior Member
        • Jul 2018
        • 16

        #4
        Hi,
        I have the same problem with CRON after update.

        "Catchable fatal error: Argument 1 passed to Espo\Core\Container::get() must be an instance of Espo\Core\string, string given, called in /home2/xxx/public_html/yyy/application/Espo/Core/Application.php on line 48 and defined in /home2/xxx/public_html/yyy/application/Espo/Core/Container.php on line 41"

        Could someone help?
        Regards,
        Hamilton

        Comment

        • hamilton
          Junior Member
          • Jul 2018
          • 16

          #5
          Originally posted by Maximus
          Yes, I already read it. And it is all good.
          The CRON was working good.

          Comment

          • m@x
            Junior Member
            • Sep 2019
            • 2

            #6
            I have found the solution with help of my hosting, the problem was the php version with which cron was run.
            I solved this problem by using php 7.1 to execute the command::

            php71 /www/public_html/espocrm/cron.php

            now work well
            Last edited by m@x; 10-25-2019, 10:34 AM.

            Comment

            Working...