Couldn't parse the INI file `/etc/icingaweb2/modules/director/config.ini'

Hello Team,
I am facing this error with icinga director, could anyone help me? thanks!
““Couldn’t parse the INI file `/etc/icingaweb2/modules/director/config.ini’””

What are the outputs of the commands “ls -l” and “file” on that file?

Antony.

Hi Antony
/etc/icingaweb2/modules/director# ls -l
total 4
-rw-rw---- 1 www-data icingaweb2 145 Oct 6 07:30 config.ini
#cat config.ini
[db]
resource = “director”

I’d actually asked for the output of “file”, not “cat”, but we can see from the
result that it looks like a text file, so that’s good.

I’m a little puzzled at the file being owned by www-data, but maybe someone
with more Director experience that I have can confirm whether that’s correct,
and also whether the content is reasonable.

I’m merely somewhat puzzled that a file containing 28 bytes of data is listed
as 145 bytes in size…

Antony.

#0 /usr/share/php/Icinga/Application/Config.php(326): Icinga\File\Ini\IniParser::parseIniFile(String)
#1 /usr/share/php/Icinga/Application/Config.php(421): Icinga\Application\Config::fromIni(String)
#2 /usr/share/php/Icinga/Web/Controller/ModuleActionController.php(46): Icinga\Application\Config::module(String)
#3 /usr/share/icingaweb2/modules/director/application/controllers/IndexController.php(17): Icinga\Web\Controller\ModuleActionController->Config()
#4 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(507): Icinga\Module\Director\Controllers\IndexController->indexAction()
#5 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch(String)
#6 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#7 /usr/share/php/Icinga/Application/Web.php(300): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#8 /usr/share/php/Icinga/Application/webrouter.php(99): Icinga\Application\Web->dispatch()
#9 /usr/share/icingaweb2/public/index.php(4): require_once(String)
#10 {main}

That’s ok, as long as /etc/icingaweb2/resources.ini contains an according section [director].

Hi Roland,
May i know what is the solution for my issue. Kindly tell me what to do?

As @Pooh already mentioned:

it looks like your config.ini is malformed. Please share the results of file /etc/icingaweb2/modules/director/config.ini and hd /etc/icingaweb2/modules/director/config.ini.

may i know what is result of file means?
you asking me to cat the file or what can i do?
Please let me know.

Hmm, I’m not sure if you’re kidding me.

I’ve asked you to issue to commands at your system and paste their results here:

  1. file /etc/icingaweb2/modules/director/config.ini
  2. hd /etc/icingaweb2/modules/director/config.ini

/etc/icingaweb2/modules/director/config.ini: ASCII text

00000000 5b 64 62 5d 0a 72 65 73 6f 75 72 63 65 20 3d 20 |[db].resource = |
00000010 22 64 69 72 65 63 74 6f 72 22 0a 0a 23 5b 63 6f |“director”…#[co|
00000020 6e 66 69 67 5d 0a 23 65 6e 64 70 6f 69 6e 74 20 |nfig].#endpoint |
00000030 3d 20 69 63 69 6e 67 61 2d 6d 61 73 74 65 72 0a |= icinga-master.|
00000040 23 68 6f 73 74 20 3d 20 31 32 37 2e 30 2e 30 2e |#host = 127.0.0.|
00000050 31 0a 23 70 6f 72 74 20 3d 20 35 36 36 35 0a 23 |1.#port = 5665.#|
00000060 75 73 65 72 6e 61 6d 65 20 3d 20 64 69 72 65 63 |username = asdfg|
00000070 74 6f 72 0a 23 70 61 73 73 77 6f 72 64 20 3d 20 |asdf.#password = |
00000080 49 6e 66 6f 64 62 61 21 69 6e 66 6f 64 62 61 31 |asdfghjkl|
00000090 0a |.|
00000091

Remove everything except:

[db]
resource = “director”

Hi Roland,
yes i have removed as you said.

now, i can see the below info on icinga director
I found no Endpoint object called “icinga” on xxx.xx.x.x:5665 (KickstartHelper.php:357)

what is the next step ?? kindly explain!

Here in the docs you’ll find the next steps for the kickstart: https://icinga.com/docs/director/latest/doc/03-Automation/