Cron job error messages

#1

If I run the cron script I get the following errors:
PHP Notice: Undefined index: owner_gp in /var/www/html/kanboard-1.2.7/plugins/Group_assign/Model/NewUserNotificationFilterModel.php on line 193
PHP Notice: Undefined index: owner_ms in /var/www/html/kanboard-1.2.7/plugins/Group_assign/Model/NewUserNotificationFilterModel.php on line 192

Looking at the function it appears to need indexes owner_gp and owner_ms which aren’t defined.
Does anyone know what the definitions should be?
Thanks.

#2

owner_gp and owner_ms are Group_assign plugin indexes.

Is the plugin up to date?
What other plugins do you have installed?
Check your DB and make sure it migrated with those columns.

That plugin could easily conflict with another plugin, and is highly dependent on the overriden TaskFinderModel.

It’s also possible I overlooked something, so if all checks out, I’ll try and duplicate and fix.

#3

Some insight…

I couldn’t replicate it then, so I’ll need details, a lot of them.

You’re not running a background worker are you?

#4

I’m running version 1.5.0, I’ll upgrade to the latest 1.6.2 and see what happens.

I’m not using a background worker, only the cron job using the command:
0 8 * * * cd /var/www/html/kanboard && ./cli cronjob >>/var/www/html/kanboard/data/cronjob.log 2>&1

We did migrate from a sqllite file to a mysql database some time ago and so we may have not replicated all the columns correctly though I think we added the group plugoin after the migration.

Thanks

#5

Have updated to 1.6.2 and still have the same issue.
Here is some diagnostic info:
I have found out that owner_gp and owner_ms are defined in the table “tasks”
as the last two columns:

MariaDB [kanboard]> describe tasks;
+----------------------+--------------+------+-----+---------+----------------+
| Field                | Type         | Null | Key | Default | Extra          |
+----------------------+--------------+------+-----+---------+----------------+
| id                   | int(11)      | NO   | PRI | NULL    | auto_increment |
| title                | mediumtext   | NO   |     | NULL    |                |
| description          | mediumtext   | YES  |     | NULL    |                |
| date_creation        | bigint(20)   | YES  |     | NULL    |                |
| date_completed       | bigint(20)   | YES  |     | NULL    |                |
| date_due             | bigint(20)   | YES  |     | NULL    |                |
| color_id             | varchar(50)  | YES  |     | NULL    |                |
| project_id           | int(11)      | NO   | MUL | NULL    |                |
| column_id            | int(11)      | NO   | MUL | NULL    |                |
| owner_id             | int(11)      | YES  |     | 0       |                |
| position             | int(11)      | YES  |     | NULL    |                |
| score                | int(11)      | YES  |     | NULL    |                |
| is_active            | tinyint(4)   | YES  | MUL | 1       |                |
| category_id          | int(11)      | YES  |     | 0       |                |
| creator_id           | int(11)      | YES  |     | 0       |                |
| date_modification    | int(11)      | YES  |     | 0       |                |
| reference            | varchar(191) | YES  | MUL |         |                |
| date_started         | bigint(20)   | YES  |     | NULL    |                |
| time_spent           | float        | YES  |     | 0       |                |
| time_estimated       | float        | YES  |     | 0       |                |
| swimlane_id          | int(11)      | NO   | MUL | NULL    |                |
| date_moved           | bigint(20)   | YES  |     | NULL    |                |
| recurrence_status    | int(11)      | NO   |     | 0       |                |
| recurrence_trigger   | int(11)      | NO   |     | 0       |                |
| recurrence_factor    | int(11)      | NO   |     | 0       |                |
| recurrence_timeframe | int(11)      | NO   |     | 0       |                |
| recurrence_basedate  | int(11)      | NO   |     | 0       |                |
| recurrence_parent    | int(11)      | YES  |     | NULL    |                |
| recurrence_child     | int(11)      | YES  |     | NULL    |                |
| priority             | int(11)      | YES  |     | 0       |                |
| external_provider    | varchar(255) | YES  |     | NULL    |                |
| external_uri         | varchar(255) | YES  |     | NULL    |                |
| date_board           | int(11)      | YES  |     | 0       |                |
| owner_gp             | int(11)      | YES  |     | 0       |                |
| owner_ms             | int(11)      | YES  |     | 0       |                |
+----------------------+--------------+------+-----+---------+----------------+
35 rows in set (0.00 sec)

You can see that they are not defined as a "Key" in the 4th column.

I then check the table definition provide by kanboard under
/var/www/html/kanboard/app/Schema/Sql/mysql.sql

These two fields are not defined at all !

