Skip to content
This repository has been archived by the owner on Jul 6, 2020. It is now read-only.

News are not updating on 9.0.1 #971

Closed
dominik1984 opened this issue Apr 13, 2016 · 44 comments
Closed

News are not updating on 9.0.1 #971

dominik1984 opened this issue Apr 13, 2016 · 44 comments

Comments

@dominik1984
Copy link

Hello,

I am using ownCloud version 9.0.1 and somehow I am not getting the news updated.
I configured my own Webcon job which is called (verified) and returns "scuccess".

News version is 8.4.0

But the news in Owncloud are not upated.
I can see following error in log:

Failed opening '/owncloud/apps/news/templates/part.content.articleaction.php' for inclusion
or
Failed opening '/owncloud/apps/news/templates/part.content.subscription.php' for inclusion

I check the folder and these files are really not available.

Error comes from /owncloud/lib/private/template/base.php#161

Thanks

@BernhardPosselt
Copy link
Contributor

The part with the templates is fixed now.

Webcron is not supported so I can't help you there. If you need webcron use the updater described in the README

@dominik1984
Copy link
Author

Hello,

So how can I get the fix? And I am a little bit confused now regarding the Webcron. If I anable the built in feature I am getting a message that I should switch it off and use my own cron job.

@BernhardPosselt
Copy link
Contributor

There should be a yellow error message when you open the News app. I don't know what you mean by own cron.

@dominik1984
Copy link
Author

Hello
It is configured like this

image

image

The news are only updating if i click on the "fulltext search" icon. They are not loaded automatically and even not if I click on the reload icon.

Am Mi., Apr. 13, 2016 13:18 schrieb Bernhard Posselt : There should be a yellow error message when you open the News app. I don't know what you mean by own cron.

You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub (#971 (comment))

@BernhardPosselt
Copy link
Contributor

There is no reload icon

@dominik1984
Copy link
Author

I can see one:

image

@BernhardPosselt
Copy link
Contributor

That's update mode (hover over it) which only is used for marking articles unread if they changed. If you can create a better icon, feel free to create a PR.

@dominik1984
Copy link
Author

Oh ok - But the real issue is that the news are not updating automatically. my cron provider (all-inkl) can send an email whenever it is triggering the cron.php and I am receiving an email that the script has returned "success" every 15 minutes. But somehow the news are not getting updated. They are only updated if I click on the "fulltext search" icon or after removing and adding the RSS link

@BernhardPosselt
Copy link
Contributor

Did you go through https://github.com/owncloud/news#feeds-are-not-updated

The full text search redownloads all entries if you change it

@dominik1984
Copy link
Author

dominik1984 commented Apr 13, 2016 via email

@BernhardPosselt
Copy link
Contributor

Should not be an issue.

@dominik1984
Copy link
Author

dominik1984 commented Apr 14, 2016 via email

@BernhardPosselt
Copy link
Contributor

Did you follow my link to the readme?

Does the news app only works if I have the permissions to run my own cronjobs directly on the server?

The cronjob must be executed as the user that owns ownCloud (usually the webserver user). Ajax and Webcron mode will not update your feeds, however the News app provides it's own parallel webcron API that you can plug into, see https://github.com/owncloud/news-updater

@dominik1984
Copy link
Author

I do not have access to the server so I can not install this tool. Is there a way to use the Webcron job which will call every 15 min the cron.php to update the news as well?
###################
Dominik Wittmann
[email protected]
www.dominik-wittmann.de

Am Do., Apr. 14, 2016 08:34 schrieb Bernhard Posselt :

Did you follow my link to the readme?  

Does the news app only works if I have the permissions to run my own cronjobs directly on the server?  

The cronjob must be executed as the user that owns ownCloud (usually the webserver user). Ajax and Webcron mode will not update your feeds, however the News app provides it's own parallel webcron API that you can plug into, see https://github.com/owncloud/news-updater (https://github.com/owncloud/news-updater) 

—

You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub (#971 (comment))

@BernhardPosselt
Copy link
Contributor

You can install the tool on any server.

@BernhardPosselt
Copy link
Contributor

If by webcron you mean call an URL without passing any parameters, then no. There's an API that gives you the feed and user ids, then you can call a route with each pair to update the feed (which is what the tool does)

@dominik1984
Copy link
Author

dominik1984 commented Apr 14, 2016 via email

@BernhardPosselt
Copy link
Contributor

Yes, check the updater README. You will need to run the program using Python 3 however

@BernhardPosselt
Copy link
Contributor

So if you are saying that you can only run FTP, I doubt that you will be able to execute a Python script

@BernhardPosselt
Copy link
Contributor

TL;DR: You can't run the app on simple webhosting.
You either need:

  • System cron support on your webhosting
  • A second server that runs any program that can use the News app's update API

@BernhardPosselt
Copy link
Contributor

BTW, you could also write somehting similar to updater in Python in PHP, just no one did that yet ;)
That could enable webcron like what you're used to.

@dominik1984
Copy link
Author

dominik1984 commented Apr 14, 2016 via email

@BernhardPosselt
Copy link
Contributor

Won't work since webcron and ajax cron don't trigger feed updates anymore

@dominik1984
Copy link
Author

dominik1984 commented Apr 14, 2016 via email

@BernhardPosselt
Copy link
Contributor

No.

@dominik1984
Copy link
Author

I just tried it and it seems to work if I use the work arround.
The only problem is the yellow message which is shown if I use Webcron.
###################
Dominik Wittmann
[email protected]
www.dominik-wittmann.de

Am Do., Apr. 14, 2016 12:38 schrieb Bernhard Posselt :

No. 

—

You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub (#971 (comment))

@BernhardPosselt
Copy link
Contributor

It only works in the version you are currently using. Starting with 8.5.0 ajax and webcron won't trigger updates anymore. There are different issues when using webcron. The warning message is there for a reason ;)

@BernhardPosselt
Copy link
Contributor

You can patch everything manually but don't expect support ;)

@dominik1984
Copy link
Author

ok thanks for the update. It looks like I can not use this nice app. Thanks for all the support :-)
###################
Dominik Wittmann
[email protected]
www.dominik-wittmann.de

Am Do., Apr. 14, 2016 13:05 schrieb Bernhard Posselt :

You can patch everything manually but don't expect support ;) 

—

You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub (#971 (comment))

@dominik1984
Copy link
Author

Hi,

I got an response from my hoster. They are mentioning I shall try to call a phpx file. There I can call a python script with following syntax:

exec("/usr/bin/python Pfad zum Script 2>&1", $out, $result);

The PHP file I was able to generated but python is completly new to me. DO i need to download any .py file and link it from my PHPx file?

Thanks
###################
Dominik Wittmann
[email protected]
www.dominik-wittmann.de

Am Do., Apr. 14, 2016 13:05 schrieb Bernhard Posselt :

You can patch everything manually but don't expect support ;) 

—

You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub (#971 (comment))

@BernhardPosselt
Copy link
Contributor

Wow, that's a hack :)

Could work but you need python 3.2 and also the requests library. Im sure you can also get the requests library to work in a local folder but you'd have to Google how to do that.

Then it's probably very likely that your hoster disallowed it.

Are you familiar with php and json? An easier task would be to simply write a php script that calls the api routes (which then in turn can be called by any webcron)

@dominik1984
Copy link
Author

i am not really a php freak. am i really the only person who is using a shared host and the news app? ;)

so I will ask my hoster to install the request library. can you just help me with the required python script?

thanks

######################
Dominik Wittmann
[email protected]

Am 14.04.2016 um 19:17 schrieb Bernhard Posselt [email protected]:

Wow, that's a hack :)

Could work but you need python 3.2 and also the requests library. Im sure you can also get the requests library to work in a local folder but you'd have to Google how to do that.

Then it's probably very likely that your hoster disallowed it.

Are you familiar with php and json? An easier task would be to simply write a php script that calls the api routes (which then in turn can be called by any webcron)


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub

@BernhardPosselt
Copy link
Contributor

@BernhardPosselt
Copy link
Contributor

I took the time to write a PHP script which can be called by your webcron:

<?php
$baseCmd = 'php -f /path/to/your/owncloud/occ news:updater:';

exec($baseCmd . 'before-update');
exec($baseCmd . 'all-feeds', $feeds);
$feeds = json_decode($feeds[0], true)['feeds'];

foreach ($feeds as $feed) {
    exec($baseCmd . 'update-feed' . ' ' . $feed['id'] . ' ' . $feed['userId']);
}

exec($baseCmd . 'after-update');

Put that into a file called news-webcron.php inside your webroot and adjust the path to your owncloud (the thing in $baseCmd). Then you can call this file with your webcron

@BernhardPosselt
Copy link
Contributor

Thats the full API btw ;D

10 lines of PHP...

@BernhardPosselt
Copy link
Contributor

BernhardPosselt commented Apr 15, 2016

The above script is very simple btw. The one thing you may want to add is locking a file to prevent the script from being executed while it is running. And maybe fancy console parameters. And if you are freaky maybe use Threads for parallel updates which are in the pthreads extension which not everyone has access too.

Then again, all this has already been implemented in the Python version :) This should just give you an idea

@dominik1984
Copy link
Author

wooooow thanks so much. will this work with newer versions as well? ;)

######################
Dominik Wittmann
[email protected]

Am 15.04.2016 um 22:06 schrieb Bernhard Posselt [email protected]:

Thats the full API btw ;D

10 lines of PHP...


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub

@BernhardPosselt
Copy link
Contributor

Yes :)

@dominik1984
Copy link
Author

hello,

somehow the script is not working. I modified it a little bit to see if $feeds can be recieved but it looks like it is null always. Path to owncloud was modified of course :-)

if (is_array($feeds) || is_object($feeds))
{
foreach ($feeds as $feed) {
exec($baseCmd . 'update-feed' . ' ' . $feed['id'] . ' ' . $feed['userId']);
}
} else {
echo "problem";
}
###################
Dominik Wittmann
[email protected]
www.dominik-wittmann.de

Am Fr., Apr. 15, 2016 22:16 schrieb Bernhard Posselt :

Yes :) 

—

You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub (#971 (comment))

@dominik1984
Copy link
Author

I found the problem.

THe following script in console.php is causing the issue. I removed it and it worked

if (!function_exists('pcntl_signal') && !in_array('--no-warnings', $argv)) {
echo "The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php" . PHP_EOL;
}
###################
Dominik Wittmann
[email protected]
www.dominik-wittmann.de

Am Fr., Apr. 15, 2016 22:16 schrieb Bernhard Posselt :

Yes :) 

—

You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub (#971 (comment))

@BernhardPosselt
Copy link
Contributor

Yeah, webhosting sucks :(

@dominik1984
Copy link
Author

is there any fix for this console issue? :(
###################
Dominik Wittmann
[email protected]
www.dominik-wittmann.de

Am Sa., Apr. 16, 2016 12:28 schrieb Bernhard Posselt :

Yeah, webhosting sucks :( 

—

You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub (#971 (comment))

@BernhardPosselt
Copy link
Contributor

No idea, you are asking in the wrong repo :)

@yashha
Copy link

yashha commented Aug 20, 2017

Had the same problem with news app in nextcloud, thanks @BernhardPosselt :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants