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

Can't add new feed #732

Closed
Andreabont opened this issue Feb 14, 2015 · 20 comments
Closed

Can't add new feed #732

Andreabont opened this issue Feb 14, 2015 · 20 comments

Comments

@Andreabont
Copy link

Hi,

I'm using Owncloud 8 with the last git version of the news app (commit 1029392)

When i try to add a new feed, the app fails with the error: "Bigger than maximum allowed size".

This is my config.ini:

autoPurgeMinimumInterval = 60
autoPurgeCount = 100
maxRedirects = 100
maxSize = 10000000000
exploreUrl =
feedFetcherTimeout = 60

Can you help me? Thank you.

@BernhardPosselt
Copy link
Contributor

Can you post the feed URL?

@Andreabont
Copy link
Author

The issue occurs with almost all feed, here an example:
http://www.ansa.it/sito/notizie/topnews/topnews_rss.xml

@BernhardPosselt
Copy link
Contributor

Works perfectly fine here. It could be that the number that you've entered in your config is bigger than a 32 or 64 bit integer, overflows and becomes a smaller or even negative number.

Can you try to delete your config file to go back to the default?

@BernhardPosselt
Copy link
Contributor

If that does not help please post more information about your server by following the guideline outlined in the readme

@Andreabont
Copy link
Author

After setting the config file to the default values the issue still occurs.

I use on my server:

  • Owncloud 8 (clean install)
  • App News (git version, commit bec3f91)
  • PHP 5.4.37-1
  • MySql 5.1.73
  • Debian (kernel 2.6.32)

I use on my client:

  • Firefox 35
  • OpenSuse

This is my owncloud.log:
{"reqId":"df4ea123566dcf43b616abf18e620aa5","remoteAddr":"93.36.89.176","app":"lock","message":"INFO: Read lock requested for /www/owncloud-data/news/config/config.ini","level":0,"time":"2015-02-15T13:52:27+00:00","method":"POST","url":"/index.php/apps/news/feeds"}
{"reqId":"df4ea123566dcf43b616abf18e620aa5","remoteAddr":"93.36.89.176","app":"lock","message":"PASS: Acquired read lock for /www/owncloud-data/news/config/config.ini","level":0,"time":"2015-02-15T13:52:27+00:00","method":"POST","url":"/index.php/apps/news/feeds"}
{"reqId":"df4ea123566dcf43b616abf18e620aa5","remoteAddr":"93.36.89.176","app":"lock","message":"INFO: Incrementing lock type 1 count for /www/owncloud-data/news/config/config.ini","level":0,"time":"2015-02-15T13:52:27+00:00","method":"POST","url":"/index.php/apps/news/feeds"}
{"reqId":"df4ea123566dcf43b616abf18e620aa5","remoteAddr":"93.36.89.176","app":"lock","message":"INFO: Releasing locks on /www/owncloud-data/news/config/config.ini","level":0,"time":"2015-02-15T13:52:27+00:00","method":"POST","url":"/index.php/apps/news/feeds"}
{"reqId":"df4ea123566dcf43b616abf18e620aa5","remoteAddr":"93.36.89.176","app":"lock","message":"INFO: Released lock handle Resource id #559 on /www/owncloud-data/news/config/config.ini","level":0,"time":"2015-02-15T13:52:27+00:00","method":"POST","url":"/index.php/apps/news/feeds"}
{"reqId":"df4ea123566dcf43b616abf18e620aa5","remoteAddr":"93.36.89.176","app":"lock","message":"FREE: Released locks on /www/owncloud-data/news/config/config.ini","level":0,"time":"2015-02-15T13:52:27+00:00","method":"POST","url":"/index.php/apps/news/feeds"}
{"reqId":"df4ea123566dcf43b616abf18e620aa5","remoteAddr":"93.36.89.176","app":"news","message":"Pi\u00f9 grande della dimensione massima consentita","level":0,"time":"2015-02-15T13:52:27+00:00","method":"POST","url":"/index.php/apps/news/feeds"}

---- UPDATE ----

I found in the php log the following error:
PHP Notice: Uninitialized string offset: 12 in /www/owncloud/3rdparty/ircmaxell/random-lib/lib/RandomLib/Generator.php on line 168

This may be related?

@BernhardPosselt
Copy link
Contributor

cc @LukasReschke

Hm, actually no idea, also cc @fguillot

Can you log out the max size, by putting this line

error_log($config->getMaxSize());  // goes to your httpd error log and not the data/owncloud.log

here: https://github.com/owncloud/news/blob/master/appinfo/application.php#L190 ?

@Andreabont
Copy link
Author

This is the result:
[Sun Feb 15 20:25:04 2015] [error] [client 93.36.89.176] 10385760, referer:

that matches with the config file:
maxSize = 10385760

@Andreabont
Copy link
Author

The exception 'MaxSizeException' is caught in the file fetcher/feedfetcher.php

I log the stack trace and this is the result:
/www/owncloud/apps/news/vendor/fguillot/picofeed/lib/PicoFeed/Client/Curl.php(184): PicoFeed\Client\Curl->handleError(23)\n
#1 /www/owncloud/apps/news/vendor/fguillot/picofeed/lib/PicoFeed/Client/Curl.php(202): PicoFeed\Client\Curl->executeContext()\n
#2 /www/owncloud/apps/news/vendor/fguillot/picofeed/lib/PicoFeed/Client/Client.php(238): PicoFeed\Client\Curl->doRequest()\n
#3 /www/owncloud/apps/news/vendor/fguillot/picofeed/lib/PicoFeed/Reader/Reader.php(71): PicoFeed\Client\Client->execute('http://www.ansa...')\n
#4 /www/owncloud/apps/news/vendor/fguillot/picofeed/lib/PicoFeed/Reader/Reader.php(85): PicoFeed\Reader\Reader->download('http://www.ansa...', NULL, NULL)\n
#5 /www/owncloud/apps/news/fetcher/feedfetcher.php(78): PicoFeed\Reader\Reader->discover('http://www.ansa...', NULL, NULL)\n
#6 /www/owncloud/apps/news/fetcher/fetcher.php(53): OCA\News\Fetcher\FeedFetcher->fetch('http://www.ansa...', true, NULL, NULL)\n
#7 /www/owncloud/apps/news/service/feedservice.php(103): OCA\News\Fetcher\Fetcher->fetch('http://www.ansa...')\n
#8 /www/owncloud/apps/news/controller/feedcontroller.php(136): OCA\News\Service\FeedService->create('http://www.ansa...', 0, 'andreabont', NULL)\n
#9 [internal function]: OCA\News\Controller\FeedController->create('http://www.ansa...', 0, NULL)\n
#10 /www/owncloud/lib/private/appframework/http/dispatcher.php(158): call_user_func_array(Array, Array)\n
#11 /www/owncloud/lib/private/appframework/http/dispatcher.php(86): OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\News\Controller\FeedController), 'create')\n
#12 /www/owncloud/lib/private/appframework/app.php(97): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\News\Controller\FeedController), 'create')\n
#13 /www/owncloud/lib/private/appframework/routing/routeactionhandler.php(44): OC\AppFramework\App::main('FeedController', 'create', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)\n
#14 [internal function]: OC\AppFramework\routing\RouteActionHandler->__invoke(Array)\n
#15 /www/owncloud/lib/private/route/router.php(250): call_user_func(Object(OC\AppFramework\routing\RouteActionHandler), Array)\n
#16 /www/owncloud/lib/base.php(763): OC\Route\Router->match('/apps/news/feed...')\n
#17 /www/owncloud/index.php(36): OC::handleRequest()\n
#18 {main}

As you can see there is a curl error 'CURLE_WRITE_ERROR' (23)

@BernhardPosselt
Copy link
Contributor

Do you have enough ram/disk space?

@BernhardPosselt
Copy link
Contributor

Do you use the encryption app?

@Andreabont
Copy link
Author

I've ~90 Mb of free ram, and I use the encryption app on the current owncloud account. The hdd have a lot of Gb free.

@BernhardPosselt
Copy link
Contributor

Can you disable the encryption app? News is not tested against it and I highly discourage from using it.

@Andreabont
Copy link
Author

I disabled the encryption and file lock apps, but the bug still persists. Seems to be a problem with the curl module, but i don't know what the 'CURLE_WRITE_ERROR' error means.

@Andreabont
Copy link
Author

In apps/news/vendor/fguillot/picofeed/lib/PicoFeed/Client/Curl.phpthe curl are set to use a callback function:
curl_setopt($ch, CURLOPT_WRITEFUNCTION, array($this, 'readBody'));

As written in the documentation: "Your callback should return the number of bytes actually taken care of. If that amount differs from the amount passed to your callback function, it'll signal an error condition to the library. This will cause the transfer to get aborted and the libcurl function used will return CURLE_WRITE_ERROR."

The question is: why the callback return the wrong length?

@BernhardPosselt
Copy link
Contributor

You could try to log out if this section is ever run https://github.com/fguillot/picoFeed/blob/master/lib/PicoFeed/Client/Curl.php#L63

@BernhardPosselt
Copy link
Contributor

If it is not then we know it does not have anything to do with the maximum size

@BernhardPosselt
Copy link
Contributor

I suspect that it could be a too little RAM issue. Can you try it on a system with 512mb free ram?

@Andreabont
Copy link
Author

I correctly log $length before the last return (https://github.com/fguillot/picoFeed/blob/master/lib/PicoFeed/Client/Curl.php#L67), so isn't a maximum size issue.

I can't increase ram, my owncloud instance run in a vps. I can try to free other ram.

@Andreabont
Copy link
Author

RESOLVED

In my PHP config was enabled the 'mbstring.func_overload' option, this broke some PHP code.

Disabling that option has resolve the issue.

Thanks for the support

@cosenal
Copy link
Contributor

cosenal commented Feb 17, 2015

@Andreabont cool! Closing this.

P.S.: btw, thanks for the detailed reporting.

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

No branches or pull requests

3 participants