CREATE TABLE `tasks` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` mediumtext COLLATE utf8mb4_unicode_ci,
  `date_creation` bigint(20) DEFAULT NULL,
  `date_completed` bigint(20) DEFAULT NULL,
  `date_due` bigint(20) DEFAULT NULL,
  `color_id` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `project_id` int(11) NOT NULL,
  `column_id` int(11) NOT NULL,
  `owner_id` int(11) DEFAULT '0',
  `position` int(11) DEFAULT NULL,
  `score` int(11) DEFAULT NULL,
  `is_active` tinyint(4) DEFAULT '1',
  `category_id` int(11) DEFAULT '0',
  `creator_id` int(11) DEFAULT '0',
  `date_modification` int(11) DEFAULT '0',
  `reference` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT '',
  `date_started` bigint(20) DEFAULT NULL,
  `time_spent` float DEFAULT '0',
  `time_estimated` float DEFAULT '0',
  `swimlane_id` int(11) NOT NULL,
  `date_moved` bigint(20) DEFAULT NULL,
  `recurrence_status` int(11) NOT NULL DEFAULT '0',
  `recurrence_trigger` int(11) NOT NULL DEFAULT '0',
  `recurrence_factor` int(11) NOT NULL DEFAULT '0',
  `recurrence_timeframe` int(11) NOT NULL DEFAULT '0',
  `recurrence_basedate` int(11) NOT NULL DEFAULT '0',
  `recurrence_parent` int(11) DEFAULT NULL,
  `recurrence_child` int(11) DEFAULT NULL,
  `priority` int(11) DEFAULT '0',
  `external_provider` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `external_uri` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_task_active` (`is_active`),
  KEY `column_id` (`column_id`),
  KEY `tasks_reference_idx` (`reference`),
  KEY `tasks_project_idx` (`project_id`),
  KEY `tasks_swimlane_ibfk_1` (`swimlane_id`),
  CONSTRAINT `tasks_ibfk_1` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE,
  CONSTRAINT `tasks_ibfk_2` FOREIGN KEY (`column_id`) REFERENCES `columns` (`id`) ON DELETE CASCADE,
  CONSTRAINT `tasks_swimlane_ibfk_1` FOREIGN KEY (`swimlane_id`) REFERENCES `swimlanes` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

Apparently they got added by some applications after the table is created.

I have also found from the database that in the table "project_activities", there are entries
relating to owner_gp (value 1) and owner_ms (value 0):

| 12323 |    1557993837 | task.update   |   12 |   4 |    1221 | {"task_id":"1221","task":{"id":"1221","title":"Test of task number","description":"yet another test thing","date_creation":"1557993787","date_completed":null,"date_due":"0","color_id":"yellow","project_id":"4","column_id":"25","owner_id":"12","position":"3","score":"0","is_active":"1","category_id":"0","creator_id":"12","date_modification":"1557993836","reference":"","date_started":"0","time_spent":"0","time_estimated":"0","swimlane_id":"23","date_moved":"1557993787","recurrence_status":"0","recurrence_trigger":"0","recurrence_factor":"0","recurrence_timeframe":"0","recurrence_basedate":"0","recurrence_parent":null,"recurrence_child":null,"priority":"0","external_provider":null,"external_uri":null,"date_board":"1557964800","owner_gp":"1","owner_ms":"0","category_name":null,"swimlane_name":"Default swimlane","project_name":"test_production","column_title":"ELB\/Paperwork Complete","assignee_username":"c_h","assignee_name":"Chris Howe","creator_username":"c_h","creator_name":"Chris Howe","category_description":null,"column_position":"3","assigned_groupname":"Elec"},"changes":{"owner_gp":"1"}} |

Not exactly sure what they are used for.

The plugins I’m using are in the attached screenshot.

#6

They aren’t in kanboard schema, they are in Group_assign schema.

After you upgraded, do me a favor, restart your server.

I’ll try and duplicate again.

#7

I’ve tried everything I can think of to duplicate, to no avail.

Whats your system configuration, I’ll try duplicating your system as best I can to see if I can trigger this warning. If you can narrow down the Event that may be causing it, that might help as well. The NewUserNotificationFilterModel is dependent on the event data being sent to it, no idea why any event would be missing that data though.

Long story short, I can’t fix something if I can’t duplicate it. (I say that but could throw an isset() question in there)

I’ll also reopen that issue, maybe someone else can figure it out.

#8

See if this removes the warning for you(since i have no way of knowing):

It doesn’t actually fix it though, just sets those indexes to 0 if they aren’t set.

#9

That has removed the error messages from the log file.

Thank you for producing the update.

#10

No problem, I’m curious to know if you receive notifications when your in an assigned group or other assignee field.