What's new
Xen Factory

Register today to become a member! Once signed in, you'll be able to start purchasing our products, ask questions, request support and suggest new ideas!

  • We are aware that a no permission error was shown when you tried to purchase in the last 2 days, this is now fixed.

Bug Fixed Server error

JayT

Member
Server error log
  • InvalidArgumentException: Attempted to convert NULL to string/binary [username]
  • src/XF/Mvc/Entity/Entity.php:688
  • Generated by: Unknown account
  • Sep 30, 2018 at 8:02 PM
Stack trace
#0 src/XF/Mvc/Entity/Entity.php(575): XF\Mvc\Entity\Entity->_castValueToType(NULL, 'username', 5, Array)
#1 src/XF/Mvc/Entity/Entity.php(505): XF\Mvc\Entity\Entity->set('username', NULL)
#2 src/addons/XFMG/Service/Album/Creator.php(52): XF\Mvc\Entity\Entity->__set('username', NULL)
#3 src/addons/XFMG/Service/Album/Creator.php(43): XFMG\Service\Album\Creator->setUser(Object(XFRM\XF\Entity\User))
#4 src/addons/XFMG/Service/Album/Creator.php(34): XFMG\Service\Album\Creator->setAlbum()
#5 src/XF/Container.php(273): XFMG\Service\Album\Creator->__construct(Object(XF\Pub\App))
#6 src/XF/App.php(1359): XF\Container->createObject('XFA\\XFMGMediaOf...', Array)
#7 src/XF/Container.php(228): XF\App->XF\{closure}('XFA\\XFMGMediaOf...', Array, Object(XF\Container))
#8 src/XF/App.php(2508): XF\Container->create('service', 'XFMG\\Service\\Al...', Array)
#9 src/addons/XFA/XFMGMediaOfTheMonth/Service/Album/Create.php(51): XF\App->service('XFMG\\Service\\Al...')
#10 src/addons/XFA/XFMGMediaOfTheMonth/Cron/XFMGMediaOfTheMonth.php(172): XFA\XFMGMediaOfTheMonth\Service\Album\Create->create()
#11 src/addons/XFA/XFMGMediaOfTheMonth/Cron/XFMGMediaOfTheMonth.php(19): XFA\XFMGMediaOfTheMonth\Cron\XFMGMediaOfTheMonth::cronMode1()
#12 [internal function]: XFA\XFMGMediaOfTheMonth\Cron\XFMGMediaOfTheMonth::cron(Object(XF\Entity\CronEntry))
#13 src/XF/Job/Cron.php(35): call_user_func(Array, Object(XF\Entity\CronEntry))
#14 src/XF/Job/Manager.php(241): XF\Job\Cron->run(7.9999990463257)
#15 src/XF/Job/Manager.php(187): XF\Job\Manager->runJobInternal(Array, 7.9999990463257)
#16 src/XF/Job/Manager.php(76): XF\Job\Manager->runJobEntry(Array, 7.9999990463257)
#17 job.php(15): XF\Job\Manager->runQueue(false, 8)
#18 {main}

-------------

