Page 1 of 2

Argument 7 not passed to function

Posted: 11 Jun 2016, 15:13
by dariottolo
Hi all,

I am using the lastest git updated version of TT-Rss, on PHP 5.6.20 and PostgreSQL 9.4.7.

Attached is the dump of my "ttrss_error_log" table .

At some random times I find the entry in subject.

Any idea what might be the cause?

Thank you in advance.

Regards

Dario

Re: Argument 7 not passed to function

Posted: 11 Jun 2016, 15:55
by fox
the cause is that your php ignores error suppression (@ operator) used in that specific line for some reason. could be something in php.ini, idk really.

good news that it does not affect anything at all so you can just ignore this warning.

e: you can try adding @ above i.e.

Code: Select all

         $options = @array(
               "url" => func_get_arg(0),
               "type" => @func_get_arg(1),
               "login" => @func_get_arg(2),
               "pass" => @func_get_arg(3),
               "post_query" => @func_get_arg(4),
               "timeout" => @func_get_arg(5),
               "timestamp" => @func_get_arg(6),
               "useragent" => @func_get_arg(7)
         );


report back if it helps

Re: Argument 7 not passed to function

Posted: 11 Jun 2016, 17:07
by dariottolo


I think I edited /include/functions correctly.

Will report if it works or not.

So far no error in the logs.

Re: Argument 7 not passed to function

Posted: 12 Jun 2016, 12:51
by dariottolo
Just a quick update. I am pretty sure that Feed Debugger triggers the error.

If I run fD on any feed, with or without forcing refetch and rehash, once it completes, there is a new error in the error_log.

As you previously wrote, it does not break anything, so I will empty the logs every now and then.

Re: Argument 7 not passed to function

Posted: 12 Jun 2016, 13:47
by fox
doesn't happen here :(

Re: Argument 7 not passed to function

Posted: 20 Oct 2016, 09:25
by ManuelW
I get this error too on php5.5 and php5.6

E_WARNING (2) include/functions.php:359 func_get_arg(): Argument 7 not passed to function

It is spamming my error log

Re: Argument 7 not passed to function

Posted: 20 Oct 2016, 09:45
by fox
you might want to check your php configuration if @ (suppress warnings) operator is for some reason not working correctly on your install

as far as i can see there's no bug to be fixed here in tt-rss

e: if there's a stack trace post it here

Re: Argument 7 not passed to function

Posted: 22 Dec 2016, 14:11
by toomanyaccounts
Same problem, can't figure out why.

Could this be an issue with php7?

Using almost vanilla configuration (just activated some extra extensions, nothing exotic).

Re: Argument 7 not passed to function

Posted: 22 Dec 2016, 14:40
by fox
i'm on php7 and i don't get this warning

please investigate if you can

e: it would also help extremely if you could just play with @ operator in that location where error occurs to see if some placement magically fixes it (lol php)

Re: Argument 7 not passed to function

Posted: 22 Dec 2016, 21:44
by toomanyaccounts
Tried "debug-feed" on all feeds - but no "Argument 7 warning"... unless I did something wrong:

Code: Select all

$ echo "use ttrss; select id from ttrss_feeds;" | mysql | while read feed; do echo "feed: $feed"; php update.php --debug-feed $feed | grep "Argument 7 ";  done;

Wait, php warnings go to std that way, right? Aaah, doesn't matter. Haven't been able to figure out how @'s work. Or php for that matter.

Why use those @'s anyway? Doesn't something like this work instead?

Code: Select all

$opt_list = ["url", "type", "login", "pass", "post_query", "timeout", "timestamp", "useragent"];
$arg_list = func_get_args();
$options = array();
foreach ($arg_list as $key => $value) {
   $options[$opt_list[$key]] = $value;
}

( Tried it briefly and nothing caught fire. So far.... )

Re: Argument 7 not passed to function

Posted: 22 Dec 2016, 21:59
by fox
@ prefix is basically "no warnings on this please" and yet for some people it doesn't work, no idea why

Re: Argument 7 not passed to function

Posted: 26 Dec 2016, 01:46
by toomanyaccounts
Still works fine with the changed code, no more log spam, haven't noticed any side-effect, so I guess that did the trick.

Re: Argument 7 not passed to function

Posted: 26 Dec 2016, 16:07
by fox
it works i guess but its way less readable this way

i would prefer the offending php setting or w/e to be identified although i guess not this time

Re: Argument 7 not passed to function

Posted: 31 Dec 2016, 15:09
by toomanyaccounts
Unless I misunderstood the documentation, the ttrss custom error handler globally disables error suppression (include/errorhandler.php:37):

Code: Select all

if (error_reporting() == 0 || !$errno) return false;


Assuming "!$errno" is supposed to be "mute" too, something like this should work:

Code: Select all

if (error_reporting() === 0 || !$errno) return 0;

Re: Argument 7 not passed to function

Posted: 31 Dec 2016, 16:00
by fox
please elaborate on why have you decided to make these changes and how is error suppression being disabled because i don't get it

1. error_reporting() returns an integer, why add === there?
2. handler function returns a boolean as per php documentation (set_error_handler()) which you are changing to 0 for some reason

e: i mean the example of the handler function is literally right there in the docs ffs