Package Details: nextcloud-news-updater 11.0.0-5

Git Clone URL: https://aur.archlinux.org/nextcloud-news-updater.git (read-only, click to copy)
Package Base: nextcloud-news-updater
Description: A parallel feed updater for the Nextcloud News app
Upstream URL: https://github.com/nextcloud/news-updater
Keywords: news nextcloud python updater
Licenses: GPL3
Submitter: ilpianista
Maintainer: dvzrv
Last Packager: dvzrv
Votes: 7
Popularity: 0.000088
First Submitted: 2016-06-14 21:32 (UTC)
Last Updated: 2022-03-19 17:54 (UTC)

Latest Comments

1 2 Next › Last »

doragasu commented on 2023-01-09 08:00 (UTC)

I'm having the same problem with Command '['php', '-f', '/usr/share/webapps/nextcloud/occ', 'news:updater:before-update']' failing. I have tried running the command manually, and I get the following error:

$ sudo -u http occ news:updater:before-update
Sorry, user http is not allowed to execute '/usr/bin/php -c /etc/php/php.ini /usr/share/webapps/nextcloud/occ news:updater:before-update' as nextcloud on rpi4-aarch64.

Looks like a permissions problem, but I have no clue how to fix it.

williamvds commented on 2020-11-03 21:10 (UTC) (edited on 2020-11-03 21:10 (UTC) by williamvds)

@dvzrv No, I don't recall seeing it. I may have just missed it, or yeah, maybe the warning was introduced after I first installed the package.
As community/nextcloud installs to /usr/share/webapps/nextcloud I think it'd be sensible to allow access to /usr/share/webapps/nextcloud/{data,apps} by default. I imagine the most common use-case is to run the updater on the same computer that's running a Nextcloud instance, and allowing access to it means a zero-configuration install for most people.
The warning message could then tell you to run systemctl edit nextcloud-news-updater and give an example. That'd help people who've never edited a systemd unit before and doesn't know how to use ReadWritePaths.

dvzrv commented on 2020-11-02 22:32 (UTC) (edited on 2020-11-02 22:33 (UTC) by dvzrv)

@williammvds: Did the install message not trigger for you?

Guess I need to add that message also to post_upgrade()!

williamvds commented on 2020-11-02 21:42 (UTC)

I was running into the same errors as below when the updater tries to run occ news:updater:before-update. Running manually with sudo -u http occ news:updater:before-update worked fine, so it's a problem with the systemd unit. Editing the unit file to run just $ occ news:updater:before-update, Nextcloud complains about lack of access to the data and apps directories. I added permissions to read the nextcloud/data and nextcloud/apps directories with $ systemctl edit nextcloud-news-updater:

[Service]
ReadWritePaths=/usr/share/webapps/nextcloud/data /usr/share/webapps/nextcloud/apps

Now the service executes successfully.

rEnr3n commented on 2019-01-11 11:11 (UTC)

I tried to use singlerun but still not working. I just got more logs.

Jan 11 18:51:01 server nextcloud-news-updater[29222]: 2019-01-11 18:51:01,449 - Nextcloud News Updater - ERROR - Command '['php', '-f', '/usr/share/webapps/nextcloud/occ', 'news:updater:before-update']' returned non-zero exit status 1.: Trying again in 30 seconds
Jan 11 18:51:01 server nextcloud-news-updater[29222]: Traceback (most recent call last):
Jan 11 18:51:01 server nextcloud-news-updater[29222]:   File "/usr/lib/python3.7/site-packages/nextcloud_news_updater/api/updater.py", line 69, in run
Jan 11 18:51:01 server nextcloud-news-updater[29222]:     self.before_update()
Jan 11 18:51:01 server nextcloud-news-updater[29222]:   File "/usr/lib/python3.7/site-packages/nextcloud_news_updater/api/cli.py", line 73, in before_update
Jan 11 18:51:01 server nextcloud-news-updater[29222]:     self.cli.run(self.api.before_cleanup_command)
Jan 11 18:51:01 server nextcloud-news-updater[29222]:   File "/usr/lib/python3.7/site-packages/nextcloud_news_updater/api/cli.py", line 12, in run
Jan 11 18:51:01 server nextcloud-news-updater[29222]:     return check_output(commands)
Jan 11 18:51:01 server nextcloud-news-updater[29222]:   File "/usr/lib/python3.7/subprocess.py", line 395, in check_output
Jan 11 18:51:01 server nextcloud-news-updater[29222]:     **kwargs).stdout
Jan 11 18:51:01 server nextcloud-news-updater[29222]:   File "/usr/lib/python3.7/subprocess.py", line 487, in run
Jan 11 18:51:01 server nextcloud-news-updater[29222]:     output=stdout, stderr=stderr)
Jan 11 18:51:01 server nextcloud-news-updater[29222]: subprocess.CalledProcessError: Command '['php', '-f', '/usr/share/webapps/nextcloud/occ', 'news:updater:before-update']' returned non-zero exit status 1.
Jan 11 18:51:01 server systemd[1]: nextcloud-news-updater.service: Succeeded.