Previous InvalidArgumentException: Attempted to convert NULL to string/binary - src/XF/Mvc/Entity/ValueFormatter.php:104
#0 src/XF/Mvc/Entity/Entity.php(684): XF\Mvc\Entity\ValueFormatter->castValueToType(NULL, 5, Array)
#1 src/XF/Mvc/Entity/Entity.php(575): XF\Mvc\Entity\Entity->_castValueToType(NULL, 'username', 5, Array)
#2 src/XF/Mvc/Entity/Entity.php(505): XF\Mvc\Entity\Entity->set('username', NULL)
#3 src/addons/XFMG/Service/Album/Creator.php(52): XF\Mvc\Entity\Entity->__set('username', NULL)
#4 src/addons/XFMG/Service/Album/Creator.php(43): XFMG\Service\Album\Creator->setUser(Object(XFRM\XF\Entity\User))
#5 src/addons/XFMG/Service/Album/Creator.php(34): XFMG\Service\Album\Creator->setAlbum()
#6 src/XF/Container.php(273): XFMG\Service\Album\Creator->__construct(Object(XF\Pub\App))
#7 src/XF/App.php(1359): XF\Container->createObject('XFA\\XFMGMediaOf...', Array)
#8 src/XF/Container.php(228): XF\App->XF\{closure}('XFA\\XFMGMediaOf...', Array, Object(XF\Container))
#9 src/XF/App.php(2508): XF\Container->create('service', 'XFMG\\Service\\Al...', Array)
#10 src/addons/XFA/XFMGMediaOfTheMonth/Service/Album/Create.php(51): XF\App->service('XFMG\\Service\\Al...')
#11 src/addons/XFA/XFMGMediaOfTheMonth/Cron/XFMGMediaOfTheMonth.php(172): XFA\XFMGMediaOfTheMonth\Service\Album\Create->create()
#12 src/addons/XFA/XFMGMediaOfTheMonth/Cron/XFMGMediaOfTheMonth.php(19): XFA\XFMGMediaOfTheMonth\Cron\XFMGMediaOfTheMonth::cronMode1()
#13 [internal function]: XFA\XFMGMediaOfTheMonth\Cron\XFMGMediaOfTheMonth::cron(Object(XF\Entity\CronEntry))
#14 src/XF/Job/Cron.php(35): call_user_func(Array, Object(XF\Entity\CronEntry))
#15 src/XF/Job/Manager.php(241): XF\Job\Cron->run(7.9999990463257)
#16 src/XF/Job/Manager.php(187): XF\Job\Manager->runJobInternal(Array, 7.9999990463257)
#17 src/XF/Job/Manager.php(76): XF\Job\Manager->runJobEntry(Array, 7.9999990463257)
#18 job.php(15): XF\Job\Manager->runQueue(false, 8)
#19 {main}

