ctdk / goiardi

A Chef server written in Go, able to run entirely in memory, with optional persistence with saving the in-memory data to disk or using MySQL or Postgres as the data storage backend. Docs: http://goiardi.readthedocs.io/en/latest/index.html
http://goiardi.gl
Apache License 2.0
280 stars 39 forks source link

Column extended_info too small in goiardi-schema-mysql.sql #64

Open SlashDashAndCash opened 4 years ago

SlashDashAndCash commented 4 years ago

Describe the bug

when I run chef-client against goiardi it can't report node state back to server:

INFO: HTTP Request Returned 500 Internal Server Error: Error 1406: Data too long for column 'extended_info' at row 1

It turned out the report is >100k which is too large for MariaDB's 'text' type of 64k

You should modify the schema:

--- /usr/share/goiardi/sql-files/sql-files/goiardi-schema-mysql.sql_orig    2019-02-14 18:44:26.000000000 +0100
+++ /usr/share/goiardi/sql-files/sql-files/goiardi-schema-mysql.sql 2019-12-07 21:52:23.159692624 +0100
@@ -269,7 +269,7 @@
   `action` enum('create','delete','modify') NOT NULL,
   `object_type` varchar(100) NOT NULL,
   `object_name` varchar(255) NOT NULL,
-  `extended_info` text,
+  `extended_info` mediumtext,
   PRIMARY KEY (`id`),
   KEY `actor_id` (`actor_id`),
   KEY `action` (`action`),
ctdk commented 4 years ago

Oh my, I had overlooked that. (Sorry for just now seeing this, I've been preoccupied with a lot for quite a while, but I'm trying to catch up.) MySQL support's being dropped in the finally-for-real-this-time approaching 1.0.0, but I'll look over the problem and weigh how to best address this and see if I made a similar fix on the postgres side and forgot to make it there as well.

Thanks for bringing it to my attention, though. It's been a slog, but I've turned my attention back to goiardi again and pulled myself over one of the terrible humps recently.