Please report here any PHP Fatal error message obtained running the 2019.09 stable or 2019.12-dev versions.
FollowUp #7297
2019.12-dev:
[10-Oct-2019 15:25:38 UTC] PHP Fatal error: Uncaught TypeError: Argument 1 passed to Friendica\Core\L10n\L10n::detectLanguage() must be of the type array, string given, called in .../src/Module/Register.php on line 199 and defined in .../src/Core/L10n/L10n.php:197
Stack trace:
#0 .../src/Module/Register.php(199): Friendica\Core\L10n\L10n::detectLanguage('en')
#1 [internal function]: Friendica\Module\Register::post()
#2 .../src/App/Module.php(236): call_user_func(Array)
#3 .../src/App.php(790): Friendica\App\Module->run(Object(Friendica\Core\L10n\L10n), Object(Friendica\App), Object(Friendica\Util\Logger\StreamLogger), Array, Array)
#4 .../index.php(25): Friendica\App->runFrontend(Object(Friendica\App\Module), Object(Friendica\App\Router), Object(Friendica\Core\Config\PreloadPConfiguration))
#5 {main}
thrown in .../src/Core/L10n/L10n.php on line 197
and...
10-Oct-2019 16:07:08 UTC] PHP Fatal error: Uncaught Error: Class 'Session' not found in .../mod/subthread.php:18
Stack trace:
#0 .../src/LegacyModule.php(71): subthread_content(Object(Friendica\App))
#1 .../src/LegacyModule.php(45): Friendica\LegacyModule::runModuleFunction('content')
#2 [internal function]: Friendica\LegacyModule::content()
#3 .../src/App/Page.php(311): call_user_func(Array)
#4 .../src/App/Page.php(365): Friendica\App\Page->initContent(Object(Friendica\App\Module), Object(Friendica\App\Mode))
#5 .../src/App.php(795): Friendica\App\Page->run(Object(Friendica\App), Object(Friendica\App\BaseURL), Object(Friendica\App\Mode), Object(Friendica\App\Module), Object(Friendica\Core\L10n\L10n), Object(Friendica\Core\Config\PreloadConfiguration), Object(Friendica\Core\Config\PreloadPConfiguration))
#6 .../index.php(25): Friendica\App->runFrontend(Object(Friendica\App\Module), Object(Friendica\App\Router), Object(Fr in .../mod/subthread.php on line 18
Fixed with #7723
I'm on it.
Reported by @AndyHee
PHP Fatal error: Uncaught TypeError: Argument 2 passed to Friendica\Util\Logger\WorkerLogger::debug() must be of the type array, string given, called in /var/www/friendica/src/Core/Logger.php on line 219 and defined in /var/www/friendica/src/Util/Logger/WorkerLogger.php:189
Stack trace:
#0 /var/www/friendica/src/Core/Logger.php(219): Friendica\Util\Logger\WorkerLogger->debug('Notifier entry:...', 'debug')
#1 /var/www/friendica/src/Worker/Delivery.php(281): Friendica\Core\Logger::debug('Notifier entry:...', 'debug')
#2 /var/www/friendica/src/Worker/Delivery.php(204): Friendica\Worker\Delivery::deliverDFRN('drop', Array, Array, Array, Array, true, true, false)
#3 [internal function]: Friendica\Worker\Delivery::execute('drop', 1709450, 15243)
#4 /var/www/friendica/src/Core/Worker.php(400): call_user_func_array('Friendica\Worke...', Array)
#5 /var/www/friendica/src/Core/Worker.php(299): Friendica\Core\Worker::execFunction(Array, 'Delivery', Array, true)
#6 /var/www/friendica/src/Core/Worker.php(114): Friendica\Core\Worker::execu in /var/www/friendica/src/Util/Logger/WorkerLogger.php on line 189
Fixes by #7750
2019.12-dev:
PHP Fatal error: Uncaught Error: Call to undefined function Friendica\Model\defaults() in /var/www/friendica/src/Model/GContact.php:129
Stack trace:
#0 /var/www/friendica/src/Protocol/PortableContact.php(639): Friendica\Model\GContact::sanitize(Array)
#1 /var/www/friendica/src/Protocol/PortableContact.php(408): Friendica\Protocol\PortableContact::discoverServer(Array, 2)
#2 /var/www/friendica/src/Worker/DiscoverPoCo.php(77): Friendica\Protocol\PortableContact::discoverSingleServer(248)
#3 [internal function]: Friendica\Worker\DiscoverPoCo::execute('update_server_d...', 248)
#4 /var/www/friendica/src/Core/Worker.php(400): call_user_func_array('Friendica\\Worke...', Array)
#5 /var/www/friendica/src/Core/Worker.php(299): Friendica\Core\Worker::execFunction(Array, 'DiscoverPoCo', Array, true)
#6 /var/www/friendica/src/Core/Worker.php(114): Friendica\Core\Worker::execute(Array)
#7 /var/www/friendica/bin/worker.php(60): Friendica\Core\Worker::processQueue(false)
#8 {main}
thrown in /var/www/friendica/src/Model/GContact.php on line 129
Fixed by #7760
2019.12-dev:
PHP Fatal error: Uncaught TypeError: Argument 1 passed to Friendica\Model\GContact::updateFromOutbox() must be of the type string, array given, called in /var/www/friendica/src/Model/GContact.php on line 876 and defined in /var/www/friendica/src/Model/GContact.php:864
Stack trace:
#0 /var/www/friendica/src/Model/GContact.php(876): Friendica\Model\GContact::updateFromOutbox(Array, Array)
#1 /var/www/friendica/src/Model/GContact.php(818): Friendica\Model\GContact::updateFromOutbox('https://shitpos...', Array)
#2 /var/www/friendica/src/Model/GContact.php(1090): Friendica\Model\GContact::setLastUpdate(Array, true)
#3 /var/www/friendica/src/Worker/DiscoverPoCo.php(67): Friendica\Model\GContact::updateFromProbe('https://shitpos...', true)
#4 [internal function]: Friendica\Worker\DiscoverPoCo::execute('check_profile', 'https://shitpos...')
#5 /var/www/friendica/src/Core/Worker.php(400): call_user_func_array('Friendica\\Worke...', Array)
#6 /var/www/friendica/src/Core/Worker.php(299): Friendica\Core\Worker::execFunction(Array, 'Disco in /var/www/friendica/src/Model/GContact.php on line 864
Fixed by #7767
2019.12-dev:
PHP Warning: require(/var/www/friendica/vendor/composer/../../include/text.php): failed to open stream: No such file or directory in /var/www/friendica/vendor/composer/autoload_real.php on line 70
PHP Fatal error: require(): Failed opening required '/var/www/friendica/vendor/composer/../../include/text.php' (include_path='/var/www/friendica/vendor/pear/text_languagedetect:.:/usr/share/php') in /var/www/friendica/vendor/composer/autoload_real.php on line 70
PHP Warning: require(/var/www/friendica/vendor/composer/../../include/text.php): failed to open stream: No such file or directory in /var/www/friendica/vendor/composer/autoload_real.php on line 70
PHP Fatal error: require(): Failed opening required '/var/www/friendica/vendor/composer/../../include/text.php' (include_path='/var/www/friendica/vendor/pear/text_languagedetect:.:/usr/share/php') in /var/www/friendica/vendor/composer/autoload_real.php on line 70
PHP Notice: Undefined index: url in /var/www/friendica/src/Worker/Notifier.php on line 448
Should be fixed with https://github.com/friendica/friendica/pull/7768
You need to run bin/composer.ohar install --no-dev manually as an included file was removed from the composer.json file but it doesn't change the composer.lock, only the optimized autoloader.
Ah damn .. I forgot to commit the lock file ..
It hasn't changed, only the autoloader. All admins have to run the same command. Which means we probably should update the version of one of the dependencies to trigger it automatically for admins who expect composer.lock changes.
Thanks for the fix!
That's the composer output I got then.
Loading composer repositories with package information
Installing dependencies from lock file
Nothing to install or update
Generating optimized autoload files
And that is expected until you pull #7768
2019.12-dev:
PHP Fatal error: Uncaught TypeError: Argument 1 passed to Friendica\Protocol\Activity::match() must be of the type string, null given, called in .../include/conversation.php on line 1031 and defined in .../src/Protocol/Activity.php:199
Stack trace:
#0 .../include/conversation.php(1031): Friendica\Protocol\Activity->match(NULL, 'http://activity...')
#1 .../include/conversation.php(756): builtin_activity_puller(Array, Array)
#2 .../src/Module/Profile.php(352): conversation(Object(Friendica\App), Array, Object(Friendica\Content\Pager), 'profile', 0, false, 'received', 1714)
#3 [internal function]: Friendica\Module\Profile::content()
#4 .../src/App/Page.php(311): call_user_func(Array)
#5 .../src/App/Page.php(365): Friendica\App\Page->initContent(Object(Friendica\App\Module), Object(Friendica\App\Mode))
#6 .../src/App.php(795): Friendica\App\Page->run(Object(Friendica\App), Object( in .../src/Protocol/Activity.php on line 199
On it.
@AlfredSK Can you please query how many rows in your item table have a verb field set to NULL?
SELECT * FROM `item` WHERE `verb` IS NULL
13519712
Looks like all rows are set to NULL in field 'verb'.
Then I have no idea why this doesn't fail more often, it's another one of those fields that have been moved to item-proxy tables but not under this specific form. @annando needs to chime in.
I have just pulled from develop and am getting tons of this...
PHP Fatal error: Cannot use Friendica\Core\System as System because the name is already in use in .../src/Protocol/ActivityPub/Transmitter.php on line 18
Looks like line 18 is a duplicate of line 14. :-)
Fixed by #7804
Pinned posts:
PHP Fatal error: Uncaught TypeError: Argument 1 passed to Friendica\Model\Item::selectPinned() must be of the type integer, null given, called in /var/www/html/libranet/src/Module/Profile.php on line 353 and defined in /var/www/html/libranet/src/Model/Item.php:155
Stack trace:
#0 /var/www/html/libranet/src/Module/Profile.php(353): Friendica\Model\Item::selectPinned(NULL, Array)
#1 [internal function]: Friendica\Module\Profile::content(Array)
#2 /var/www/html/libranet/src/App/Page.php(311): call_user_func(Array, Array)
#3 /var/www/html/libranet/src/App/Page.php(365): Friendica\App\Page->initContent(Object(Friendica\App\Module), Object(Friendica\App\Mode))
#4 /var/www/html/libranet/src/App.php(795): Friendica\App\Page->run(Object(Friendica\App), Object(Friendica\App\BaseURL), Object(Friendica\App\Mode), Object(Friendica\App\Module), Object(Friendica\Core\L10n\L10n), Object(Friendica\Core\Config\PreloadConfiguration), Object(Friendica\Core\Config\PreloadPConfiguration))
#5 /var/www/html/libranet/index.php(25): Friendica\App->run in /var/www/html/libranet/src/Model/Item.php on line 155
Fixed by https://github.com/friendica/friendica/commit/2200996d4484d8c4685c32d7b7d012c7cf3e2185
2019.12-dev:
[08-Nov-2019 21:24:45 UTC] PHP Fatal error: Uncaught Error: Function name must be a string in .../src/Module/Register.php:265
Stack trace:
#0 [internal function]: Friendica\Module\Register::post(Array)
#1 .../src/App/Module.php(260): call_user_func(Array, Array)
#2 .../src/App.php(790): Friendica\App\Module->run(Object(Friendica\Core\L10n\L10n), Object(Friendica\App), Object(Friendica\Util\Logger\StreamLogger), Array, Array)
#3 .../index.php(25): Friendica\App->runFrontend(Object(Friendica\App\Module), Object(Friendica\App\Router), Object(Friendica\Core\Config\PreloadPConfiguration))
#4 {main}
thrown in .../src/Module/Register.php on line 265
Fixed with https://github.com/friendica/friendica/commit/babcd244125d37a84b786399d58646738c012d70
What exactly is on line 265 of your src/Module/Register.php file?
if (!empty($_POST('registertarpit'))) {
Oooooh.
I'm still getting this one from above on develop:
https://github.com/friendica/friendica/issues/7675#issuecomment-548970576
Here is the version with the current line numbers:
Uncaught TypeError: Argument 1 passed to Friendica\Protocol\Activity::match() must be of the type string, null given, called in .../include/conversation.php on line 1037 and defined in .../src/Protocol/Activity.php:199
Stack trace:
#0 .../include/conversation.php(1037): Friendica\Protocol\Activity->match(NULL, 'http://activity...')
#1 .../include/conversation.php(756): builtin_activity_puller(Array, Array)
#2 .../src/Module/Profile.php(358): conversation(Object(Friendica\App), Array, Object(Friendica\Content\Pager), 'profile', 0, false, 'pinned_received', 2121)
#3 [internal function]: Friendica\Module\Profile::content(Array)
#4 .../src/App/Page.php(311): call_user_func(Array, Array)
#5 .../src/App/Page.php(365): Friendica\App\Page->initContent(Object(Friendica\App\Module), Object(Friendica\App\Mode))
#6 .../src/App.php(795): Friendica\App\Page->run(Object(Frie in .../src/Protocol/Activity.php on line 199
@annando Do you have an idea what is causing this fatal error?
@AlfredSK not really. On a current dev this shouldn't happen.
@annando ok. I'm on current develop.
I know now what is causing this fatal error!
Going to a profile page like this https://libranet.de/~alfred (page works but PHP fatal error) or this https://libranet.de/~clacke (white page of death with PHP fatal error).
Shouldn't a .../~nickname URL have a redirection to .../profile/nickname? But there is no redirection to be seen in the URL bar.
From Apache access log:
"HEAD /profile/clacke HTTP/2.0" 500 478 "-" "-"
"HEAD /profile/clacke HTTP/1.1" 500 3950 "-" "-"
Nice find!
Ok. I changed two lines by changing the type hints from string to ?string. Which means string or NULL if I understand it correctly.
My humble "solution" (workaround) to stop the fatal error (error 500) mess and make the profile page for at least one user working again:
/**
* Checks if the given activity is a hidden activity
*
* @param string $activity The current activity
*
* @return bool True, if the activity is hidden
*/
public function isHidden(?string $activity)
{
foreach (self::HIDDEN_ACTIVITIES as $hiddenActivity) {
if ($this->match($activity, $hiddenActivity)) {
return true;
}
}
return false;
}
/**
* Compare activity uri. Knows about activity namespace.
*
* @param string $haystack
* @param string $needle
*
* @return boolean
*/
public function match(?string $haystack, string $needle)
{
return (($haystack === $needle) ||
((basename($needle) === $haystack) &&
strstr($needle, ActivityNamespace::ACTIVITY_SCHEMA)));
}
The fatal errors because of argument 1 is NULL instead of a string are gone. But I'm sure this is an evil hack and not the wanted solution. :-)
You're absolutely right about ?string for PHP version 7.2 if I recall correctly. This would bump the hard PHP minimum version though so it's unadvisable. It probably should fixed at the spot where we decide how to handle ~username URLs.
Well, it's also possible to write that as function foo(Type $t = null) for PHP <= 7.1 according to Stackoverflow.
Yes, but you would have to make both parameters optional in the case of match() which is unwarranted. Better investigate how we're getting null values.
I've looked into ~username profiles and I can't get it to fail like it does with you. You just have users who posted items with empty item.verb column or empty item-content.verb column, which shouldn't happen, like @annando said.
So I looked into my own item-content and I found records empty verb columns. They're all related to pictures I stored. body column is just a BBCode link to the /photos/username/image/... module with an [img] tag of the picture inside.
But even then, it wouldn't be null, it would be '' (empty string). Something is wrong is your database.
Hmm. What does the match() part I posted above actually do? What is stored in the $haystack variable? I'm still puzzled why the error occurs for one (or maybe some) profile pages but not all profile pages.
So, the item-content.verb column should _never_ be NULL? Right? The dbstructure file says "not null". Hmm. :-)
I checked item-content.verb. The structure definition is correct.
There are 0 rows where verb is NULL. There are 5414 rows where verb is an empty string. There are 3791967 rows where it is not empty.
I checked item.verb (which is a deprecated column). The structure definition is 'null -> yes' and default 'NULL'. So, with this structure it is totally normal to have NULL values stored there.
There are 13972274 rows where verb is NULL. There are 0 rows where verb is an empty string. There are 0 rows where it is not empty.
I reset the code to string (the original lines). The error is gone. The user reported he was following an AP enabled blog (Plume) by adding it to his contacts. https://blog.funkwhale.audio/@/funkwhale/
After he did that the error appeared. Maybe the match() function failed because of this contact. Another guess is that some reshare was producing the error 500. I think that's unlikely. I guess it's more likely the contact was responsible.
2019.12-rc
PHP Fatal error: Uncaught TypeError: Argument 1 passed to Friendica\Model\GContact::updateFromOutbox() must be of the type string, array given, called in /src/Model/GContact.php on line 879 and defined in /src/Model/GContact.php:864
Stack trace:
#0 /src/Model/GContact.php(879): Friendica\Model\GContact::updateFromOutbox(Array, Array)
#1 /src/Model/GContact.php(814): Friendica\Model\GContact::updateFromOutbox('https://shitpos...', Array)
#2 /src/Model/GContact.php(1100): Friendica\Model\GContact::setLastUpdate(Array, true)
#3 /src/Worker/DiscoverPoCo.php(67): Friendica\Model\GContact::updateFromProbe('https://shitpos...', true)
#4 [internal function]: Friendica\Worker\DiscoverPoCo::execute('check_profile', 'https://shitpos...')
#5 /src/Core/Worker.php(400): call_user_func_array('Friendica\\Worke...', Array)
#6 /src/Model/GContact.php on line 864
PHP Fatal error: Uncaught TypeError: Argument 2 passed to OAuthRequest::from_consumer_and_token() must be an instance of OAuthToken, instance of OAuthConsumer given, called in /addon/statusnet/library/twitteroauth.php on line 210 and defined in /library/OAuth1.php:361
Fixed by https://github.com/friendica/friendica-addons/pull/919
On it as soon as I arrive at work in 30 minutes.
Looks like the same fatal error @annando reported. Here with full stack trace and related to Tumblr:
PHP Fatal error: Uncaught TypeError: Argument 2 passed to OAuthRequest::from_consumer_and_token() must be an instance of OAuthToken, instance of OAuthConsumer given, called in .../addon/tumblr/library/tumblroauth.php on line 179 and defined in .../library/OAuth1.php:361
Stack trace:
#0 .../addon/tumblr/library/tumblroauth.php(179): OAuthRequest::from_consumer_and_token(Object(OAuthConsumer), Object(OAuthConsumer), 'GET', 'https://api.tum...', Array)
#1 .../addon/tumblr/library/tumblroauth.php(143): TumblrOAuth->oAuthRequest('https://api.tum...', 'GET', Array)
#2 .../addon/tumblr/tumblr.php(270): TumblrOAuth->get('user/info')
#3 .../src/Core/Hook.php(202): tumblr_settings(Object(Friendica\App), '<span id="setti...')
#4 .../src/Core/Hook.php(178): Friendica\Core\Hook::callSingle(Object(Friendica\App), 'connector_setti...', Array, '<span id="setti...')
#5 .../mod/settings.php(797 in .../library/OAuth1.php on line 361
Fixed by https://github.com/friendica/friendica-addons/pull/919
Current RC:
Uncaught TypeError: Argument 1 passed to Friendica\Core\ACL::getContactListByUserId() must be of the type integer, null given, called in .../src/Core/ACL.php on line 396 and defined in .../src/Core/ACL.php:259
Stack trace:
#0 .../src/Core/ACL.php(396): Friendica\Core\ACL::getContactListByUserId(NULL)
#1 .../src/Module/Profile.php(211): Friendica\Core\ACL::getFullSelectorHTML(Object(Friendica\App\Page), NULL, true)
#2 [internal function]: Friendica\Module\Profile::content(Array)
#3 .../src/App/Page.php(310): call_user_func(Array, Array)
#4 .../src/App/Page.php(364): Friendica\App\Page->initContent(Object(Friendica\App\Module), Object(Friendica\App\Mode))
#5 .../src/App.php(795): Friendica\App\Page->run(Object(Friendica\App), Object(Friendica\App\BaseURL), Object(Friendica\App\Mode), Object(Friendica\App\Module), Object(Friendica\Core\L10n\L10n), Object(Friendica\Core\Config\Prelo in .../src/Core/ACL.php on line 259
Fixed by #7945
This one is strange. On the profile page the ACL only shows for logged in users that are the owner of the profile, which means the App->user definitely should be populated.
The console has wrong DBA arguments in the toinnodb tool (console.php dbstruc颅ture toinnodb) as reported in the support forum.
[Error]Argument 1 pas颅sed to Friendica\Database\DBA::selectToArray() must be of the type string, array given, cal颅led in /.../src/Database/DBStructure.php on line 46
Friendica Version 2019.09
Fixed by #7961
PHP 7.4.0 and current 2019.12-rc:
[15-Dec-2019 11:08:58 Europe/Berlin] PHP Fatal error: require(): Failed opening required '/srv/www/vendor/composer/../../include/text.php' (include_path='/srv/www/vendor/pear/text_languagedetect:.:') in /srv/www/vendor/composer/autoload_real.php on line 70
[16-Dec-2019 14:10:47 Europe/Berlin] PHP Fatal error: Uncaught TypeError: Argument 1 passed to Friendica\App\BaseURL::remove() must be of the type string, null given, called in /srv/www/src/App.php on line 388 and defined in /srv/www/src/App/BaseURL.php:403
I have no idea about those errors, just leave them here.
For the first one, your optimized autoload file is obsolete, please run php bin/composer.phar install --no-dev to refresh it.
For the first one, your optimized autoload file is obsolete, please run
php bin/composer.phar install --no-devto refresh it.
I run this each time I do a git pull, so maybe this only happened once during the whole upgrade...
Possibly. Your node would be offline if your optimized autoload file was still obsolete.
Closed by #7998
Most helpful comment
Thanks for the fix!
That's the composer output I got then.