# Problem \_\_FORM\_CSRF at creating service template

**URL:** <https://community.icinga.com/t/problem-form-csrf-at-creating-service-template/14186>\
**Category:** Icinga Director\
**Tags:** director\
**Created:** [October 10, 2024, 1:14pm UTC](https://community.icinga.com/t/problem-form-csrf-at-creating-service-template/14186 "2024-10-10T13:14:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![stheno42](https://community.icinga.com/letter_avatar_proxy/v4/letter/s/e9c0ed/32.png) [@stheno42](https://community.icinga.com/u/stheno42)\
**Post date:** [October 10, 2024, 1:14pm UTC](https://community.icinga.com/t/problem-form-csrf-at-creating-service-template/14186/1 "2024-10-10T13:14:58Z")

</div>

At creating a new service template I get  
Undefined array key “\_\_FORM\_CSRF”

```auto
#0 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/QuickForm.php(623): Icinga\Application\ApplicationBootstrap->Icinga\Application\{closure}()
#1 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/DirectorObjectForm.php(790): Icinga\Module\Director\Web\Form\QuickForm->hasBeenSent()
#2 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/QuickForm.php(370): Icinga\Module\Director\Web\Form\DirectorObjectForm->beforeSetup()
#3 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/QuickForm.php(588): Icinga\Module\Director\Web\Form\QuickForm->prepareElements()
#4 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/QuickForm.php(603): Icinga\Module\Director\Web\Form\QuickForm->setRequest()
#5 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/QuickForm.php(382): Icinga\Module\Director\Web\Form\QuickForm->getRequest()
#6 /usr/share/icingaweb2/modules/director/library/Director/Web/Controller/ObjectController.php(164): Icinga\Module\Director\Web\Form\QuickForm->handleRequest()
#7 /usr/share/icingaweb2/modules/director/application/controllers/ServiceController.php(112): Icinga\Module\Director\Web\Controller\ObjectController->addAction()
#8 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(507): Icinga\Module\Director\Controllers\ServiceController->addAction()
#9 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch()
#10 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch()
#11 /usr/share/php/Icinga/Application/Web.php(290): Zend_Controller_Front->dispatch()
#12 /usr/share/php/Icinga/Application/webrouter.php(105): Icinga\Application\Web->dispatch()
#13 /usr/share/icingaweb2/public/index.php(4): require_once(String)
#14 {main}

```

## My goal:

I created a new icinga command “check\_coverity”  
with type Plugin Check Command  
with nothing imported  
with self created nagios plugin check\_coverity.sh

Next step I tried to create a service template “coverity” with the command “check\_coverity” and got above error message.

Next step would be to create a service for my coverity host with service template “coverity”

## My server:

Icinga2 and icingaweb2 on a server with Ubuntu Jammy 22.04

## My Icinga Packages

```auto
dpkg --list | grep icinga
hi icinga-l10n 1.2.0.20220715.1319+jammy-0 amd64 l10n (short for Localization) provides all translations available for Icinga.
hi icinga-php-common 1.0.0+1654591153+00000000.20220607.0839+bionic-0 amd64 Icinga PHP Common for Icinga Web 2
ii icinga-php-library 0.10.1+3.g305473d-1671829404+ubuntu22.04 all Icinga PHP Library - IPL
hi icinga-php-thirdparty 0.11.0+5+ga92a8e4.20221216.1816+jammy-0 amd64 Icinga PHP Thirdparty for Icinga Web 2

ii icinga2 2.13.6+502.g4b754637f-1671228214+ubuntu22.04 amd64 host and network monitoring system
ii icinga2-bin 2.13.6+502.g4b754637f-1671228214+ubuntu22.04 amd64 host and network monitoring system - daemon
ii icinga2-common 2.13.6+502.g4b754637f-1671228214+ubuntu22.04 all host and network monitoring system - common files
ii icinga2-doc 2.13.6+502.g4b754637f-1671228214+ubuntu22.04 all host and network monitoring system - documentation
ii icinga2-ido-mysql 2.13.6+502.g4b754637f-1671228214+ubuntu22.04 amd64 host and network monitoring system - MySQL support

hi icingacli 2.11.3-2.jammy all simple CLI tool for Icingaweb2 and its modules
ii icingadb 1.1.0+4.g4ed4db3.20221216.2007+jammy-0 amd64 database connector for Icinga 2
ii icingadb-redis 7.0.5.20221019.1129+jammy-0 all Persistent key-value database with network interface (metapackage)
ii icingadb-redis-server 7.0.5.20221019.1129+jammy-0 amd64 Persistent key-value database with network interface
ii icingadb-redis-tools 7.0.5.20221019.1129+jammy-0 amd64 Persistent key-value database with network interface (client)
ii icingadb-web 1.0.2+3.g9fb8a72-1671231804+ubuntu22.04 all Icinga DB Web
hi icingaweb2 2.11.3-2.jammy all simple and responsive web interface for Icinga
hi icingaweb2-common 2.11.3-2.jammy all simple and responsive web interface for Icinga - common files
hi icingaweb2-module-director 1.8.1-2 all simple and responsive web interface for Icinga - director module
hi icingaweb2-module-doc 2.11.3-2.jammy all simple and responsive web interface for Icinga - documentation module
hi icingaweb2-module-incubator 0.6.0-2 all This Module offers to deploy config files through the Director
hi icingaweb2-module-ipl 0.5.0-1 all PHP library for icingaweb2 modules
hi icingaweb2-module-monitoring 2.11.3-2.jammy all simple and responsive web interface for Icinga - monitoring module
hi icingaweb2-module-reactbundle 0.9.0-1 all 3rd party libraries php library for Icinga Web 2
hi php-icinga 2.11.3-2.jammy all PHP library to communicate with and use Icinga

```

## My Icinga Director module

Name director  
Zustand enabled  
Version 1.11.1  
Beschreibung Director - Config tool for Icinga 2  
Icinga Director is a configuration tool that has been designed to make Icinga 2 configuration easy and understandable.  
Abhängigkeiten  
Bibliotheken icinga-php-library \>=0.5.0  
icinga-php-thirdparty \>=0.9.0  
Module incubator \>=0.21.0

## My Icinga Incubator module

Name incubator  
Zustand enabled  
Version 0.22.0  
Beschreibung Incubator provides bleeding-edge libraries  
This repository ships libraries useful for Icinga Web 2 modules. Please download the latest release and install it like any other module.  
Abhängigkeiten  
Bibliotheken icinga-php-library \>=0.5.0  
icinga-php-thirdparty \>=0.8.0

Any tips ?

---

<div class="post-metadata">

**Author:** ![bberg](https://community.icinga.com/letter_avatar_proxy/v4/letter/b/b782af/32.png) [@bberg](https://community.icinga.com/u/bberg)\
**Post date:** [October 11, 2024, 3:22pm UTC](https://community.icinga.com/t/problem-form-csrf-at-creating-service-template/14186/2 "2024-10-11T15:22:00Z")

</div>

Hey,

i would start with using the current versions.  
Both your icinga2 and Icinga Web2 are pretty old.  
Like Icingaweb2 is available in 2.12.1, and icinga2 in 2.14.2

---

<div class="post-metadata">

**Author:** ![moreamazingnick](https://community.icinga.com/user_avatar/community.icinga.com/moreamazingnick/32/7725_2.png) [@moreamazingnick](https://community.icinga.com/u/moreamazingnick)\
**Post date:** [October 15, 2024, 11:00am UTC](https://community.icinga.com/t/problem-form-csrf-at-creating-service-template/14186/3 "2024-10-15T11:00:18Z")

</div>

> [@stheno42](#):
>
> Name director  
> Zustand enabled  
> Version 1.11.1

> [@stheno42](#):
>
> `icingaweb2-module-director 1.8.1-2 `

something is not right

also in director 1.9.2 I saw this behaviour using firefox once but never using chrome

---

<div class="post-metadata">

**Author:** ![moreamazingnick](https://community.icinga.com/user_avatar/community.icinga.com/moreamazingnick/32/7725_2.png) [@moreamazingnick](https://community.icinga.com/u/moreamazingnick)\
**Post date:** [October 25, 2024, 9:01am UTC](https://community.icinga.com/t/problem-form-csrf-at-creating-service-template/14186/4 "2024-10-25T09:01:29Z")

</div>

also, retry with google chrome if you have this problem with for example firefox
