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

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

Open
owirtifo opened this issue Oct 10, 2024 · 8 comments
Open

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

owirtifo opened this issue Oct 10, 2024 · 8 comments
Labels
bug Something isn't working needs-information Further information is requested

Comments

@owirtifo
Copy link

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 owirtifo added bug Something isn't working triage Triage labels Oct 10, 2024
@owirtifo
Copy link
Author

owirtifo commented Nov 28, 2024

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
Copy link
Member

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 ?

@owirtifo
Copy link
Author

owirtifo commented Dec 1, 2024

Hi @kguptasangoma!
I discovered this problem after a new installation of FreePBX. I think it's worth checking out the table creation script that runs during installation.

@kguptasangoma
Copy link
Member

Hi @owirtifo did you updated the module just after Freepbx 16 installation ? Our distro iso could be old one so asking.

@owirtifo
Copy link
Author

owirtifo commented Dec 2, 2024

Hi @kguptasangoma!
This is the first thing I decided to do. I tried to upgrade to the latest version (16.0.23) and downgrade to different versions, but unfortunately this did not solve the problem.
The error continues to appear in the addSettingsById function Findmefollow.class.php. String $sql = "INSERT INTO findmefollow (grpnum,$setting) VALUES (:grpnum,:value) ON DUPLICATE KEY UPDATE $setting = :value"; will not contain values for the grptime, strategy and grplist fields when other fields are changed.
Perhaps it would be correct to change to:
$sql = "INSERT INTO findmefollow (grpnum,strategy,grplist,grptime,$setting) VALUES (:grpnum,:strategy,:grplist,:grptime,:value) ON DUPLICATE KEY UPDATE $setting = :value";

@kguptasangoma
Copy link
Member

thanks @owirtifo , we will try to reproduce this issue locally.

@msanthosh18
Copy link

Hi @owirtifo
We tried to reproduce the above issue with fresh install on v16 but we are able to change the settings,
We tried with default language along with below mentioned module versions
framework | 16.0.40.11
ucp | 16.0.38.2
findmefollow | 16.0.23

Can you give a try as suggested below

  1. Update framework to latest
  2. Change the language to default and try
  3. can you try with any other extension
  4. are you able to make changes for other UCP widget

@msanthosh18 msanthosh18 added needs-information Further information is requested and removed triage Triage labels Dec 3, 2024
@owirtifo
Copy link
Author

owirtifo commented Dec 3, 2024

Hi @msanthosh18!
I tried to follow all the suggested steps. Unfortunately, this did not solve the problem. There are no problems changing the parameters in the Missed calls widget.
I assume this is because the component update did not change the fields:

`strategy` varchar(50) NOT NULL,
`grptime` smallint(6) NOT NULL,
`grplist` varchar(255) NOT NULL,

findmefollow tables where these fields require a value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-information Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants