cuzy-app / cron-daemon

Cron daemon to execute cron jobs from an external cron service via an URL
1 stars 3 forks source link

STDERR is not defined in php-fpm (I guess it is the same for other non-cli php versions), so module doesn't work #3

Closed quoing closed 2 years ago

quoing commented 2 years ago

Any idea how to fix this?

# curl -H "Host: humhub.domain.tld" https://humhub.domain.tld/cron-daemon/external-service/run-cron {"name":"Exception","message":"Undefined constant 'STDERR'","code":0,"type":"Error","file":"/www/www/humhub-1.9.1/protected/vendor/yiisoft/yii2/console/Controller.php","line":323,"stack-trace":["#0 /www/www/humhub-1.9.1/protected/humhub/modules/search/Events.php(38): yii\\console\\Controller->stderr()","#1 [internal function]: humhub\\modules\\search\\Events::onHourlyCron()","#2 /www/www/humhub-1.9.1/protected/vendor/yiisoft/yii2/base/Event.php(312): call_user_func()","#3 /www/www/humhub-1.9.1/protected/vendor/yiisoft/yii2/base/Component.php(637): yii\\base\\Event::trigger()","#4 /www/www/humhub-1.9.1/protected/humhub/commands/CronController.php(102): yii\\base\\Component->trigger()","#5 /www/www/humhub-1.9.1/protected/humhub/commands/CronController.php(54): humhub\\commands\\CronController->runHourly()","#6 /www/www/humhub-1.9.1/protected/modules/cron-daemon/controllers/ExternalServiceController.php(36): humhub\\commands\\CronController->actionRun()","#7 [internal function]: humhub\\modules\\cronDaemon\\controllers\\ExternalServiceController->actionRunCron()","#8 /www/www/humhub-1.9.1/protected/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()","#9 /www/www/humhub-1.9.1/protected/vendor/yiisoft/yii2/base/Controller.php(181): yii\\base\\InlineAction->runWithParams()","#10 /www/www/humhub-1.9.1/protected/vendor/yiisoft/yii2/base/Module.php(534): yii\\base\\Controller->runAction()","#11 /www/www/humhub-1.9.1/protected/vendor/yiisoft/yii2/web/Application.php(104): yii\\base\\Module->runAction()","#12 /www/www/humhub-1.9.1/protected/vendor/yiisoft/yii2/base/Application.php(392): yii\\web\\Application->handleRequest()","#13 /www/www/humhub-1.9.1/index.php(25): yii\\base\\Application->run()","#14 {main}"]}

quoing commented 2 years ago

https://github.com/cuzy-app/humhub-modules-cron-daemon/pull/4

Probably solution, may need some testing.. it is working for my case.

quoing commented 2 years ago

after applying fix mentioned above I see

$ curl -H "Host: hubhub.domain.tld" http://humhub.domain.tld/cron-daemon/external-service/run-cron {"code":200,"message":"Daily/hourly cron jobs executed successfully!"}

marc-farre commented 2 years ago

Thanks @quoing Fixed on version 1.0.2 https://github.com/cuzy-app/humhub-modules-cron-daemon/releases/tag/1.0.2