Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Argument 3 passed to OC\Activity\Event::setObject() must be of the type string, null given, called in /var/www/html/apps/deck/lib/Activity/DeckProvider.php #921

Closed
PpaiSanchez opened this issue Mar 5, 2019 · 6 comments

Comments

@PpaiSanchez
Copy link

For some time, the following error appears when the cron job is called. After that, emails will no longer be sent from the App Activity.

{"reqId":"EA2VDCGRcY0yA2jWiIUg","level":3,"time":"2019-03-05T10:30:01+01:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Undefined index: board at /var/www/html/apps/deck/lib/Activity/DeckProvider.php#108","userAgent":"--","version":"15.0.5.3","id":"5c7e6dafb344a"}

[cron] Error: TypeError: Argument 3 passed to OC\Activity\Event::setObject() must be of the type string, null given, called in /var/www/html/apps/deck/lib/Activity/DeckProvider.php on line 108 at <>

  1. /var/www/html/apps/deck/lib/Activity/DeckProvider.php line 108
    setObject("deck_board", 8, null)
  2. /var/www/html/apps/activity/lib/MailQueueHandler.php line 465
    parse("de_DE", OC\Activity\Event {})
  3. /var/www/html/apps/activity/lib/MailQueueHandler.php line 374
    parseEvent("de_DE", OC\Activity\Event {})
  4. /var/www/html/apps/activity/lib/MailQueueHandler.php line 183
    sendEmailToUser("dvscholz", "bla@blub.bla", "de_DE", "Europe/Berlin", 1551778200)
  5. /var/www/html/apps/activity/lib/BackgroundJob/EmailNotification.php line 65
    sendEmails(500, 1551778200)
  6. /var/www/html/lib/private/BackgroundJob/Job.php line 61
    run(null)
  7. /var/www/html/lib/private/BackgroundJob/TimedJob.php line 55
    execute(OC\BackgroundJob\JobList {}, OC\Log {})
  8. /var/www/html/cron.php line 123
    execute(OC\BackgroundJob\JobList {}, OC\Log {})

Deck: 0.5.2
NC: Version: 15.0.5.3
PHP: 7.2.15

I suspect that the mail handling is not working properly in the app deck. This is only in NC version 15. NC 14 was still fine.

When i use "sudo -u www-data php -f /var/www/html/occ activity:send-mails" the following message appears:
An unhandled exception has been thrown:
TypeError: Argument 3 passed to OC\Activity\Event::setObject() must be of the type string, null given, called in /var/www/html/apps/deck/lib/Activity/DeckProvider.php on line 108 and defined in /var/www/html/lib/private/Activity/Event.php:377
Stack trace:
#0 /var/www/html/apps/deck/lib/Activity/DeckProvider.php(108): OC\Activity\Event->setObject('deck_board', 8, NULL)
#1 /var/www/html/apps/activity/lib/MailQueueHandler.php(465): OCA\Deck\Activity\DeckProvider->parse('de_DE', Object(OC\Activity\Event))
#2 /var/www/html/apps/activity/lib/MailQueueHandler.php(374): OCA\Activity\MailQueueHandler->parseEvent('de_DE', Object(OC\Activity\Event))
#3 /var/www/html/apps/activity/lib/MailQueueHandler.php(183): OCA\Activity\MailQueueHandler->sendEmailToUser('xxx', 'yyy@...', 'de_DE', 'Europe/Berlin', 1551790443)
#4 /var/www/html/apps/activity/lib/Command/SendEmails.php(111): OCA\Activity\MailQueueHandler->sendEmails(500, 1551790443, true, NULL)
#5 /var/www/html/3rdparty/symfony/console/Command/Command.php(255): OCA\Activity\Command\SendEmails->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 /var/www/html/core/Command/Base.php(166): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /var/www/html/3rdparty/symfony/console/Application.php(946): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /var/www/html/3rdparty/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(OCA\Activity\Command\SendEmails), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /var/www/html/3rdparty/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /var/www/html/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /var/www/html/console.php(96): OC\Console\Application->run()
#12 /var/www/html/occ(11): require_once('/var/www/html/c...')

@ghost
Copy link

ghost commented Mar 7, 2019

can confirm

PLUS

Workaround:

  1. deactivate the Deck app

  2. use said occ activity:send-mails

This is written in that Mail:
` * stack_create (Today at 9:00 PM)

  • card_create (Today at 9:00 PM)
  • card_user_assign (Today at 9:00 PM)`

The Stack card and user had different names. (looks like variables in a mail to me..)

  1. reactivate the app

  2. do some card and stack things

  3. use said occ activity sendmail...

This is writtten in that email:

` * ymybe has created card agoodnameforacard in stack agoodnameforastack on board agoodnameforaboard (Today at 9:02 PM)

  • ymybe has assigned ymybe to card agoodnameforacard on board agoodnameforaboard (Today at 9:02 PM)`

i think it happends during board creation because everything else didnt throw of the email notifications.

after i received mails.. dont know what happend in step two but i "cleared the air" apparently..

Good luck.
(nc15,php-fpm7.3.2,apache2.4.38,mariadb10.3.13,smptLoginViaSsl)

@ghost ghost mentioned this issue Mar 11, 2019
@alexport78
Copy link

alexport78 commented Mar 28, 2019

Another confirmation here.
@ymybe : The workaround works for one time only and while the deck app is disabled. Re-enabling the app makes the occ activity:send-mails command to fail.

Edit: Since it has to do with variables I have to say that I use greek characters in e.g. the card name, the board name etc.

@juliusknorr juliusknorr added this to the 🔧 Next minor 0.6 milestone Mar 28, 2019
@ghost
Copy link

ghost commented Apr 7, 2019

@alexport78 True. everytime you create another board which sends an activity email the notification emails go back to fail. :/

@juliusknorr
Copy link
Member

@PpaiSanchez Can you maybe sent me the entry in your database for the failing activity queue entry: OC\Activity\Event->setObject('deck_board', 8, NULL)

You can obtain the relevant data with the following sql query:

select * from oc_activity_mq where object_type='deck_board' and object_id = 8;

@rob006
Copy link
Contributor

rob006 commented Apr 10, 2019

@juliushaertl I can send you mine (I have similar error, even ID matches): oc_activity_mq.sql.zip

@rob006
Copy link
Contributor

rob006 commented Apr 10, 2019

I was able to temporary fix my mail queue by removing these two records:

(89, 1552767091, 1552770691, 'deck', 'rob006', 'deck', 'board_create', '{"author":"rob006"}', 'deck_board', 8),
(163, 1553011574, 1553015174, 'deck', 'rob006', 'deck', 'board_update_title', '{"author":"rob006","before":"Stack Overflow","after":"Stack Exchange"}', 'deck_board', 5);

Both reported Undefined index: board error.

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

No branches or pull requests

4 participants