Giter Site home page Giter Site logo

Unable to upgrade form 2.5.3 about icinga2 HOT 14 CLOSED

jjethwa avatar jjethwa commented on September 15, 2024
Unable to upgrade form 2.5.3

from icinga2.

Comments (14)

aleliga avatar aleliga commented on September 15, 2024 2

Seems to work now.
I have rebuilded the icingaweb2 directory after removing
I've copied the roles.ini and imported the old DB
This incompatibility seems to be related to the new web2 modules path (old one was /etc/icingaweb2/modules/)

my last

docker run 
-e ICINGA2_FEATURE_GRAPHITE=true
-e ICINGA2_FEATURE_GRAPHITE_HOST="graphite.somewhere"
-e ICINGA2_FEATURE_GRAPHITE_PORT=2003
-e ICINGA2_FEATURE_DIRECTOR=true
-e ICINGA_PASSWORD=pass
-e DIRECTOR_PASSWORD=pass
-e IDO_PASSWORD=pass
-e DEBIAN_SYS_MAINT_PASSWORD=pass
-e ICINGAWEB2_ADMIN_USER=icingaadmin
-e ICINGAWEB2_ADMIN_PASS=icinga
-e ICINGAWEB2_PASSWORD=pass
-t jordan/icinga2:latest

from icinga2.

bebehei avatar bebehei commented on September 15, 2024 1

in kickstart.ini the password is changed even if I set DIRECTOR_KICKSTART=false

DIRECTOR_KICKSTART is the wrong variable. ICINGA2_FEATURE_DIRECTOR would be.

Better explanation: kickstart.ini is needed in general for director to connect to database. DIRECTOR_KICKSTART only tells the container to make an initial kickstart at the beginning. Setting it to false only stops the initial kickstart.

from icinga2.

bebehei avatar bebehei commented on September 15, 2024 1

What about just emptying your current /etc/icingaweb2, and dropping the db (docker exec -ti icinga_server-new mysql 'drop database icingaweb2;')?

Then start your container with an empty icingaweb2-configuration, let it deploy the clean default and after boot up merge your manual changes back in the new /etc/icingaweb2.

What about this?

from icinga2.

bebehei avatar bebehei commented on September 15, 2024 1

You have to set ICINGA2_FEATURE_DIRECTOR=false to prevent rewriting of kickstart.ini.

from icinga2.

bebehei avatar bebehei commented on September 15, 2024

look at the readme. We added new variables for the user-interface to set username/password of the default user, etc... Those willl always be respected and therefore they may overwrite previously defined values.

from icinga2.

aleliga avatar aleliga commented on September 15, 2024

OK, TY
I have configured the run file with the variables, icinga2 seems to run fine.
icingaweb2 isnt able to login with icingaadmin:admin or with my previous configured clients.
the /etc/icingaweb2 volume is rewrited every time
I can login in mysql with icingaweb user and I see the imported users and group but no authentication
some time i got this error (seems to be that it try to overwrite):
ERROR 1050 (42S01) at line 3: Table 'icingaweb_group' already exists

my run:

docker run -h master \
-p 80:80 -p 443:443 -p 5665:5665 \
--name icinga_server-new \
-v $SRV/etc/icinga2/:/etc/icinga2 \
-v $SRV/etc/icinga-web/:/etc/icinga-web \
-v $SRV/etc/icingaweb2:/etc/icingaweb2 \
-v $SRV/var/log:/var/log \
-v $SRV/etc/icinga2-classicui/:/etc/icinga2-classicui/ \
-v $SRV/var/lib/icinga2:/var/lib/icinga2 \
-v $SRV/etc/ssmtp:/etc/ssmtp \
--link graphite:graphite \
-e TZ=Europe/Rome \
-e ICINGA2_FEATURE_GRAPHITE=true \
-e ICINGA2_FEATURE_GRAPHITE_HOST="graphite" \
-e ICINGA2_FEATURE_GRAPHITE_PORT=2003 \
-e ICINGA_PASSWORD=pass \
-e ICINGAWEB2_PASSWORD=pass \
-e DIRECTOR_PASSWORD=pass \
-e IDO_PASSWORD=pass \
-e DEBIAN_SYS_MAINT_PASSWORD=pass \
-e ICINGAWEB2_ADMIN_USER=adminicinga \
-e ICINGAWEB2_ADMIN_PASS=pass \
-t jordan/icinga2:latest

from icinga2.

jjethwa avatar jjethwa commented on September 15, 2024

Hi @aleliga

That's strange. The icingaweb2 volume should not get overwritten as long as there is at least one file in it.

Are you able to log in using the default icingaadmin:icinga credentials to /icingaweb2 ?

from icinga2.