Request state
array(4) {
["url"] => string(18) "/community/job.php"
["referrer"] => string(95) "https://www.xxx.nl/community/index.php?media/misswicked-01-week7-day54-00.296/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
 

Nik

Member
Same issue on award day... Sigh. . Does this ever get tested?

Also no award post generated for winner. Winner widget does work though . In my case mode 2.

@MtoR
 
Last edited:

Clement

Freaky Coder
Staff member
Hello,

Yes it does get tested, though there may be some corner cases.

From what I see of the logs, it seems you are not in mode 2 but mode 1 (odd as per what you say) as the error is in a portion of cron task code related to that.
Apparently, you have not set the user id in the options that is used to create the album in mode 1 as well as post threads/post on various actions.

Clément
 

Nik

Member
Hello,

Yes it does get tested, though there may be some corner cases.

From what I see of the logs, it seems you are not in mode 2 but mode 1 (odd as per what you say) as the error is in a portion of cron task code related to that.
Apparently, you have not set the user id in the options that is used to create the album in mode 1 as well as post threads/post on various actions.

Clément

All options are set as the contest did work in Mode 2 and thread was updated with my admin user ID on submissions etc. The end of the contest failed to create the winning post.

All I did was install the addon, change to mode 2 (as it installs mode 1 by default) then set the options. Is there another step here?
 

Clement

Freaky Coder
Staff member
No no there is not.

Do you have any add-on that messes with the cron tasks ?

As you can see from your log:
#11 src/addons/XFA/XFMGMediaOfTheMonth/Cron/XFMGMediaOfTheMonth.php(19): XFA\XFMGMediaOfTheMonth\Cron\XFMGMediaOfTheMonth::cronMode1()

It's calling mode 1 stuff so that's not logical.
 

Nik

Member
No no there is not.

Do you have any add-on that messes with the cron tasks ?

As you can see from your log:
#11 src/addons/XFA/XFMGMediaOfTheMonth/Cron/XFMGMediaOfTheMonth.php(19): XFA\XFMGMediaOfTheMonth\Cron\XFMGMediaOfTheMonth::cronMode1()

It's calling mode 1 stuff so that's not logical.

My apologies I should've copied in my error I assumed it was the same but may be a different issue (though same result):

  • InvalidArgumentException: Attempted to convert NULL to string/binary [username]
  • src/XF/Mvc/Entity/Entity.php:691
  • Generated by: Unknown account
  • Sep 30, 2018 at 8:01 PM
Stack trace
#0 src/XF/Mvc/Entity/Entity.php(575): XF\Mvc\Entity\Entity->_castValueToType(NULL, 'username', 5, Array)
#1 src/XF/Mvc/Entity/Entity.php(505): XF\Mvc\Entity\Entity->set('username', NULL)
#2 src/XF/Service/Thread/Replier.php(102): XF\Mvc\Entity\Entity->__set('username', NULL)
#3 src/XF/Service/Thread/Replier.php(40): XF\Service\Thread\Replier->setPostDefaults()
#4 src/XF/Container.php(274): XF\Service\Thread\Replier->__construct(Object(XF\Pub\App), Object(ForumApps\API\XF\Entity\Thread))
#5 src/XF/App.php(1359): XF\Container->createObject('XFA\\Core\\XF\\Ser...', Array)
#6 src/XF/Container.php(228): XF\App->XF\{closure}('XFA\\Core\\XF\\Ser...', Array, Object(XF\Container))
#7 src/XF/App.php(2508): XF\Container->create('service', 'XF:Thread\\Repli...', Array)
#8 src/addons/XFA/XFMGMediaOfTheMonth/Service/Motm/ThreadNotifier.php(179): XF\App->service('XF:Thread\\Repli...', Object(ForumApps\API\XF\Entity\Thread))
#9 src/addons/XFA/XFMGMediaOfTheMonth/Service/Motm/WinnerAwarder.php(242): XFA\XFMGMediaOfTheMonth\Service\Motm\ThreadNotifier->notify()
#10 src/addons/XFA/XFMGMediaOfTheMonth/Cron/XFMGMediaOfTheMonth.php(213): XFA\XFMGMediaOfTheMonth\Service\Motm\WinnerAwarder->findAndAwardWinner(2)
#11 src/addons/XFA/XFMGMediaOfTheMonth/Cron/XFMGMediaOfTheMonth.php(23): XFA\XFMGMediaOfTheMonth\Cron\XFMGMediaOfTheMonth::cronMode2()
#12 [internal function]: XFA\XFMGMediaOfTheMonth\Cron\XFMGMediaOfTheMonth::cron(Object(XF\Entity\CronEntry))
#13 src/XF/Job/Cron.php(35): call_user_func(Array, Object(XF\Entity\CronEntry))
#14 src/XF/Job/Manager.php(241): XF\Job\Cron->run(7.9970910549164)
#15 src/XF/Job/Manager.php(187): XF\Job\Manager->runJobInternal(Array, 7.9970910549164)
#16 src/XF/Job/Manager.php(76): XF\Job\Manager->runJobEntry(Array, 7.9970910549164)
#17 job.php(14): XF\Job\Manager->runQueue(false, 8)
#18 {main}

-------------

Previous InvalidArgumentException: Attempted to convert NULL to string/binary - src/XF/Mvc/Entity/ValueFormatter.php:130
#0 src/XF/Mvc/Entity/Entity.php(687): XF\Mvc\Entity\ValueFormatter->castValueToType(NULL, 5, Array)
#1 src/XF/Mvc/Entity/Entity.php(575): XF\Mvc\Entity\Entity->_castValueToType(NULL, 'username', 5, Array)
#2 src/XF/Mvc/Entity/Entity.php(505): XF\Mvc\Entity\Entity->set('username', NULL)
#3 src/XF/Service/Thread/Replier.php(102): XF\Mvc\Entity\Entity->__set('username', NULL)
#4 src/XF/Service/Thread/Replier.php(40): XF\Service\Thread\Replier->setPostDefaults()
#5 src/XF/Container.php(274): XF\Service\Thread\Replier->__construct(Object(XF\Pub\App), Object(ForumApps\API\XF\Entity\Thread))
#6 src/XF/App.php(1359): XF\Container->createObject('XFA\\Core\\XF\\Ser...', Array)
#7 src/XF/Container.php(228): XF\App->XF\{closure}('XFA\\Core\\XF\\Ser...', Array, Object(XF\Container))
#8 src/XF/App.php(2508): XF\Container->create('service', 'XF:Thread\\Repli...', Array)
#9 src/addons/XFA/XFMGMediaOfTheMonth/Service/Motm/ThreadNotifier.php(179): XF\App->service('XF:Thread\\Repli...', Object(ForumApps\API\XF\Entity\Thread))
#10 src/addons/XFA/XFMGMediaOfTheMonth/Service/Motm/WinnerAwarder.php(242): XFA\XFMGMediaOfTheMonth\Service\Motm\ThreadNotifier->notify()
#11 src/addons/XFA/XFMGMediaOfTheMonth/Cron/XFMGMediaOfTheMonth.php(213): XFA\XFMGMediaOfTheMonth\Service\Motm\WinnerAwarder->findAndAwardWinner(2)
#12 src/addons/XFA/XFMGMediaOfTheMonth/Cron/XFMGMediaOfTheMonth.php(23): XFA\XFMGMediaOfTheMonth\Cron\XFMGMediaOfTheMonth::cronMode2()
#13 [internal function]: XFA\XFMGMediaOfTheMonth\Cron\XFMGMediaOfTheMonth::cron(Object(XF\Entity\CronEntry))
#14 src/XF/Job/Cron.php(35): call_user_func(Array, Object(XF\Entity\CronEntry))
#15 src/XF/Job/Manager.php(241): XF\Job\Cron->run(7.9970910549164)
#16 src/XF/Job/Manager.php(187): XF\Job\Manager->runJobInternal(Array, 7.9970910549164)
#17 src/XF/Job/Manager.php(76): XF\Job\Manager->runJobEntry(Array, 7.9970910549164)
#18 job.php(14): XF\Job\Manager->runQueue(false, 8)
#19 {main}



Request state
array(4) {
["url"] => string(8) "/job.php"
["referrer"] => string(73) "https://xxx.com/threads/beauty.15925/page-27?view=date"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
 

Clement

Freaky Coder
Staff member
Hi,

I reviewed the errors log, it's only possible if the attached option is not set.
You sure you did set it ?

Clément
 

Nik

Member
Hi,

I reviewed the errors log, it's only possible if the attached option is not set.
You sure you did set it ?

Clément

Yes of course. Do you need an Sql export of your options table wherever that is?
 

Nik

Member
No I believe you but that's not logical error.

This is the second error you get related to options, with this one:
https://www.xen-factory.com/index.php?threads/contest-thread-not-created.2767/

You are running latest xF2 version ?
Do you have some specific add-ons for caching or something like that that could be interfering with options ?

Yes that error you reference was resolved with a patch early September so thread was auto created (in wrong forum) which is another issue I am having together with another guy on here.


Running XF2.0.10. No special caching addons using standard XF caching and session cache with a Redis backend. If you have time you can have a peek via Teamviewer right now... I have a few mins
 

JayT

Member
Hello,

Yes it does get tested, though there may be some corner cases.

From what I see of the logs, it seems you are not in mode 2 but mode 1 (odd as per what you say) as the error is in a portion of cron task code related to that.
Apparently, you have not set the user id in the options that is used to create the album in mode 1 as well as post threads/post on various actions.

Clément
The user ID is set to 1 by default. Am I supposed to change that?
 
Top