{"id":1184,"date":"2022-10-09T23:17:04","date_gmt":"2022-10-09T21:17:04","guid":{"rendered":"https:\/\/alessandromasciadri.com\/?p=1184"},"modified":"2022-10-09T23:49:00","modified_gmt":"2022-10-09T21:49:00","slug":"come-risolvere-lerrore-sqlstate22001-in-freepbx","status":"publish","type":"post","link":"https:\/\/alessandromasciadri.com\/come-risolvere-lerrore-sqlstate22001-in-freepbx\/","title":{"rendered":"Come risolvere l&#8217;errore SQLSTATE[22001] in FreePBX"},"content":{"rendered":"\t\t<div data-akihiro-type=\"ama-post\" data-akihiro-id=\"1184\" class=\"akihiro akihiro-1184\" data-akihiro-post-type=\"post\">\n\t\t\t\t<div class=\"akihiro-element akihiro-element-334df6e e-flex e-con-boxed e-con e-parent\" data-id=\"334df6e\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"akihiro-element akihiro-element-6b9e496 akihiro-widget akihiro-widget-text-editor\" data-id=\"6b9e496\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Durante l&#8217;installazione del sound language italiano in FreePBX 16 su Asterisk 19, mi sono imbattuto nel seguente errore:<\/p><blockquote><p>SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column &#8216;filename&#8217; at row 1<br \/>File:\/var\/www\/html\/admin\/modules\/soundlang\/Soundlang.class.php:1124<\/p><\/blockquote><p>Questo \u00e8 un bug noto e qui censito: https:\/\/issues.freepbx.org\/browse\/FREEPBX-20981<\/p><p>Non essendo ancora stato risolto, si pu\u00f2 applicare una patch seguendo i passaggi illustrati qui di seguito.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-d2045be akihiro-widget akihiro-widget-heading\" data-id=\"d2045be\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t<h3 class=\"akihiro-heading-title akihiro-size-default\">Come risolvere l'errore \"Data too long for column 'filename' at row 1\"<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-929a8fc akihiro-widget akihiro-widget-text-editor\" data-id=\"929a8fc\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>La risoluzione dell&#8217;errore si raggiunge incrementando la lunghezza massima consentita del campo <code>filename<\/code> della tabella <code>soundlang_prompts<\/code> appartenente al database <code>asterisk<\/code>.<\/p><p>Come prima cosa accediamo a mysql.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-7f4f021 akihiro-widget akihiro-widget-code-highlight\" data-id=\"7f4f021\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-okaidia copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-bash \">\n\t\t\t\t<code readonly=\"true\" class=\"language-bash\">\n\t\t\t\t\t<xmp>sudo mysql<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-eaf32e5 akihiro-widget akihiro-widget-text-editor\" data-id=\"eaf32e5\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Lanciando una query per verificare il nome del database<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-e8f2005 akihiro-widget akihiro-widget-code-highlight\" data-id=\"e8f2005\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-okaidia  \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-bash \">\n\t\t\t\t<code readonly=\"true\" class=\"language-bash\">\n\t\t\t\t\t<xmp>MariaDB [(none)]> SHOW DATABASES;\n+--------------------+\n| Database           |\n+--------------------+\n| asterisk           |\n| asteriskcdrdb      |\n| information_schema |\n| mysql              |\n| performance_schema |\n| sys                |\n+--------------------+<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-8645452 akihiro-widget akihiro-widget-text-editor\" data-id=\"8645452\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Selezioniamo il database &lt;code&gt;asterisk&lt;\/code&gt;<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-c1c80b7 akihiro-widget akihiro-widget-code-highlight\" data-id=\"c1c80b7\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-okaidia  \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-bash \">\n\t\t\t\t<code readonly=\"true\" class=\"language-bash\">\n\t\t\t\t\t<xmp>MariaDB [(none)]> USE asterisk;\nDatabase changed<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-af0c7e8 akihiro-widget akihiro-widget-text-editor\" data-id=\"af0c7e8\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Visualizziamo le tabelle contenute nel database<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-6b5b304 akihiro-widget akihiro-widget-code-highlight\" data-id=\"6b5b304\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-okaidia  \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-bash \">\n\t\t\t\t<code readonly=\"true\" class=\"language-bash\">\n\t\t\t\t\t<xmp>MariaDB [asterisk]> SHOW TABLES;\n+-----------------------------------------+\n| Tables_in_asterisk                      |\n+-----------------------------------------+\n| admin                                   |\n| ampusers                                |\n| announcement                            |\n| arimanager                              |\n| callrecording                           |\n| callrecording_module                    |\n| certman_cas                             |\n| certman_certs                           |\n| certman_csrs                            |\n| certman_mapping                         |\n| cidlookup                               |\n| cidlookup_incoming                      |\n| contactmanager_entry_emails             |\n| contactmanager_entry_images             |\n| contactmanager_entry_numbers            |\n| contactmanager_entry_speeddials         |\n| contactmanager_entry_userman_images     |\n| contactmanager_entry_websites           |\n| contactmanager_entry_xmpps              |\n| contactmanager_general_favorites        |\n| contactmanager_group_entries            |\n| contactmanager_groups                   |\n| contactmanager_user_favorites           |\n| cron_jobs                               |\n| cronmanager                             |\n| custom_extensions                       |\n| dahdi                                   |\n| dahdichandids                           |\n| daynight                                |\n| devices                                 |\n| emergencydevices                        |\n| featurecodes                            |\n| findmefollow                            |\n| freepbx_log                             |\n| freepbx_settings                        |\n| globals                                 |\n| iax                                     |\n| incoming                                |\n| indications_zonelist                    |\n| ivr_details                             |\n| ivr_entries                             |\n| kvblobstore                             |\n| kvstore_Dashboard                       |\n| kvstore_FreePBX                         |\n| kvstore_FreePBX_Framework               |\n| kvstore_FreePBX_Hooks                   |\n| kvstore_FreePBX_Media                   |\n| kvstore_FreePBX_modules_Backup          |\n| kvstore_FreePBX_modules_Calendar        |\n| kvstore_FreePBX_modules_Conferences     |\n| kvstore_FreePBX_modules_Contactmanager  |\n| kvstore_FreePBX_modules_Core            |\n| kvstore_FreePBX_modules_Customappsreg   |\n| kvstore_FreePBX_modules_Filestore       |\n| kvstore_FreePBX_modules_Printextensions |\n| kvstore_FreePBX_modules_Userman         |\n| kvstore_FreePBX_modules_Voicemail       |\n| kvstore_OOBE                            |\n| kvstore_Sipsettings                     |\n| logfile_logfiles                        |\n| logfile_settings                        |\n| manager                                 |\n| meetme                                  |\n| module_xml                              |\n| modules                                 |\n| music                                   |\n| notifications                           |\n| outbound_route_email                    |\n| outbound_route_patterns                 |\n| outbound_route_sequence                 |\n| outbound_route_trunks                   |\n| outbound_routes                         |\n| parkplus                                |\n| pjsip                                   |\n| queues_config                           |\n| queues_details                          |\n| recordings                              |\n| ringgroups                              |\n| setcid                                  |\n| sip                                     |\n| sipsettings                             |\n| soundlang_customlangs                   |\n| soundlang_packages                      |\n| soundlang_prompts                       |\n| soundlang_settings                      |\n| sysadmin_fail2ban                       |\n| sysadmin_options                        |\n| sysadmin_update_log                     |\n| timeconditions                          |\n| timegroups_details                      |\n| timegroups_groups                       |\n| trunk_dialpatterns                      |\n| trunks                                  |\n| ucp_sessions                            |\n| userman_directories                     |\n| userman_groups                          |\n| userman_groups_settings                 |\n| userman_template_settings               |\n| userman_ucp_templates                   |\n| userman_users                           |\n| userman_users_settings                  |\n| users                                   |\n| voicemail_admin                         |\n+-----------------------------------------+<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-5cd817a akihiro-widget akihiro-widget-text-editor\" data-id=\"5cd817a\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t\t\tVerifichiamo la struttura della tabella <code>soundlang_prompts<\/code>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-7c1dd52 akihiro-widget akihiro-widget-code-highlight\" data-id=\"7c1dd52\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-okaidia  \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-bash \">\n\t\t\t\t<code readonly=\"true\" class=\"language-bash\">\n\t\t\t\t\t<xmp>MariaDB [asterisk]> DESCRIBE soundlang_prompts;\n+----------+-------------+------+-----+---------+-------+\n| Field    | Type        | Null | Key | Default | Extra |\n+----------+-------------+------+-----+---------+-------+\n| type     | varchar(20) | NO   |     | NULL    |       |\n| module   | varchar(80) | NO   |     | NULL    |       |\n| language | varchar(20) | NO   |     | NULL    |       |\n| format   | varchar(20) | NO   |     | NULL    |       |\n| filename | varchar(80) | YES  |     | NULL    |       |\n+----------+-------------+------+-----+---------+-------+<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-0f21c84 akihiro-widget akihiro-widget-text-editor\" data-id=\"0f21c84\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t\t\tModifichiamo la lunghezza massima del campo <code>filename<\/code> impostandolo a 255\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-d672202 akihiro-widget akihiro-widget-code-highlight\" data-id=\"d672202\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-okaidia  \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-bash \">\n\t\t\t\t<code readonly=\"true\" class=\"language-bash\">\n\t\t\t\t\t<xmp>MariaDB [asterisk]> ALTER TABLE soundlang_prompts MODIFY filename VARCHAR(255);\nQuery OK, 0 rows affected (0.019 sec)\nRecords: 0  Duplicates: 0  Warnings: 0<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-5ee82b2 akihiro-widget akihiro-widget-text-editor\" data-id=\"5ee82b2\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t\t\tInterroghiamo nuovamente la struttura della tabella <code>soundlang_prompts<\/code> verificando che il campo \u00e8 ora un VARCHAR(255)\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-4cff016 akihiro-widget akihiro-widget-code-highlight\" data-id=\"4cff016\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-okaidia  \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-bash \">\n\t\t\t\t<code readonly=\"true\" class=\"language-bash\">\n\t\t\t\t\t<xmp>MariaDB [asterisk]> DESCRIBE soundlang_prompts;\n+----------+--------------+------+-----+---------+-------+\n| Field    | Type         | Null | Key | Default | Extra |\n+----------+--------------+------+-----+---------+-------+\n| type     | varchar(20)  | NO   |     | NULL    |       |\n| module   | varchar(80)  | NO   |     | NULL    |       |\n| language | varchar(20)  | NO   |     | NULL    |       |\n| format   | varchar(20)  | NO   |     | NULL    |       |\n| filename | varchar(255) | YES  |     | NULL    |       |\n+----------+--------------+------+-----+---------+-------+<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-f938e98 akihiro-widget akihiro-widget-text-editor\" data-id=\"f938e98\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Ora lanciando di nuovo l&#8217;installazione della lingua italiana dal menu Admin -&gt; Sound Languages il processo verr\u00e0 eseguito completandosi con successo.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Durante l&#8217;installazione del sound language italiano in FreePBX 16 su Asterisk 19, mi sono imbattuto nel seguente errore: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column &#8216;filename&#8217; at row 1File:\/var\/www\/html\/admin\/modules\/soundlang\/Soundlang.class.php:1124 Questo \u00e8 un bug noto e qui censito: https:\/\/issues.freepbx.org\/browse\/FREEPBX-20981 Non essendo ancora stato risolto, si pu\u00f2 applicare una patch seguendo i passaggi [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[37,39,38],"class_list":["post-1184","post","type-post","status-publish","format-standard","hentry","category-sistemistica","tag-asterisk","tag-freepbx","tag-voip"],"_links":{"self":[{"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/posts\/1184","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/comments?post=1184"}],"version-history":[{"count":19,"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/posts\/1184\/revisions"}],"predecessor-version":[{"id":1203,"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/posts\/1184\/revisions\/1203"}],"wp:attachment":[{"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/media?parent=1184"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/categories?post=1184"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/tags?post=1184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}