Solved: Probleme nach Upgrade des opsi-Servers auf Ubuntu 22.04

NorbertKoch
Beiträge: 133
Registriert: 26 Aug 2021, 08:37

Re: Probleme nach Upgrade des opsi-Servers auf Ubuntu 22.04

Beitrag von NorbertKoch »

Hallo Thoams,

die letzten Zeilen finde ich wenig aussagekräftig:
[1] [2023-06-09 08:57:13.108] [ ] Opsiconfd version 4.2.0.310 starting (main.py:117)
[1] [2023-06-09 08:57:13.109] [ ] Switching to user opsiconfd (main.py:120)
[1] [2023-06-09 08:57:57.768] [ ] Opsiconfd version 4.2.0.310 starting (main.py:117)
[1] [2023-06-09 08:57:57.769] [ ] Switching to user opsiconfd (main.py:120)
[1] [2023-06-13 14:45:02.137] [ ] Opsiconfd version 4.2.0.310 starting (main.py:117)
[1] [2023-06-13 14:45:02.138] [ ] Switching to user opsiconfd (main.py:120)
[1] [2023-06-15 15:43:47.772] [ ] Opsiconfd version 4.2.0.310 starting (main.py:117)
[1] [2023-06-15 15:43:47.773] [ ] Switching to user opsiconfd (main.py:120)
[1] [2023-06-16 08:03:58.066] [ ] Opsiconfd version 4.2.0.310 starting (main.py:117)
[1] [2023-06-16 08:03:58.067] [ ] Switching to user opsiconfd (main.py:120
Liebe Grüße

Norbert
SirTux
Beiträge: 571
Registriert: 05 Feb 2011, 18:37

Re: Probleme nach Upgrade des opsi-Servers auf Ubuntu 22.04

Beitrag von SirTux »

Ich würde mal prüfen, daß redis auch läuft:
viewtopic.php?p=57838#p57838
NorbertKoch
Beiträge: 133
Registriert: 26 Aug 2021, 08:37

Re: Probleme nach Upgrade des opsi-Servers auf Ubuntu 22.04

Beitrag von NorbertKoch »

Hallo SirTux,

redis scheint zu laufen:
ii redis-server 5:6.0.16-1ubuntu1 amd64 Persistent key-value database with network interface
ii redis-timeseries 1.6.16.1-1 amd64 RedisTimeSeries is a Redis Module adding a Time Series data structure to Redis.
ii redis-tools 5:6.0.16-1ubuntu1 amd64 Persistent key-value database with network interface (client)
bzw.:
root 14630 1710 0 10:45 pts/0 00:00:00 grep --color=auto redis
Liebe Grüße

Norbert
thomas.besser
Beiträge: 462
Registriert: 09 Sep 2009, 09:40

Re: Probleme nach Upgrade des opsi-Servers auf Ubuntu 22.04

Beitrag von thomas.besser »

NorbertKoch hat geschrieben: 16 Jun 2023, 10:41 die letzten Zeilen finde ich wenig aussagekräftig:
Stimmt. Das dürfte am Log-Level 0 liegen, der standardmäßig ja auch ok ist.

In '/etc/opsi/opsiconfd.conf' könnte ein auskommentierter Eintrag stehen...

Code: Alles auswählen

#log-level-file = 5
Einfach mal das # löschen und den opsiconfd versuchen zu starten, jetzt sollte im Log mehr zu lesen sein.
thomas.besser
Beiträge: 462
Registriert: 09 Sep 2009, 09:40

Re: Probleme nach Upgrade des opsi-Servers auf Ubuntu 22.04

Beitrag von thomas.besser »

NorbertKoch hat geschrieben: 16 Jun 2023, 10:44
root 14630 1710 0 10:45 pts/0 00:00:00 grep --color=auto redis
Nein, redis läuft offensichtlich nicht!

Nochmal: bei einem 'ps' findet sich der Aufruf in der Shell immer auch sich selbst! Genau das sagt deine gepostete Ausgabe.
NorbertKoch
Beiträge: 133
Registriert: 26 Aug 2021, 08:37

Re: Probleme nach Upgrade des opsi-Servers auf Ubuntu 22.04

Beitrag von NorbertKoch »

Hallo Thomas,

ok. Das scheint das Problem zu sein: redis startet nicht.

Beim Starten des Dienstes bekomme ich:
Jun 16 11:03:34 opsi.intern.zz systemd[1]: Failed to start Advanced key-value store.
Liebe Grüße

Norbert
thomas.besser
Beiträge: 462
Registriert: 09 Sep 2009, 09:40

Re: Probleme nach Upgrade des opsi-Servers auf Ubuntu 22.04

Beitrag von thomas.besser »

Ok, dann folge doch dem genannten Link von SirTux.

Dort gibt es ja ganz konkrete Hilfestellungen...
Benutzeravatar
j.schneider
uib-Team
Beiträge: 1828
Registriert: 29 Mai 2008, 15:14

Re: Probleme nach Upgrade des opsi-Servers auf Ubuntu 22.04

Beitrag von j.schneider »

Bitte einmal folgenden Befehl ausführen:

Code: Alles auswählen

opsiconfd -l6 setup
Sind da Fehler zu sehen?

Der opsiconfd kann zu Testzwecken auch einfach direkt gestartet werden:

Code: Alles auswählen

opsiconfd -l6
NorbertKoch
Beiträge: 133
Registriert: 26 Aug 2021, 08:37

Re: Probleme nach Upgrade des opsi-Servers auf Ubuntu 22.04

Beitrag von NorbertKoch »

Hallo Herr Schneider,

ja, einige:
[6] [2023-06-16 12:01:00.131] [ ] opsiconfd config:
{ 'acl_file': '/etc/opsi/backendManager/acl.conf',
'action': 'setup',
'addon_dirs': ['/usr/lib/opsiconfd/addons', '/var/lib/opsiconfd/addons'],
'admin_interface_disabled_features': [],
'admin_interface_terminal_shell': '/bin/bash',
'admin_networks': ['192.168.0.0/16'],
'allow_host_key_only_auth': False,
'auth_failures_interval': 120,
'backend_config_dir': '/etc/opsi/backends',
'client_block_time': 120,
'config_file': '/etc/opsi/opsiconfd.conf',
'debug': False,
'debug_options': None,
'dispatch_config_file': '/etc/opsi/backendManager/dispatch.conf',
'ex_help': False,
'executor_workers': 10,
'extension_config_dir': '/etc/opsi/backendManager/extend.d',
'external_url': 'https://opsi.intern.zz:4447',
'grafana_data_source_url': 'https://opsi.intern.zz:4447',
'grafana_external_url': 'http://opsi.intern.zz:3000',
'grafana_internal_url': 'http://opsiconfd:***secret***@localhost:3000',
'grafana_verify_cert': True,
'interface': '0.0.0.0',
'internal_url': 'https://opsi.intern.zz:4447',
'jsonrpc_time_to_cache': 0.5,
'keep_rotated_logs': 1,
'log_file': '/var/log/opsi/opsiconfd/%m.log',
'log_filter': None,
'log_format_file': '[%(opsilevel)d] [%(asctime)s.%(msecs)03d] [%(contextstring)-15s] '
'%(message)s (%(filename)s:%(lineno)d)',
'log_format_stderr': '%(log_color)s[%(opsilevel)d] [%(asctime)s.%(msecs)03d]%(reset)s '
'[%(contextstring)-15s] %(message)s (%(filename)s:%(lineno)d)',
'log_level': 5,
'log_level_file': 4,
'log_level_stderr': 6,
'log_levels': '',
'log_max_msg_len': 5000,
'log_mode': 'redis',
'log_slow_async_callbacks': 0.0,
'max_auth_failures': 10,
'max_log_size': 5.0,
'max_session_per_ip': 30,
'max_sessions_excludes': ['127.0.0.1', '::1'],
'monitoring_user': 'monitoring',
'networks': ['0.0.0.0/0', '::/0'],
'node_name': 'opsi.intern.zz',
'port': 4447,
'profiler': False,
'redis_internal_url': 'redis://localhost',
'restart_worker_mem': 0,
'run_as_user': 'opsiconfd',
'session_lifetime': 60,
'setup': False,
'skip_setup': [],
'ssl_ca_cert': '/etc/opsi/ssl/opsi-ca-cert.pem',
'ssl_ca_cert_renew_days': 300,
'ssl_ca_cert_valid_days': 360,
'ssl_ca_key': '/etc/opsi/ssl/opsi-ca-key.pem',
'ssl_ca_key_passphrase': '***secret***',
'ssl_ca_subject_cn': 'opsi CA',
'ssl_ciphers': 'TLSv1.2',
'ssl_client_cert_valid_days': 360,
'ssl_server_cert': '/etc/opsi/ssl/opsiconfd-cert.pem',
'ssl_server_cert_check_interval': 86400,
'ssl_server_cert_renew_days': 30,
'ssl_server_cert_valid_days': 90,
'ssl_server_key': '/etc/opsi/ssl/opsiconfd-key.pem',
'ssl_server_key_passphrase': '***secret***',
'ssl_trusted_certs': '/usr/lib/opsiconfd/certifi/cacert.pem',
'static_dir': '/usr/share/opsiconfd/static',
'symlink_logs': True,
'trusted_proxies': ['127.0.0.1', '::1'],
'update_ip': True,
'version': False,
'welcome_page': True,
'worker_stop_timeout': 120,
'workers': 1,
'zeroconf': True} (main.py:60)
[5] [2023-06-16 12:01:00.131] [ ] Running opsiconfd setup (setup.py:212)
[6] [2023-06-16 12:01:00.131] [ ] Setup system limits (setup.py:51)
[6] [2023-06-16 12:01:00.131] [ ] Maximum number of open file descriptors: 10000 (setup.py:64)
[6] [2023-06-16 12:01:00.132] [ ] Setup backend (setup.py:165)
[6] [2023-06-16 12:01:00.132] [ ] * BackendManager is creating BackendDispatcher (_Manager.py:169)
[6] [2023-06-16 12:01:00.132] [ ] Backend context was set to <BackendManager()> (Backend.py:201)
[6] [2023-06-16 12:01:00.132] [ ] Loading dispatch config file '/etc/opsi/backendManager/dispatch.conf' (Dispatcher.py:71)
[6] [2023-06-16 12:01:00.132] [ ] Loading backend config '/etc/opsi/backends/file.conf' (Dispatcher.py:129)
[6] [2023-06-16 12:01:00.134] [ ] Backend context was set to <BackendManager()> (Backend.py:201)
[6] [2023-06-16 12:01:00.134] [ ] Loading backend config '/etc/opsi/backends/opsipxeconfd.conf' (Dispatcher.py:129)
[6] [2023-06-16 12:01:00.135] [ ] Backend context was set to <BackendManager()> (Backend.py:201)
[6] [2023-06-16 12:01:00.136] [ ] Loading backend config '/etc/opsi/backends/mysql.conf' (Dispatcher.py:129)
[6] [2023-06-16 12:01:00.136] [ ] Backend context was set to <BackendManager()> (Backend.py:201)
[6] [2023-06-16 12:01:00.144] [ ] Connecting to mysql://opsi:opsi@127.0.0.1/opsi?charset=utf8mb4 (MySQL.py:140)
[4] [2023-06-16 12:01:00.160] [ ] Failed to setup backend: (MySQLdb.OperationalError) (1045, "Access denied for user 'opsi'@'localhost' (using password: YES)")
(Background on this error at: https://sqlalche.me/e/14/e3q8) (setup.py:231)
[6] [2023-06-16 12:01:00.160] [ ] Setup users and groups (setup.py:77)
[6] [2023-06-16 12:01:00.160] [ ] Setup users and groups (setup.py:68)
[6] [2023-06-16 12:01:00.162] [ ] Setup systemd (setup.py:159)
[6] [2023-06-16 12:01:00.910] [ ] Setup file permissions (setup.py:110)
[6] [2023-06-16 12:01:00.911] [ ] * BackendManager is creating BackendDispatcher (_Manager.py:169)
[6] [2023-06-16 12:01:00.911] [ ] Backend context was set to <BackendManager()> (Backend.py:201)
[6] [2023-06-16 12:01:00.912] [ ] Loading dispatch config file '/etc/opsi/backendManager/dispatch.conf' (Dispatcher.py:71)
[6] [2023-06-16 12:01:00.912] [ ] Loading backend config '/etc/opsi/backends/file.conf' (Dispatcher.py:129)
[6] [2023-06-16 12:01:00.913] [ ] Backend context was set to <BackendManager()> (Backend.py:201)
[6] [2023-06-16 12:01:00.914] [ ] Loading backend config '/etc/opsi/backends/opsipxeconfd.conf' (Dispatcher.py:129)
[6] [2023-06-16 12:01:00.914] [ ] Backend context was set to <BackendManager()> (Backend.py:201)
[6] [2023-06-16 12:01:00.915] [ ] Loading backend config '/etc/opsi/backends/mysql.conf' (Dispatcher.py:129)
[6] [2023-06-16 12:01:00.916] [ ] Backend context was set to <BackendManager()> (Backend.py:201)
[6] [2023-06-16 12:01:00.928] [ ] Connecting to mysql://opsi:opsi@127.0.0.1/opsi?charset=utf8mb4 (MySQL.py:140)
[4] [2023-06-16 12:01:00.929] [ ] Failed to get directories from depot: (MySQLdb.OperationalError) (1045, "Access denied for user 'opsi'@'localhost' (using password: YES)")
(Background on this error at: https://sqlalche.me/e/14/e3q8) (Rights.py:306)
[5] [2023-06-16 12:01:00.930] [ ] Setting rights on '/etc/shadow' (Rights.py:236)
[5] [2023-06-16 12:01:00.931] [ ] Setting rights on '/var/log/opsi/opsiconfd/opsiconfd.log' (Rights.py:236)
[5] [2023-06-16 12:01:00.932] [ ] Setting rights recursively on '/var/lib/opsiconfd/addons' (Rights.py:236)
[5] [2023-06-16 12:01:00.932] [ ] Setting rights recursively on '/etc/opsi' (Rights.py:236)
[5] [2023-06-16 12:01:00.933] [ ] Setting rights recursively on '/etc/opsi/ssl' (Rights.py:236)
[5] [2023-06-16 12:01:00.933] [ ] Setting rights on '/etc/opsi/ssl/opsi-ca-cert.pem' (Rights.py:236)
[5] [2023-06-16 12:01:00.934] [ ] Setting rights on '/etc/opsi/ssl/opsi-ca-cert.pem' (Rights.py:236)
[5] [2023-06-16 12:01:00.934] [ ] Setting rights on '/etc/opsi/ssl/opsi-ca-key.pem' (Rights.py:236)
[5] [2023-06-16 12:01:00.935] [ ] Setting rights on '/etc/opsi/ssl/opsiconfd-cert.pem' (Rights.py:236)
[5] [2023-06-16 12:01:00.935] [ ] Setting rights on '/etc/opsi/ssl/opsiconfd-key.pem' (Rights.py:236)
[6] [2023-06-16 12:01:00.936] [ ] Cleanup log files (setup.py:184)
[6] [2023-06-16 12:01:00.937] [ ] Setup grafana (grafana.py:116)
[4] [2023-06-16 12:01:02.962] [ ] Failed to setup redis downsampling: Error 111 connecting to localhost:6379. Connection refused. (setup.py:259)
Traceback (most recent call last):
File "redis/connection.py", line 699, in connect
File "redis/retry.py", line 46, in call_with_retry
File "redis/connection.py", line 700, in <lambda>
File "redis/connection.py", line 1002, in _connect
File "redis/connection.py", line 990, in _connect
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "opsiconfd/setup.py", line 257, in setup
File "opsiconfd/statistics.py", line 258, in setup_metric_downsampling
File "redis/client.py", line 1266, in execute_command
File "redis/connection.py", line 1457, in get_connection
File "redis/connection.py", line 705, in connect
redis.exceptions.ConnectionError: Error 111 connecting to localhost:6379. Connection refused.
[6] [2023-06-16 12:01:02.964] [ ] Setup ssl (ssl.py:480)
[6] [2023-06-16 12:01:02.964] [ ] Checking CA (ssl.py:231)
[6] [2023-06-16 12:01:02.972] [ ] CA 'opsi CA' will expire in 352 days (ssl.py:247)
[6] [2023-06-16 12:01:02.973] [ ] CA is up to date (ssl.py:282)
[6] [2023-06-16 12:01:02.973] [ ] Checking server cert (ssl.py:343)
[6] [2023-06-16 12:01:03.004] [ ] Server cert 'opsi.intern.zz' will expire in 82 days (ssl.py:412)
[6] [2023-06-16 12:01:03.005] [ ] Server cert is up to date (ssl.py:475)
Liebe Grüße

Norbert
Benutzeravatar
j.schneider
uib-Team
Beiträge: 1828
Registriert: 29 Mai 2008, 15:14

Re: Probleme nach Upgrade des opsi-Servers auf Ubuntu 22.04

Beitrag von j.schneider »

Code: Alles auswählen

apt reinstall redis-timeseries
systemctl restart redis
Dann sollte redis wieder laufen.
Danach MySQL-Backend neu einrichten:

Code: Alles auswählen

opsi-setup --configure-mysql
Dann wieder

Code: Alles auswählen

opsiconfd -l6 setup
Antworten