Package Details: nextcloud-news-updater 11.0.0-5

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

Latest Comments

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:

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/", 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/", line 73, in before_update
Jan 11 18:51:01 server nextcloud-news-updater[29222]:
Jan 11 18:51:01 server nextcloud-news-updater[29222]:   File "/usr/lib/python3.7/site-packages/nextcloud_news_updater/api/", 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/", 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/", 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:

# 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: 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.

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.

ajdunevent commented on 2017-02-22 17:34 (UTC)

@dvzrv: Sorry, didn't see your comment until now. My Nextcloud config was inherited from an ownCloud setup so that probably explains where I got the idea. My comment was only intended to help others who might have run into a similar problem; it wasn't intended as a criticism. Anyway, I appreciate the update and your previous work!

dvzrv commented on 2017-02-17 17:23 (UTC)

Updated NEXTCLOUD_CONFIG_DIR in coherence with the nextcloud community package to be /etc/webapps/nextcloud/config.

dvzrv commented on 2017-02-09 22:19 (UTC)

@adjunevent: Are you using nextcloud from the AUR? If so, that would be weird, as there is no /etc/webapps/nextcloud/config setup for NEXTCLOUD_CONFIG_DIR (yet). It really depends on where you place your config.php. For myself, I setup /etc/webapps/nextcloud as NEXTCLOUD_CONFIG_DIR... I guess it should become /etc/webapps/nextcloud/config though, if you want to follow the way owncloud is packaged. Unfortunately nextcloud is not properly packaged to reflect that.

ajdunevent commented on 2017-02-09 14:33 (UTC)

To get the console API (recommended over REST API) to work, I had to create a systemd override with: [Service] Environment=NEXTCLOUD_CONFIG_DIR=/etc/webapps/nextcloud/config

dvzrv commented on 2017-02-08 19:44 (UTC)

@disastro: The location is settable with the ini file. If you're using the systemd service file and want to use a non-webapps location, you'll have to adapt the security settings ( accordingly. Those settings are there for a reason! You can read up on them using `man 5 systemd.exec`. For you "ReadWritePaths" will be of interest (and probably setting your NEXTCLOUD_CONFIG_DIR environment properly).

disastro commented on 2017-02-08 17:12 (UTC) (edited on 2017-02-08 17:30 (UTC) by disastro)

Could this maybe come with a configurable Nextcloud location? EDIT: Although it's beyond me why you have so many systemd stuff in the service. worked when your original service file failed with nextcloud in a different folder.