FreePBX / issue-tracker

The unified FreePBX issue tracker.
https://www.freepbx.org
GNU General Public License v3.0
12 stars 1 forks source link

[bug]: There was an error. See the console log for more details #489

Open Owirtifo opened 1 month ago

Owirtifo commented 1 month ago

FreePBX Version

FreePBX 16

Issue Description

Errors occur when changing the Follow Me settings in the UCP panel:

: SQLSTATE[HY000]: General error: 1364 Field ‘strategy’ doesn’t have a default value
: SQLSTATE[HY000]: General error: 1364 Field ‘grptime’ doesn’t have a default value

FreePBX 16.0.40.8

When I try to change any of the specified parameters, an error occurs: There was an error. See the console log for more details

image

I checked in the database, the default values are for these parameters. Advanced Settings:

image

Operating Environment

No repos specified, using: [standard,extended,unsupported] from last GUI settings

+---------------------+------------+----------+---------+-----------+
| Module              | Version    | Status   | License | Signature |
+---------------------+------------+----------+---------+-----------+
| accountcodepreserve | 16.0.0.1   | Enabled  | GPLv2   | Sangoma   |
| amd                 | 16.0.3     | Enabled  | GPLv3+  | Sangoma   |
| announcement        | 16.0.7     | Enabled  | GPLv3+  | Sangoma   |
| api                 | 16.0.13    | Enabled  | AGPLv3+ | Sangoma   |
| arimanager          | 16.0.13    | Enabled  | GPLv3+  | Sangoma   |
| asterisk-cli        | 16.0.8     | Enabled  | GPLv3+  | Sangoma   |
| asteriskinfo        | 16.0.10    | Enabled  | GPLv3+  | Sangoma   |
| asternic_cdr        | 1.6.5      | Enabled  |         | Unsigned  |
| backup              | 16.0.70    | Enabled  | GPLv3+  | Sangoma   |
| blacklist           | 16.0.21    | Enabled  | GPLv3+  | Sangoma   |
| builtin             |            | Enabled  |         | Unsigned  |
| bulkhandler         | 16.0.16    | Enabled  | GPLv3+  | Sangoma   |
| calendar            | 16.0.21    | Enabled  | GPLv3+  | Sangoma   |
| callback            | 16.0.4     | Enabled  | GPLv3+  | Sangoma   |
| callforward         | 16.0.6     | Enabled  | AGPLv3+ | Sangoma   |
| callrecording       | 16.0.21    | Enabled  | AGPLv3+ | Sangoma   |
| callwaiting         | 16.0.5     | Enabled  | GPLv3+  | Sangoma   |
| cdr                 | 16.0.46.10 | Enabled  | GPLv3+  | Sangoma   |
| cel                 | 16.0.20    | Enabled  | GPLv3+  | Sangoma   |
| certman             | 16.0.22    | Enabled  | AGPLv3+ | Sangoma   |
| cidlookup           | 16.0.16    | Enabled  | GPLv3+  | Sangoma   |
| conferences         | 16.0.9     | Enabled  | GPLv3+  | Sangoma   |
| configedit          | 16.0.5     | Enabled  | AGPLv3+ | Sangoma   |
| contactmanager      | 16.0.26.1  | Enabled  | GPLv3+  | Sangoma   |
| core                | 16.0.68.20 | Enabled  | GPLv3+  | Sangoma   |
| customappsreg       | 16.0.5     | Enabled  | GPLv3+  | Sangoma   |
| customcontexts      | 13.0.3.2   | Enabled  | GPLv2+  | Sangoma   |
| dahdiconfig         | 16.0.9     | Enabled  | GPLv3+  | Sangoma   |
| dashboard           | 16.0.21    | Enabled  | AGPLv3+ | Sangoma   |
| daynight            | 16.0.3     | Enabled  | GPLv3+  | Sangoma   |
| dictate             | 16.0.1     | Enabled  | GPLv3+  | Sangoma   |
| directory           | 16.0.3     | Enabled  | GPLv3+  | Sangoma   |
| disa                | 16.0.4     | Disabled | AGPLv3+ | Sangoma   |
| donotdisturb        | 16.0.3     | Enabled  | GPLv3+  | Sangoma   |
| fax                 | 16.0.13    | Enabled  | GPLv3+  | Sangoma   |
| featurecodeadmin    | 16.0.11    | Enabled  | GPLv3+  | Sangoma   |
| filestore           | 16.0.18    | Enabled  | AGPLv3  | Sangoma   |
| findmefollow        | 16.0.23    | Enabled  | GPLv3+  | Sangoma   |
| framework           | 16.0.40.8  | Enabled  | GPLv2+  | Sangoma   |
| fw_langpacks        | 16.0.1     | Enabled  | GPLv3+  | Sangoma   |
| hotelwakeup         | 16.0.9     | Enabled  | GPLv2   | Sangoma   |
| iaxsettings         | 16.0.4     | Enabled  | AGPLv3  | Sangoma   |
| infoservices        | 16.0.2     | Enabled  | GPLv2+  | Sangoma   |
| irc                 | 16.0.1     | Enabled  | GPLv3+  | Sangoma   |
| ivr                 | 16.0.9     | Enabled  | GPLv3+  | Sangoma   |
| languages           | 16.0.4     | Enabled  | GPLv3+  | Sangoma   |
| logfiles            | 16.0.7     | Enabled  | GPLv3+  | Sangoma   |
| manager             | 16.0.23    | Enabled  | GPLv2+  | Sangoma   |
| miscapps            | 16.0.2     | Enabled  | GPLv3+  | Sangoma   |
| miscdests           | 16.0.2     | Enabled  | GPLv3+  | Sangoma   |
| missedcall          | 16.0.10    | Enabled  | GPLv3+  | Sangoma   |
| music               | 16.0.2     | Enabled  | GPLv3+  | Sangoma   |
| outroutemsg         | 16.0.1     | Disabled | GPLv3+  | Sangoma   |
| paging              | 16.0.13    | Disabled | GPLv3+  | Sangoma   |
| parking             | 16.0.4     | Enabled  | GPLv3+  | Sangoma   |
| phonebook           | 16.0.3     | Enabled  | GPLv3+  | Sangoma   |
| phpinfo             | 16.0.1     | Enabled  | GPLv2+  | Sangoma   |
| pinsets             | 16.0.8     | Enabled  | GPLv3+  | Sangoma   |
| pm2                 | 16.0.8     | Enabled  | AGPLv3+ | Sangoma   |
| presencestate       | 16.0.4     | Enabled  | GPLv3+  | Sangoma   |
| printextensions     | 16.0.8     | Enabled  | GPLv3+  | Sangoma   |
| queueprio           | 16.0.3     | Enabled  | GPLv3+  | Sangoma   |
| queues              | 16.0.27    | Enabled  | GPLv2+  | Sangoma   |
| recordings          | 16.0.16    | Enabled  | GPLv3+  | Sangoma   |
| ringgroups          | 16.0.11    | Enabled  | GPLv3+  | Sangoma   |
| setcid              | 16.0.3     | Enabled  | GPLv3+  | Sangoma   |
| sipsettings         | 16.0.27    | Enabled  | AGPLv3+ | Sangoma   |
| soundlang           | 16.0.9     | Enabled  | GPLv3+  | Sangoma   |
| superfecta          | 16.0.35    | Enabled  | GPLv2+  | Sangoma   |
| timeconditions      | 16.0.11    | Enabled  | GPLv3+  | Sangoma   |
| tts                 | 16.0.3     | Disabled | GPLv3+  | Sangoma   |
| ttsengines          | 16.0.3     | Disabled | AGPLv3  | Sangoma   |
| ucp                 | 16.0.38.2  | Enabled  | AGPLv3+ | Sangoma   |
| userman             | 16.0.44.12 | Enabled  | AGPLv3+ | Sangoma   |
| vmblast             | 16.0.11    | Disabled | GPLv3+  | Sangoma   |
| voicemail           | 16.0.55    | Enabled  | GPLv3+  | Sangoma   |
| webrtc              | 16.0.18    | Enabled  | GPLv3+  | Sangoma   |
+---------------------+------------+----------+---------+-----------+

Relevant log output

: SQLSTATE[HY000]: General error: 1364 Field ‘strategy’ doesn’t have a default value
: SQLSTATE[HY000]: General error: 1364 Field ‘grptime’ doesn’t have a default value
Owirtifo commented 1 day ago

The table looks like this:

findmefollow | CREATE TABLE `findmefollow` (
  `grpnum` varchar(20) NOT NULL,
  `strategy` varchar(50) NOT NULL,
  `grptime` smallint(6) NOT NULL,
  `grppre` varchar(100) DEFAULT NULL,
  `grplist` varchar(255) NOT NULL,
  `annmsg_id` int(11) DEFAULT NULL,
  `postdest` varchar(255) DEFAULT NULL,
  `dring` varchar(255) DEFAULT NULL,
  `rvolume` varchar(2) DEFAULT NULL,
  `remotealert_id` int(11) DEFAULT NULL,
  `needsconf` varchar(10) DEFAULT NULL,
  `toolate_id` int(11) DEFAULT NULL,
  `pre_ring` smallint(6) NOT NULL DEFAULT 0,
  `ringing` varchar(80) DEFAULT NULL,
  `calendar_enable` tinyint(1) DEFAULT 0,
  `calendar_id` varchar(80) DEFAULT '',
  `calendar_group_id` varchar(80) DEFAULT '',
  `calendar_match` varchar(4) DEFAULT 'yes',
  PRIMARY KEY (`grpnum`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci

When I try to change any of the specified parameters (Ring Strategy, Ring First For etc), the following queries are sent to the database:

INSERT INTO findmefollow (grpnum,strategy) VALUES ('2251','ringall') ON DUPLICATE KEY UPDATE strategy = 'ringall';
INSERT INTO findmefollow (grpnum,pre_ring) VALUES ('2251','1') ON DUPLICATE KEY UPDATE pre_ring = '1';

but since the grptime, strategy and grplist fields must have values and the default value is not set for them, and these fields are not specified in the request, the SQLSTATE error[HY000]: General error: 1364 occurs.

A temporary solution can be found in this article: https://database.guide/5-ways-to-fix-error-1364-field-doesnt-have-a-default-value-in-mysql/

I hope the developers will fix this bug in the next versions.

kguptasangoma commented 16 hours ago

Hi @Owirtifo as this is mandatory field so we need to see why we are not adding the data into this table.

Is your system bought up with the help of Backup & Restore , i mean did you restored the previous version of freepbx?

Or is this brand new freshly configured system ?