dvzrv commented on 2019-01-10 11:36 (UTC)

@rEnr3n that's odd indeed! I'm using it with singlerun mode and the systemd timer unit (as all I have is timers). Have you tried that as well?

It would be interesting to find out, if there's something weird underlying or whether it's only the endless mode not working properly.

FWIW, I also don't use the user and password and am able to run it locally!

rEnr3n commented on 2018-12-24 03:12 (UTC)

I use the nextcloud package in the official arch repo. I only use nginx and php-fpm. Necessary extensions are enabled in php.ini. I didn't setup the username/password before since the docs say it is only used when using REST API. I set the username/password and the url and it's working. I don't understand this. My nextcloud and this updater are on the same machine so the console API should work fine but it's not. It's requiring me to use REST API.

This command works: sudo -u http nextcloud-news-updater --threads 2 --apilevel v1-2 --loglevel info --interval 1800 --mode endless /usr/share/webapps/nextcloud

The systemd service does not work. Here is my nextcloud-news-updater.ini:

[updater]
# only needed when using the REST API
#user = admin
# only needed when using the REST API
#password = admin
# how many threads to use
threads = 2
# update interval in seconds
interval = 1800
# 'info' for logging accessed urls, 'error' to only log errors
loglevel = error
# absolute path or url to nextcloud instance (url, when using the REST API)
url = /usr/share/webapps/nextcloud
#url = https://nextcloud.lan
# absolute path to custom php.ini
#phpini = /etc/webapps/nextcloud/news/php.ini
# v1-2 is the current version, v2 is only a draft
apilevel = v1-2
# 'endless' (script handles update interval itself) or 'singlerun' (when using systemd timer)
mode = endless
# path to php binary
#php = /usr/bin/php

timeout = 180

dvzrv commented on 2018-12-23 15:58 (UTC)

@rEnr3n: I'm a little confused, as to what you're using there. The service has ReadWritePaths=/etc/webapps/nextcloud /usr/share/webapps/nextcloud! Do you use the nextcloud package from [community]? How do you make nextcloud available? nginx+uwsgi? apache? Did you maybe forget to setup username/password in the .ini? Have you checked, that your php.ini (either /etc/php/php.ini or any specific one you specify in the package's configuration file) enables at least the curl, gd, iconv, pdo_mysql (if using mariadb), zip extensions? Without having them activated is the only way I can reproduce an error message such as the one you're describing (also: please always post full log outputs, not just one line!) Additionally, sorry for getting back so terribly late. I have a lot of packages and mails sometimes go unnoticed.

@doronbehar: NEXTCLOUD_CONFIG_DIR has been part of nextcloud since version 11.0.0: https://github.com/nextcloud/server/pull/660. Unless you don't use the nextcloud package from [community] this will work, so probably spend more time investigating before writing. The Environment= inclusion has nothing to do with @rEnr3n's problem AFAICS.

FWIW: I have successfully used the service since I wrote it and never ran into a problem. However, I also use a custom php.ini (located below /etc/webapps/nextcloud/news), because I don't want the service to YOLO load php modules, that it doesn't even need.

<deleted-account> commented on 2018-12-23 12:13 (UTC)

I've had the same problem myself. I've found out that the Environment= in the systemd service is what's causing this trouble. Try to remove it via systemctl edit or by directly changing the service file of the package.

This isn't documented upstream BTW. I have no idea why the @dvzrv has added this, I think it should be removed.

rEnr3n commented on 2018-07-09 08:01 (UTC)

I'm having problem with the systemd service.

Nextcloud News Updater - ERROR - Command '['/usr/bin/php', '-f', '/usr/share/webapps/nextcloud/occ', 'news:updater:before-update']' returned non-zero exit status 1.: Trying again in 30 seconds

I tried adding /etc /usr to ReadWritePaths= but it's still not working. I had to set ProtectSystem=off for it to work. Any ideas? I'm using Archlinux ARM.