# Database schema migration failure (Icinga Web v2.12.1)

**URL:** <https://community.icinga.com/t/database-schema-migration-failure-icinga-web-v2-12-1/13092>\
**Category:** Icinga Web\
**Created:** [January 4, 2024, 11:38pm UTC](https://community.icinga.com/t/database-schema-migration-failure-icinga-web-v2-12-1/13092 "2024-01-04T23:38:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kalaniakahi](https://community.icinga.com/letter_avatar_proxy/v4/letter/k/a6a055/32.png) [@kalaniakahi](https://community.icinga.com/u/kalaniakahi)\
**Post date:** [January 4, 2024, 11:38pm UTC](https://community.icinga.com/t/database-schema-migration-failure-icinga-web-v2-12-1/13092/1 "2024-01-04T23:38:16Z")

</div>

After updating Icinga 2 and Icinga Web 2, my web interface shows there are 2 pending migrations: 2.12.0.sql and 2.11.0.sql.

Applying these migrations via the web interface fails.

 ![Master1 Schema Migration Failed](https://community.icinga.com/uploads/default/original/2X/4/46416a2a152cc44a9138f1c220b625fda8f92618.png)

The schema migrations also fail when I attempt to run them manually.

Running `mysql -u root -p icingaweb2 </usr/share/icingaweb2/schema/mysql-upgrades/2.11.0.sql`  
results in **ERROR 1071 (42000) at line 14: Specified key was too long; max key length is 767 bytes**

Likewise, for the other schema, running `mysql -u root -p icingaweb2 </usr/share/icingaweb2/schema/mysql-upgrades/2.12.0.sql` results in **ERROR 1146 (42S02) at line 1: Table ‘icingaweb2.icingaweb\_schema’ doesn’t exist**

Has anyone experienced a similar issue and been able to resolve it?

* * *

- Icinga Web 2 version: **2.12.1**
- Used modules and their versions (System - About): **director (master), monitoring (2.12.1)**
- Web browser used: **Chrome**
- Icinga 2 version used (`icinga2 --version`): **2.14.0**
- PHP version used (`php --version`): **7.3.33**
- Server operating system and version: **Cent OS 7**

---

<div class="post-metadata">

**Author:** ![nilmerg](https://community.icinga.com/user_avatar/community.icinga.com/nilmerg/32/277_2.png) [@nilmerg](https://community.icinga.com/u/nilmerg)\
**Post date:** [January 8, 2024, 1:46pm UTC](https://community.icinga.com/t/database-schema-migration-failure-icinga-web-v2-12-1/13092/2 "2024-01-08T13:46:14Z")

</div>

This already popped up [here](https://github.com/Icinga/icingaweb2/issues/4863).

Though, the upgrade file for 2.11 includes a fix for this in the first five lines. So, it shouldn’t happen anymore. 🙄

---

<div class="post-metadata">

**Author:** ![kalaniakahi](https://community.icinga.com/letter_avatar_proxy/v4/letter/k/a6a055/32.png) [@kalaniakahi](https://community.icinga.com/u/kalaniakahi)\
**Post date:** [January 11, 2024, 10:06pm UTC](https://community.icinga.com/t/database-schema-migration-failure-icinga-web-v2-12-1/13092/3 "2024-01-11T22:06:10Z")

</div>

Thank you! This worked perfectly!

---

<div class="post-metadata">

**Author:** ![monigacom](https://community.icinga.com/letter_avatar_proxy/v4/letter/m/bb73d2/32.png) [@monigacom](https://community.icinga.com/u/monigacom)\
**Post date:** [June 19, 2024, 12:46am UTC](https://community.icinga.com/t/database-schema-migration-failure-icinga-web-v2-12-1/13092/4 "2024-06-19T00:46:17Z")

</div>

I stumbled on this exact issue. Do I have to apply mysql.schema.sql first an then 2.11.sql, 2,12.sql?

Please advise,  
Thanks

---

<div class="post-metadata">

**Author:** ![kalaniakahi](https://community.icinga.com/letter_avatar_proxy/v4/letter/k/a6a055/32.png) [@kalaniakahi](https://community.icinga.com/u/kalaniakahi)\
**Post date:** [June 19, 2024, 1:44am UTC](https://community.icinga.com/t/database-schema-migration-failure-icinga-web-v2-12-1/13092/5 "2024-06-19T01:44:53Z")

</div>

Yes, in my experience you have to apply the schema migrations in order. So 2.11.sql followed by 2.12.sql

---

<div class="post-metadata">

**Author:** ![monigacom](https://community.icinga.com/letter_avatar_proxy/v4/letter/m/bb73d2/32.png) [@monigacom](https://community.icinga.com/u/monigacom)\
**Post date:** [June 26, 2024, 10:14pm UTC](https://community.icinga.com/t/database-schema-migration-failure-icinga-web-v2-12-1/13092/6 "2024-06-26T22:14:45Z")

</div>

FYI - I had to add these 3 lines in my.cnf and both patches were applied successfully.

```auto
innodb_file_format=barracuda
innodb_file_per_table=1
innodb_large_prefix=1

```
