-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot run backgroud jobs with cronjob #11638
Comments
GitMate.io thinks possibly related issues are #10748 (Background jobs fails (cron)), #8759 (Run cleanup of old upload parts in background job), #4179 (Cron jobs not running, and logs filled with "preg_match(): Unknown modifier '/' at..."), #7336 (Error while running background job (Doctrine\DBAL\Exception\DriverException):), and #10658 (Error while running background job (OCP\AutoloadNot AllowedException): Autoload path not allowed). |
Exactly the same issue for me. Any idea to solve it? [23-Oct-2018 20:15:02 UTC] PHP Fatal error: Uncaught Error: Call to a member function getLogger() on null in /home/*/public_html/oecloud/cron.php:160 |
Does 'cron.php' run OK without errors from the terminal? Type Try these cron tasks; Now from terminal Try; This lists three different versions of php on my shared host so cron could be calling a different version/build of php to the one used in your terminal or nextcloud site.
Also consider something that does not need to know the nextcloud foldername; Thinking ahead, once your nextcloud instance is using cron correctly, it might be a good idea to remember to remove/disable the task before performing any future upgrades in case it runs during the upgrade. I make a clone of my nextcloud and database to test upgrades nowadays as there is always the possibility of a backup not restoring. It might also be wise to disable any automatic update features in whatever auto installer you used such as softaculous or installatron. Personally I have found installing sfuff fthis way problematic and do not use anymore and they arent usually up-to-date versions. Better to create DB and DB user yourself, wget the latest package and extract from the terminal. |
I think some people having this error may have a different version of php set for /etc/alternatives than is enabled in apache, but I can't add answers to the following questions due to the site being readonly:
I fixed the error by making sure /etc/alternatives and apache were running the same version of php (this makes sure all the same modules that correctly run nextcloud also are available to /usr/bin/php:
sudo apache2ctl -M | grep php
/usr/bin/php --version If they don't match, update-alternatives, replacing X.X with the version found in (2) above: sudo update-alternatives --set php /usr/bin/phpX.X (Ubuntu 18.04 Bionic Beaver) @nix155 @nextcloud-bot Why was #7336 closed without a reason for closing provided? My solution can resolve "PHP Fatal error: Uncaught Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occured in driver: could not find driver in ..." in the case that the problem does not lie in Nextcloud like in my case. OPTIONAL: Change php version for everything (do not do the method below unless you know what you're doing, otherwise change 7.1 in the following back to X.X found above: ver=7.2
sudo update-alternatives --set php /usr/bin/php$ver
echo "If you use PostgreSQL as your backend, also run:"
echo "sudo apt install php$ver-pgsql"
sudo apt install php$ver-mysql
sudo a2dismod php7.3
sudo a2dismod php7.2
sudo a2dismod php7.1
# AND any other versions you may have enabled,
# or next line will have error saying phpX.X already enabled!
sudo a2enmod php$ver
# next 9 lines are from https://docs.nextcloud.com/server/14/admin_manual/installation/source_installation.html#ubuntu-installation-label
sudo apt install apache2 mariadb-server libapache2-mod-php$ver
sudo apt install php$ver-gd php$ver-json php$ver-mysql php$ver-curl php$ver-mbstring
sudo apt install php$ver-intl php-imagick php$ver-xml php$ver-zip
sudo a2enmod rewrite
sudo a2enmod headers
sudo a2enmod env
sudo a2enmod dir
sudo a2enmod mime
sudo a2enmod ssl
# sudo apt install php$ver-sqlite3
echo "also run: sudo apt -y install php$ver-pgsql # as needed if you use that for Nextcloud"
# sudo apt install php$ver-mysql
# sudo apt install php$ver-pgsql
sudo systemctl restart apache2 |
Steps to reproduce
* * * * * /usr/bin/php7.1 -f /homepages/32/d672527826/htdocs/nextcloud/cron.php
(Every minute for easier debugging)Expected behaviour
The background jobs should be run
Actual behaviour
The cron.php script has a fatal error
Server configuration
Web server: Shared hosting
Database: mysql 5.5.60
PHP version: 7.2.10
Nextcloud version: 14.0.1.1
Updated from an older Nextcloud/ownCloud or fresh install: Fresh install
Where did you install Nextcloud from: Official webpage installer for shared hosting
Signing status:
Signing status
List of activated apps:
App list
All the apps activated by default and no others
Nextcloud configuration:
Config report
Are you using external storage, if yes which one: no
Are you using encryption: I'm using hsts?
Are you using an external user-backend, if yes which one: No
Client configuration
Browser: Firefox 62.0.3
Operating system: Windows 10
Logs
Nextcloud log
The nextcloud log stays empty when this issue happens
Cron error message
The text was updated successfully, but these errors were encountered: