{"id":4120,"date":"2021-09-09T16:49:55","date_gmt":"2021-09-09T21:49:55","guid":{"rendered":"https:\/\/www.incredigeek.com\/home\/?p=4120"},"modified":"2021-09-09T16:49:55","modified_gmt":"2021-09-09T21:49:55","slug":"librenms-error-running-validate-php-database-incorrect-column","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/librenms-error-running-validate-php-database-incorrect-column\/","title":{"rendered":"LibreNMS Error Running .\/validate.php &#8211; Database: incorrect column&#8230;"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2021\/09\/image.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"133\" src=\"https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2021\/09\/image-1024x133.png\" alt=\"\" class=\"wp-image-4123\" srcset=\"https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2021\/09\/image-1024x133.png 1024w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2021\/09\/image-300x39.png 300w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2021\/09\/image-768x100.png 768w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2021\/09\/image-500x65.png 500w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2021\/09\/image.png 1529w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption>LibreNMS error while running .\/validate.php<\/figcaption><\/figure>\n\n\n\n<p>Recently I started getting the following error while running .\/validate.php.  <\/p>\n\n\n\n<pre class=\"wp-block-code\"><pre>\n$ sudo -u librenms .\/validate.php\n====================================\nComponent | Version\n--------- | -------\nLibreNMS  | 21.8.0-41-g0a76ca4\nDB Schema | 2021_08_26_093522_config_value_to_medium_text (217)\nPHP       | 7.4.20\nPython    | 3.6.8\nMySQL     | 10.5.10-MariaDB\nRRDTool   | 1.4.8\nSNMP      | NET-SNMP 5.7.2\n====================================\n\n&#91;OK]    Composer Version: 2.1.6\n&#91;OK]    Dependencies up-to-date.\n&#91;OK]    Database connection successful\n&#91;FAIL]  Database: incorrect column (notifications\/datetime)\n&#91;FAIL]  Database: incorrect column (users\/created_at)\n&#91;FAIL]  We have detected that your database schema may be wrong, please report the following to us on Discord (https:\/\/t.libren.ms\/discord) or the community site (https:\/\/t.libren.ms\/5gscd):\n        &#91;FIX]:\n        Run the following SQL statements to fix.\n        SQL Statements:\n         SET TIME_ZONE='+00:00';\n         ALTER TABLE `notifications` CHANGE `datetime` `datetime` timestamp NOT NULL DEFAULT '1970-01-02 00:00:00' ;\n         ALTER TABLE `users` CHANGE `created_at` `created_at` timestamp NOT NULL DEFAULT '1970-01-02 00:00:01' ;<\/pre><\/pre>\n\n\n\n<p>Reading online it sounds like some of the recent changes are causing the issue.  Looks fairly easy to resolve though.<\/p>\n\n\n\n<p>First we&#8217;ll need to get a MySQL prompt.  We&#8217;ll do that by running<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql -u librenms -p librenms<\/pre>\n\n\n\n<p>It&#8217;ll ask use for the librenms user&#8217;s mysql password.<\/p>\n\n\n\n<p>Once we have the MySQL prompt we can just copy and paste the commands in.<\/p>\n\n\n\n<pre>SET TIME_ZONE='+00:00';\nALTER TABLE `notifications` CHANGE `datetime` `datetime` timestamp NOT NULL DEFAULT '1970-01-02 00:00:00' ;\nALTER TABLE `users` CHANGE `created_at` `created_at` timestamp NOT NULL DEFAULT '1970-01-02 00:00:01' ;<\/pre>\n\n\n\n\n<p>Type &#8216;quit&#8217; to exit MySQL and lets run the validate script again.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo -u librenms .\/validate.php<\/pre>\n\n\n\n<p>Everything should check out OK.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently I started getting the following error while running .\/validate.php. $ sudo -u librenms .\/validate.php ==================================== Component | Version &#8212;&#8212;&#8212; | &#8212;&#8212;- LibreNMS | 21.8.0-41-g0a76ca4 DB Schema | 2021_08_26_093522_config_value_to_medium_text (217) PHP | 7.4.20 Python | 3.6.8 MySQL | 10.5.10-MariaDB RRDTool &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/librenms-error-running-validate-php-database-incorrect-column\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[352,135],"tags":[353,7,282,134,136,389],"class_list":["post-4120","post","type-post","status-publish","format-standard","hentry","category-librenms","category-mysql","tag-librenms","tag-linux-2","tag-mariadb","tag-monitoring","tag-mysql-2","tag-nms"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/4120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=4120"}],"version-history":[{"count":4,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/4120\/revisions"}],"predecessor-version":[{"id":4125,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/4120\/revisions\/4125"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=4120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=4120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=4120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}