{"id":11483631,"date":"2019-04-30T21:33:48","date_gmt":"2019-04-30T21:33:48","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/cannot-activate-redirection\/"},"modified":"2019-04-30T21:33:48","modified_gmt":"2019-04-30T21:33:48","slug":"cannot-activate-redirection","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/cannot-activate-redirection\/","title":{"rendered":"Cannot activate Redirection"},"content":{"rendered":"<p>Hello,<\/p>\n<p>I am unable to use Redirection due to a couple errors.  I believe this started when I updated to WordPress 5.1.1, and updated Redirection to 4.2.3.  I was prompted to up upgrade the Redirection database, which upgraded without issue.  However, following this, I am unable to add new redirects, receiving the following error when I attempt to do so:<\/p>\n<blockquote><p>Unable to add new redirect (41): Incorrect integer value: &#8221; for column &#8216;regex&#8217; at row 1<\/p>\n<p>Plugin: 4.2.3<br \/>\nWordPress: 5.1.1 (multi)<br \/>\nPHP: 7.2.17<br \/>\nBrowser: Mozilla\/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko\/20100101 Firefox\/66.0<br \/>\nJavaScript: https:\/\/www.website.com\/subsite\/wp-content\/plugins\/redirection\/redirection.js<br \/>\nREST API: https:\/\/www.website.com\/subsite\/wp-json\/<\/p>\n<p>Error: Unable to add new redirect (41): Incorrect integer value: &#8221; for column &#8216;regex&#8217; at row 1<br \/>\nAction: redirection\/v1\/redirect\/ POST<br \/>\nParams: {&#8220;id&#8221;:0,&#8221;url&#8221;:&#8221;\/source&#8221;,&#8221;title&#8221;:&#8221;&#8221;,&#8221;match_data&#8221;:{&#8220;source&#8221;:{&#8220;flag_regex&#8221;:false,&#8221;flag_trailing&#8221;:false,&#8221;flag_case&#8221;:false,&#8221;flag_query&#8221;:&#8221;exact&#8221;}},&#8221;match_type&#8221;:&#8221;url&#8221;,&#8221;action_type&#8221;:&#8221;url&#8221;,&#8221;position&#8221;:0,&#8221;group_id&#8221;:1,&#8221;action_code&#8221;:301,&#8221;action_data&#8221;:{&#8220;url&#8221;:&#8221;https:\/\/www.website.com\/target&#8221;}}<br \/>\nCode: 400 Bad Request<br \/>\nRaw: {&#8220;code&#8221;:&#8221;redirect&#8221;,&#8221;message&#8221;:&#8221;Unable to add new redirect&#8221;,&#8221;data&#8221;:{&#8220;status&#8221;:400,&#8221;error_code&#8221;:41,&#8221;wpdb&#8221;:&#8221;Incorrect integer value: &#8221; for column &#8216;regex&#8217; at row 1&#8243;}}<\/p><\/blockquote>\n<p>Accompanied by an error in the server log:<\/p>\n<blockquote><p>PHP message: WordPress database error Incorrect integer value: &#8221; for column &#8216;regex&#8217; at row 1 for query INSERT INTO <code>wp_5_redirection_items<\/code> (<code>regex<\/code>, <code>match_type<\/code>, <code>url<\/code>, <code>match_url<\/code>, <code>title<\/code>, <code>group_id<\/code>, <code>position<\/code>, <code>action_type<\/code>, <code>action_code<\/code>, <code>action_data<\/code>, <code>status<\/code>) VALUES (&#8221;, &#8216;url&#8217;, &#8216;\/source&#8217;, &#8216;\/source&#8217;, &#8221;, &#8216;1&#8217;, &#8216;3&#8217;, &#8216;url&#8217;, &#8216;301&#8217;, &#8216;https:\/\/www.website.com\/target&#8217;, &#8216;enabled&#8217;) made by Red_Item::create&#8221; while reading response header from upstream, client: 130.111.28.84, server: www.website.com, request: &#8220;POST \/subsite\/wp-json\/redirection\/v1\/redirect\/?_wpnonce=3bb5ca08e7 HTTP\/1.1&#8221;, upstream: &#8220;fastcgi:\/\/unix:\/var\/run\/php-fpm\/php-fpm.sock:&#8221;, host: &#8220;www.website.com&#8221;, referrer: &#8220;https:\/\/www.website.com\/subsite\/wp-admin\/tools.php?page=redirection.php&#8221;<\/p><\/blockquote>\n<p>If I try to uninstall and reinstall the plugin, it will prompt me to complete Redirection setup to finish installation.  Trying to &#8220;Finish Setup&#8221; (setup makes it past initial options &amp; REST API check) produces the following error:<\/p>\n<blockquote><p>Database problem<\/p>\n<p>Failed to perform query &#8220;CREATE TABLE IF NOT EXISTS <code>wp_redirection_items<\/code> ( <code>id<\/code> int(11) unsigned NOT NULL AUTO_INCREMENT, <code>url<\/code> mediumtext NOT NULL, <code>match_url<\/code> varchar(2000) DEFAULT NULL, <code>match_data<\/code> text, <code>regex<\/code> int(11) unsigned NOT NULL DEFAULT &#8216;0&#8217;, <code>position<\/code> int(11) unsigned NOT NULL DEFAULT &#8216;0&#8217;, <code>last_count<\/code> int(10) unsigned NOT NULL DEFAULT &#8216;0&#8217;, <code>last_access<\/code> datetime NOT NULL DEFAULT &#8216;0000-00-00 00:00:00&#8217;, <code>group_id<\/code> int(11) NOT NULL DEFAULT &#8216;0&#8217;, <code>status<\/code> enum(&#8216;enabled&#8217;,&#8217;disabled&#8217;) NOT NULL DEFAULT &#8216;enabled&#8217;, <code>action_type<\/code> varchar(20) NOT NULL, <code>action_code<\/code> int(11) unsigned NOT NULL, <code>action_data<\/code> mediumtext, <code>match_type<\/code> varchar(20) NOT NULL, <code>title<\/code> text, PRIMARY KEY (<code>id<\/code>), KEY <code>url<\/code> (<code>url<\/code>(191)), KEY <code>status<\/code> (<code>status<\/code>), KEY <code>regex<\/code> (<code>regex<\/code>), KEY <code>group_idpos<\/code> (<code>group_id<\/code>,<code>position<\/code>), KEY <code>group<\/code> (<code>group_id<\/code>), KEY <code>match_url<\/code> (<code>match_url<\/code>(191)) ) DEFAULT CHARACTER SET utf8mb4 COLLATE=utf8_general_ci&#8221;<\/p><\/blockquote>\n<blockquote><p>Message: Failed to perform query &#8220;CREATE TABLE IF NOT EXISTS <code>wp_redirection_items<\/code> (<br \/>\n<code>id<\/code> int(11) unsigned NOT NULL AUTO_INCREMENT,<br \/>\n<code>url<\/code> mediumtext NOT NULL,<br \/>\n<code>match_url<\/code> varchar(2000) DEFAULT NULL,<br \/>\n<code>match_data<\/code> text,<br \/>\n<code>regex<\/code> int(11) unsigned NOT NULL DEFAULT &#8216;0&#8217;,<br \/>\n<code>position<\/code> int(11) unsigned NOT NULL DEFAULT &#8216;0&#8217;,<br \/>\n<code>last_count<\/code> int(10) unsigned NOT NULL DEFAULT &#8216;0&#8217;,<br \/>\n<code>last_access<\/code> datetime NOT NULL DEFAULT &#8216;0000-00-00 00:00:00&#8217;,<br \/>\n<code>group_id<\/code> int(11) NOT NULL DEFAULT &#8216;0&#8217;,<br \/>\n<code>status<\/code> enum(&#8216;enabled&#8217;,&#8217;disabled&#8217;) NOT NULL DEFAULT &#8216;enabled&#8217;,<br \/>\n<code>action_type<\/code> varchar(20) NOT NULL,<br \/>\n<code>action_code<\/code> int(11) unsigned NOT NULL,<br \/>\n<code>action_data<\/code> mediumtext,<br \/>\n<code>match_type<\/code> varchar(20) NOT NULL,<br \/>\n<code>title<\/code> text,<br \/>\nPRIMARY KEY (<code>id<\/code>),<br \/>\nKEY <code>url<\/code> (<code>url<\/code>(191)),<br \/>\nKEY <code>status<\/code> (<code>status<\/code>),<br \/>\nKEY <code>regex<\/code> (<code>regex<\/code>),<br \/>\nKEY <code>group_idpos<\/code> (<code>group_id<\/code>,<code>position<\/code>),<br \/>\nKEY <code>group<\/code> (<code>group_id<\/code>),<br \/>\nKEY <code>match_url<\/code> (<code>match_url<\/code>(191))<br \/>\n) DEFAULT CHARACTER SET utf8mb4 COLLATE=utf8_general_ci&#8221;<br \/>\nInstalled: &#8211;<br \/>\nNext: 4.1<br \/>\nDebug:<\/p>\n<p>COLLATION &#8216;utf8_general_ci&#8217; is not valid for CHARACTER SET &#8216;utf8mb4&#8217;<br \/>\nTable &#8220;wp_redirection_items&#8221; is missing<br \/>\nTable &#8220;wp_redirection_groups&#8221; is missing<br \/>\nTable &#8220;wp_redirection_logs&#8221; is missing<br \/>\nTable &#8220;wp_redirection_404&#8221; is missing<br \/>\nStage: create_tables<\/p><\/blockquote>\n<p>If anyone can offer some tips on solving this issue, it would be much appreciated.<\/p>\n<p>Thanks,<br \/>\nZach<\/p>\n","protected":false},"template":"","class_list":["post-11483631","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/11483631","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/11483631\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=11483631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}