nextcloud / news-updater

:newspaper: Fast, parallel feed updater for the News app; written in Python
GNU General Public License v3.0
105 stars 24 forks source link

Script stop working after Debian 8 to 9 update. #10

Closed vlycop closed 7 years ago

vlycop commented 7 years ago

Hello. So i had the updater up and running for a week or two without issue, but i had to update from my debian 8 to 9. I didn't have to much issue, and i still run nextcloud 12 with php5 because i didn't configure php7.0 for now. I don't use any config file, only inline parameter. i also uninstall and reinstall the script with pip3 just to be sure.

This is what i run usealy in my systemd script

cat /etc/systemd/system/nextcloud-news-updater.service
[Unit]
After=default.target

[Service]
Type=simple
User=www-data
ExecStart=/usr/bin/nextcloud-news-updater /var/www/nextcloud/

[Install]
WantedBy=default.target

but for demo purpose, i will use sudo -u www-data to run command So if i run sudo -u www-data nextcloud-news-updater /var/www/nextcloud/ --loglevel info --mode singlerun i get :

2017-07-02 17:10:03,561 - Nextcloud News Updater - INFO - Running update once with 10 threads
2017-07-02 17:10:03,561 - Nextcloud News Updater - INFO - Running before update command: php -f /var/www/nextcloud/occ news:updater:before-update
2017-07-02 17:10:03,623 - Nextcloud News Updater - ERROR - Command '['php', '-f', '/var/www/nextcloud/occ', 'news:updater:before-update']' returned non-zero exit status 1: Trying again in 30 seconds
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/nextcloud_news_updater/api/updater.py", line 69, in run
    self.before_update()
  File "/usr/local/lib/python3.5/dist-packages/nextcloud_news_updater/api/cli.py", line 73, in before_update
    self.cli.run(self.api.before_cleanup_command)
  File "/usr/local/lib/python3.5/dist-packages/nextcloud_news_updater/api/cli.py", line 12, in run
    return check_output(commands)
  File "/usr/lib/python3.5/subprocess.py", line 316, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.5/subprocess.py", line 398, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['php', '-f', '/var/www/nextcloud/occ', 'news:updater:before-update']' returned non-zero exit status 1

i saw on the readme that it could be the php.ini, and i was thinking it might be using the php7 one now so i tried sudo -u www-data nextcloud-news-updater /var/www/nextcloud/ --loglevel info --mode singlerun --phpini /etc/php5/apache2/php.ini i don't really know if i should use the php5/cli one, but the result look the same.

2017-07-02 17:14:03,727 - Nextcloud News Updater - INFO - Running update once with 10 threads
2017-07-02 17:14:03,727 - Nextcloud News Updater - INFO - Running before update command: php -f /var/www/nextcloud/occ -c /etc/php5/apache2/php.ini news:updater:before-update
2017-07-02 17:14:03,941 - Nextcloud News Updater - ERROR - Command '['php', '-f', '/var/www/nextcloud/occ', '-c', '/etc/php5/apache2/php.ini', 'news:updater:before-update']' returned non-zero exit status 1: Trying again in 30 seconds
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/nextcloud_news_updater/api/updater.py", line 69, in run
    self.before_update()
  File "/usr/local/lib/python3.5/dist-packages/nextcloud_news_updater/api/cli.py", line 73, in before_update
    self.cli.run(self.api.before_cleanup_command)
  File "/usr/local/lib/python3.5/dist-packages/nextcloud_news_updater/api/cli.py", line 12, in run
    return check_output(commands)
  File "/usr/lib/python3.5/subprocess.py", line 316, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.5/subprocess.py", line 398, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['php', '-f', '/var/www/nextcloud/occ', '-c', '/etc/php5/apache2/php.ini', 'news:updater:before-update']' returned non-zero exit status 1

so i start to think it could be the fact that it's now ruining under python 3.5 ... but i don't really know how to check that.

I'm pretty sure i'v just miss and obvious, already explain issue, and i'm sorry if it's the case for the lost of time. Also, not English, and i'm very bad with conjugation in my own language, so i hop your eyes didn't bleed ^^'

BernhardPosselt commented 7 years ago

the reason is probably that your executable is not named php. You can try to fix that by simply linking whatever version you use to /usr/local/bin, e.g.

sudo ln -s /usr/bin/php7.0 /usr/local/bin/php
BernhardPosselt commented 7 years ago

I've published version 10.0.0 which lets you configure the binary path via parameter/config, check the readme

vlycop commented 7 years ago

Spot on. no quite sure what did i miss that made it soo obvious. i update and change the php to my php5 bin and it's work. php7.0 don't but i think it's about config ^^.

Thank you and have a nice day.