aleliga avatar aleliga commented on September 15, 2024

Hi @jjethwa
no I can't login with any credential, I've tried to set the ADMIN_USER, but without any result.
In the db there are my users (imported from dump) but no ADMIN_USER
when I try to login I got this error
ERROR 1050 (42S01) at line 3: Table 'icingaweb_group' already exists
If I restore old /icingaweb2 (pre upgrade) I've got the "no auth method" message, in the login interface

from icinga2.

bebehei avatar bebehei commented on September 15, 2024

@jjethwa I feel we have hit a bug. But I'm not able to reproduce yet.

That's strange. The icingaweb2 volume should not get overwritten as long as there is at least one file in it.

The configuration done via ENV still will be overwritten. But only the single options and not the full file.

@aleliga Could you please show

  • /etc/icingaweb2/resources.ini
  • /etc/icingaweb2/authentication.ini
  • the output of docker exec -ti icinga_server-new mysql icingaweb2 -e 'select * from icingaweb_user;'

from icinga2.

aleliga avatar aleliga commented on September 15, 2024

Resources.ini is similar, no "" in the password but seems to work

/etc/icingaweb2/resources.ini

[icingaweb_db]
type = "db"
db = "mysql"
host = "localhost"
port = "3306"
dbname = "icingaweb2"
username = "icingaweb2"
password = pass
prefix = "icingaweb_"
charset = 
persistent = "0"

[icinga_ido]
type = "db"
db = "mysql"
host = "localhost"
port = "3306"
dbname = "icinga2idomysql"
username = "icinga2-ido-mysq"
password = pass
charset = 
persistent = "0"

[director]
type = "db"
db = "mysql"
host = "localhost"
port = "3306"
dbname = "director"
username = "director"
password = pass
charset = "utf8"
persistent = "0"

/etc/icingaweb2/authentication.ini

[icingaweb2]
backend             = "db"
resource            = "icingaweb_db"

mysql icingaweb2 -e 'select * from icingaweb_user;'

| olduser1            |      1 | password | 2016-05-13 15:34:28 | NULL                |
| olduser1            |      1 | password | 2016-05-13 15:34:28 | NULL                |
| API            |      1 | password | 2016-05-13 15:34:28 | NULL                |
| icingaadmin      |      0 | password | NULL                | 2016-05-24 14:00:24 |

from icinga2.

bebehei avatar bebehei commented on September 15, 2024

Having:

| olduser1            |      1 | password | 2016-05-13 15:34:28 | NULL                |
| olduser1            |      1 | password | 2016-05-13 15:34:28 | NULL                |
| API            |      1 | password | 2016-05-13 15:34:28 | NULL                |
| icingaadmin      |      0 | password | NULL                | 2016-05-24 14:00:24 |

vs

-e ICINGAWEB2_ADMIN_USER=adminicinga \

(Edit) It should be obvious, that your configured user does not match the icingaweb2.icingaweb_user-table.

Could you also provide full logs of the startup of your container?

from icinga2.

aleliga avatar aleliga commented on September 15, 2024

You are right, I've changed user in this container
I've rechanged the default pass to icinga, rebuild with default credentials "icingaadmin:icinga" and imported DB with no results.

Copying icingaweb2/modules/director/kickstart.ini and icingaweb2/resources.ini the container seems to work good, but web2 have the same problem at restart (file are rewrited)

I see these differences in the files:
in kickstart.ini the password is changed even if I set DIRECTOR_KICKSTART=false
in resources.ini passwords doesn't have double quotes "

from icinga2.

bebehei avatar bebehei commented on September 15, 2024

You are right, I've changed user in this container

This is valid, supported and perfectly fine. The bogus thing: the user specified in docker run-statement does not match the DB.

in kickstart.ini the password is changed even if I set DIRECTOR_KICKSTART=false

DIRECTOR_KICKSTART is the wrong variable. ICINGA2_FEATURE_DIRECTOR would be.

in resources.ini passwords doesn't have double quotes "

AFAIK, quotes are not needed in ini-format.

Copying icingaweb2/modules/director/kickstart.ini and icingaweb2/resources.ini the container seems to work good, but web2 have the same problem at restart (file are rewrited)

the files are rewritten, but the diff is only the new password. The container generates on every reboot a new password for its DB connections.

from icinga2.

aleliga avatar aleliga commented on September 15, 2024

I have make some other try
ICINGA2_FEATURE_DIRECTOR=true
DIRECTOR_KICKSTART=false
director/kickstart.ini is rewrited every time, with a new passwords
In icingaweb2/resources.ini
charset =
break icingaweb2 (in original conf charset="" work), this must to be a problem in the charset = NULL definition
charset = "utf8" or charset = utf8 are OK

from icinga2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.