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

[dev.icinga.com #13231] Not able to add long DNS names to address in Icingaweb2 Director. Getting mysql error #607

Open
icinga-migration opened this issue Nov 17, 2016 · 3 comments
Labels

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/13231

Created by rnekkanti on 2016-11-17 18:16:35 +00:00

Assignee: (none)
Status: New
Target Version: (none)
Last Update: 2016-12-07 18:32:07 +00:00 (in Redmine)


Hello,

I am not able to add long DNS names to address while defining a host in icingaweb2 director. For small DNS names it is fine but when adding ELB addresses I am seeing problems. Looks like we are maxing out the limit of characters for address in the mysql table. Can you look into this.

ELB hosts (Storing icinga_host[gn5448-sports-gns-api-dev-elb] failed: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'address' at row 1, query was: UPDATE icinga_host SET address = ? WHERE (id = '2586') {array ( 'id' => '2586', 'object_name' => 'gn5448-sports-gns-api-dev-elb', 'object_type' => 'object', 'disabled' => 'n', 'display_name' => 'internal-gn5448-sports-gns-api-dev-elb-861732576.us-west-2.elb.amazonaws.com', 'address' => 'internal-gn5448-sports-gns-api-dev-elb-861732576.us-west-2.elb.amazonaws.com', 'address6' => NULL, 'check_command_id' => NULL, 'max_check_attempts' => NULL, 'check_period_id' => NULL, 'check_interval' => NULL, 'retry_interval' => NULL, 'enable_notifications' => NULL, 'enable_active_checks' => NULL, 'enable_passive_checks' => NULL, 'enable_event_handler' => NULL, 'enable_flapping' => NULL, 'enable_perfdata' => NULL, 'event_command_id' => NULL, 'flapping_threshold' => NULL, 'volatile' => NULL, 'zone_id' => NULL, 'command_endpoint_id' => NULL, 'notes' => NULL, 'notes_url' => NULL, 'action_url' => NULL, 'icon_image' => NULL, 'icon_image_alt' => NULL, 'has_agent' => NULL, 'master_should_connect' => NULL, 'accept_config' => NULL, 'api_key' => NULL, )}) host

Thanks.

@icinga-migration
Copy link
Author

Updated by mbassett on 2016-12-02 20:55:55 +00:00

MariaDB [director]> describe icinga_host;

Field Type Null Key Default Extra
id int(10) unsigned NO PRI NULL auto_increment
object_name varchar(255) NO UNI NULL
object_type enum('object','template') NO NULL
disabled enum('y','n') NO n
display_name varchar(255) YES MUL NULL
address varchar(64) YES NULL
address6 varchar(45) YES NULL

so address is max 64 characters. This likely needs a schema update, but you could alter the table length manually

alter table icinga_host set column address varchar (255); (for example)

@icinga-migration
Copy link
Author

Updated by tgelf on 2016-12-06 13:19:32 +00:00

That's why I wanted to have a dedicated, preferably binary field for just IP addresses long time ago. Aaaaaaaaaaargh :-p

@rnekkanti: in the meantime you can easily enlarge the field by running:

ALTER TABLE icinga_host MODIFY address VARCHAR(255) DEFAULT NULL;

Should not cause any harm in case I add a similar DB migration later on. And in case it does, please let me know ;-)

@mbassett: correct, thanks.

@icinga-migration
Copy link
Author

Updated by rnekkanti on 2016-12-07 18:32:07 +00:00

mbassett and tgelf

Thanks for the update. I made the changes and it looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant