[BUG] Client behält alten Namen nach Umbennung im Cache

Antworten
AlexB
Beiträge: 80
Registriert: 07 Mär 2017, 17:41

[BUG] Client behält alten Namen nach Umbennung im Cache

Beitrag von AlexB »

Hallo zusammen,

erstmal zu den Basics:
- OPSI läuft auf Alma Linux
- opsiconfd: 4.2.0.261
- opsiclientd: 4.1.1.49-1 (auch noch bei 4.2.0.17-2)
- WAN Modul aktiv

Problem:
Der Rechner wurde neu aufgesetzt. Anschließend wurden ein paar Pakete verteilt und erfolgreich installiert. Anschließend wurde der Rechner umbenannt (möglicherweise schon während der Installationen). Nun hat der Client im Config Cache noch den alten Namen und kann die Einstellungen natürlich nicht an den Config Server weitergeben da von den ACL geblockt. Zudem sind die Einstellungen auf dem Configserver schon im Client mit neuem Namen eingetragen, aber die Client kann dies von seiner Seite nicht übertragen. Warum ist der Cache dann überhaupt noch da?

Was eigentlich passieren sollte:
Wenn der Client umbenannt wird, wird der Cache auch angepasst.

Bisherige Aktionen die vorgenommen wurden:
Client neu installiert. Paket Cache gelöscht.
Cache besteht noch.

Log:

Code: Alles auswählen

[5] [2022-01-31 15:21:22.464] [config cache service                    ] Config cache service started   (CacheService.py:423)
[6] [2022-01-31 15:21:26.512] [event processing timer                  ] Trigger config sync to server   (CacheService.py:108)
[5] [2022-01-31 15:21:27.529] [config cache service                    ] Cache backend was modified, starting sync to server   (CacheService.py:460)
[6] [2022-01-31 15:21:27.547] [config cache service                    ] Starting ServiceConnectionThread, timeout is 15 seconds   (OpsiService.py:180)
[5] [2022-01-31 15:21:27.555] [service connection                      ] Connecting to config server 'https://deployment.domain.de:4447/rpc' #1   (OpsiService.py:335)
[6] [2022-01-31 15:21:27.560] [service connection                      ] Connecting to service https://deployment.domain.de:4447/rpc   (jsonrpc.py:508)
[6] [2022-01-31 15:21:27.565] [service connection                      ] JSONRPC request to https://deployment.domain.de:4447/rpc: ip_version=auto, id=1, method=backend_getInterface, Content-Type=application/json, Content-Encoding=, timeout=60   (jsonrpc.py:399)
[6] [2022-01-31 15:21:27.647] [service connection                      ] Got response status=200, Content-Type=application/json, Content-Encoding=lz4, duration=0.078s   (jsonrpc.py:411)
[6] [2022-01-31 15:21:27.754] [service connection                      ] JSONRPC request to https://deployment.domain.de:4447/rpc: ip_version=auto, id=2, method=accessControl_authenticated, Content-Type=application/msgpack, Content-Encoding=lz4, timeout=60   (jsonrpc.py:399)
[6] [2022-01-31 15:21:27.778] [service connection                      ] Got response status=200, Content-Type=application/msgpack, Content-Encoding=, duration=0.018s   (jsonrpc.py:411)
[5] [2022-01-31 15:21:27.785] [service connection                      ] Connected to config server 'https://deployment.domain.de:4447/rpc' (name=opsiconfd 4.2.0.225 (uvicorn), version=[4, 2, 0, 225])   (OpsiService.py:366)
[6] [2022-01-31 15:21:28.554] [config cache service                    ] JSONRPC request to https://deployment.domain.de:4447/rpc: ip_version=auto, id=3, method=getDepotId, Content-Type=application/msgpack, Content-Encoding=lz4, timeout=60   (jsonrpc.py:399)
[6] [2022-01-31 15:21:28.602] [config cache service                    ] Got response status=200, Content-Type=application/msgpack, Content-Encoding=, duration=0.038s   (jsonrpc.py:411)
[6] [2022-01-31 15:21:28.608] [config cache service                    ] Setting config depot_server.master_depot_id to 'deployment.domain.de'   (Config.py:444)
[6] [2022-01-31 15:21:28.612] [config cache service                    ] Updating config file: 'C:\Program Files (x86)\opsi.org\opsi-client-agent\opsiclientd\opsiclientd.conf'   (Config.py:505)
[6] [2022-01-31 15:21:28.621] [config cache service                    ] No need to write config file 'C:\Program Files (x86)\opsi.org\opsi-client-agent\opsiclientd\opsiclientd.conf', config file is up to date   (Config.py:571)
[6] [2022-01-31 15:21:28.626] [config cache service                    ] JSONRPC request to https://deployment.domain.de:4447/rpc: ip_version=auto, id=4, method=backend_getLicensingInfo, Content-Type=application/msgpack, Content-Encoding=lz4, timeout=60   (jsonrpc.py:399)
[6] [2022-01-31 15:21:28.649] [config cache service                    ] Got response status=200, Content-Type=application/msgpack, Content-Encoding=, duration=0.019s   (jsonrpc.py:411)
[6] [2022-01-31 15:21:28.655] [config cache service                    ] JSONRPC request to https://deployment.domain.de:4447/rpc: ip_version=auto, id=5, method=getDepotId, Content-Type=application/msgpack, Content-Encoding=lz4, timeout=60   (jsonrpc.py:399)
[6] [2022-01-31 15:21:28.692] [config cache service                    ] Got response status=200, Content-Type=application/msgpack, Content-Encoding=, duration=0.032s   (jsonrpc.py:411)
[6] [2022-01-31 15:21:28.698] [config cache service                    ] Setting config depot_server.master_depot_id to 'deployment.domain.de'   (Config.py:444)
[6] [2022-01-31 15:21:28.703] [config cache service                    ] Updating config file: 'C:\Program Files (x86)\opsi.org\opsi-client-agent\opsiclientd\opsiclientd.conf'   (Config.py:505)
[6] [2022-01-31 15:21:28.711] [config cache service                    ] No need to write config file 'C:\Program Files (x86)\opsi.org\opsi-client-agent\opsiclientd\opsiclientd.conf', config file is up to date   (Config.py:571)
[5] [2022-01-31 15:21:28.715] [config cache service                    ] Updating master from work backend (5 modifications)   (CacheBackend.py:190)
[6] [2022-01-31 15:21:28.720] [config cache service                    ] Getting hosts, filter: {'id': '<altername>.domain.local'}   (SQL.py:1196)
[6] [2022-01-31 15:21:28.726] [config cache service                    ] Getting productOnClients, filter: {'productId': 'opsi-client-agent', 'productType': 'LocalbootProduct', 'clientId': '<altername>.domain.local'}   (SQL.py:1770)
[6] [2022-01-31 15:21:28.733] [config cache service                    ] Getting productOnClients, filter: {'productId': 'opsi-winst', 'productType': 'LocalbootProduct', 'clientId': '<altername>.domain.local'}   (SQL.py:1770)
[6] [2022-01-31 15:21:28.739] [config cache service                    ] Getting productOnClients, filter: {'productId': 'globalvpn_410', 'productType': 'LocalbootProduct', 'clientId': '<altername>.domain.local'}   (SQL.py:1770)
[6] [2022-01-31 15:21:28.747] [config cache service                    ] Getting productOnClients, filter: {'productId': 'ocsagent', 'productType': 'LocalbootProduct', 'clientId': '<altername>.domain.local'}   (SQL.py:1770)
[6] [2022-01-31 15:21:28.754] [config cache service                    ] JSONRPC request to https://deployment.domain.de:4447/rpc: ip_version=auto, id=6, method=productOnClient_getObjects, Content-Type=application/msgpack, Content-Encoding=lz4, timeout=60   (jsonrpc.py:399)
[6] [2022-01-31 15:21:28.783] [config cache service                    ] Got response status=200, Content-Type=application/msgpack, Content-Encoding=, duration=0.025s   (jsonrpc.py:411)
[6] [2022-01-31 15:21:28.789] [config cache service                    ] Object <ProductOnClient(clientId='<altername>.domain.local', productId='opsi-client-agent', installationStatus='installed', actionRequest='none')> marked for update   (CacheBackend.py:169)
[6] [2022-01-31 15:21:28.795] [config cache service                    ] Object <ProductOnClient(clientId='<altername>.domain.local', productId='opsi-winst', installationStatus='installed', actionRequest='none')> marked for update   (CacheBackend.py:169)
[6] [2022-01-31 15:21:28.799] [config cache service                    ] Object <ProductOnClient(clientId='<altername>.domain.local', productId='globalvpn_410', installationStatus='installed', actionRequest='none')> marked for update   (CacheBackend.py:169)
[6] [2022-01-31 15:21:28.803] [config cache service                    ] Object <ProductOnClient(clientId='<altername>.domain.local', productId='ocsagent', installationStatus='not_installed', actionRequest='none')> marked for update   (CacheBackend.py:169)
[6] [2022-01-31 15:21:28.808] [config cache service                    ] JSONRPC request to https://deployment.domain.de:4447/rpc: ip_version=auto, id=7, method=productOnClient_updateObjects, Content-Type=application/msgpack, Content-Encoding=lz4, timeout=60   (jsonrpc.py:399)
[6] [2022-01-31 15:21:28.833] [config cache service                    ] Got response status=200, Content-Type=application/msgpack, Content-Encoding=, duration=0.020s   (jsonrpc.py:411)
[3] [2022-01-31 15:21:28.840] [config cache service                    ] Failed to update objects [<ProductOnClient(clientId='<altername>.domain.local', productId='opsi-client-agent', installationStatus='installed', actionRequest='none')>, <ProductOnClient(clientId='<altername>.domain.local', productId='opsi-winst', installationStatus='installed', actionRequest='none')>, <ProductOnClient(clientId='<altername>.domain.local', productId='globalvpn_410', installationStatus='installed', actionRequest='none')>, <ProductOnClient(clientId='<altername>.domain.local', productId='ocsagent', installationStatus='not_installed', actionRequest='none')>]: Opsi rpc error: Backend permission denied error: Access to method 'productOnClient_updateObjects' denied for user '<neuername>.domain.local': Backend permission denied error: Access denied (error on server)   (CacheBackend.py:185)
[3] [2022-01-31 15:21:28.845] [config cache service                    ] Opsi rpc error: Backend permission denied error: Access to method 'productOnClient_updateObjects' denied for user '<neuername>.domain.local': Backend permission denied error: Access denied (error on server)   (CacheService.py:499)
Traceback (most recent call last):
  File "opsiclientd\nonfree\CacheService.py", line 470, in _syncConfigToServer
  File "opsiclientd\nonfree\CacheBackend.py", line 273, in _updateMasterFromWorkBackend
  File "opsiclientd\nonfree\CacheBackend.py", line 183, in _syncModifiedObjectsWithMaster
  File "<string>", line 1, in productOnClient_updateObjects
  File "opsicommon\client\jsonrpc.py", line 448, in execute_rpc
opsicommon.exceptions.OpsiRpcError: Opsi rpc error: Backend permission denied error: Access to method 'productOnClient_updateObjects' denied for user '<neuername>.domain.local': Backend permission denied error: Access denied (error on server)
[3] [2022-01-31 15:21:28.857] [config cache service                    ] Errors occurred while syncing config to server: Opsi rpc error: Backend permission denied error: Access to method 'productOnClient_updateObjects' denied for user '<neuername>.domain.local': Backend permission denied error: Access denied (error on server)   (CacheService.py:509)
[6] [2022-01-31 15:21:28.869] [config cache service                    ] JSONRPC request to https://deployment.domain.de:4447/rpc: ip_version=auto, id=8, method=backend_exit, Content-Type=application/msgpack, Content-Encoding=lz4, timeout=60   (jsonrpc.py:399)
[6] [2022-01-31 15:21:28.902] [config cache service                    ] Got response status=200, Content-Type=application/msgpack, Content-Encoding=, duration=0.029s   (jsonrpc.py:411)
Benutzeravatar
wolfbardo
uib-Team
Beiträge: 1354
Registriert: 01 Jul 2008, 12:10

Re: [BUG] Client behält alten Namen nach Umbennung im Cache

Beitrag von wolfbardo »

AlexB hat geschrieben: 31 Jan 2022, 15:35 ... Anschließend wurde der Rechner umbenannt (möglicherweise schon während der Installationen).
...
Scheint mir eher auf den ersten Blick Feature und kein Bug zu sein:


Wenn ein opsi-client im Backend umbenannt wird (z.B. rechte Maustaste "Umbenennen des cliemts"im opsi-configed), dann wird er nur im opsi-Backend umbenannt.

Der Client weiss davon nichts und in der opsiclientd.conf steht der alte Name.
Wenn er sich nun mit seinem alten Namen und dem opsihostKey versucht zu anzumelden, so schlägt dies zunächst definitiv fehl.
Es gibt noch einen Fallbackversuch, indem der Client die Windows-Api befragt "Wer bin ich" und sich dann nochmal versucht sich mit diesem Namen anzumelden. Dies kann unter Umständen gelingen, falls die Windows-Api den Namen zurückgibt, wie er im opsi-Backend hinterlegt ist.


Gruss
Bardo Wolf


OPSICONF 2024
https://opsi.org/en/opsiconf/

opsi-Basisworkshops:

22. - 25. 04. 2024


opsi support - uib gmbh
For productive opsi installations we recommend maintainance + support contracts which are the base of opsi development.

http://www.uib.de
AlexB
Beiträge: 80
Registriert: 07 Mär 2017, 17:41

Re: [BUG] Client behält alten Namen nach Umbennung im Cache

Beitrag von AlexB »

Hey, danke schon mal für deine Rückmeldung.
wolfbardo hat geschrieben: 31 Jan 2022, 20:21 Der Client weiss davon nichts und in der opsiclientd.conf steht der alte Name.
Wenn er sich nun mit seinem alten Namen und dem opsihostKey versucht zu anzumelden, so schlägt dies zunächst definitiv fehl.
Es gibt noch einen Fallbackversuch, indem der Client die Windows-Api befragt "Wer bin ich" und sich dann nochmal versucht sich mit diesem Namen anzumelden. Dies kann unter Umständen gelingen, falls die Windows-Api den Namen zurückgibt, wie er im opsi-Backend hinterlegt ist.
Genau so handhaben wir das eigentlich.

Das Problem ist aber das der Fallback nicht bei dem WAN Modul des Clients greift. Der Cache wird nicht geändert. Sprich, selbst wenn der Client sich seinen Namen erfolgreich aus der Win-Api gezogen hat und sich mit dem Config Server verbunden hat, steht noch immer der alte Name im Cache. Wenn dann noch Änderungen im Cache sind, bleiben die drin und können anscheinend nicht mehr geändert werden.
Mit Cache meine ich den "config cache service".
AlexB
Beiträge: 80
Registriert: 07 Mär 2017, 17:41

Re: [BUG] Client behält alten Namen nach Umbennung im Cache

Beitrag von AlexB »

Noch als zusätzliche Information, das Problem tritt erst seit 4.2 auf. Davor hatten wir mit den Umbenennungen kein Problem.
AlexB
Beiträge: 80
Registriert: 07 Mär 2017, 17:41

Re: [BUG] Client behält alten Namen nach Umbennung im Cache

Beitrag von AlexB »

Problem besteht mit dem aktuellen OPSI Client (4.2.0.31-1) noch immer.
Gibt es schon eine Lösung dafür, außer manuell immer die ganze WAN config auf dem Client zu löschen?

Anmerkung:
Der Client ändert die clientd.conf korrekt, aber nicht die Hostid in der WAN/Cache Config DB auf dem Client.
Dort ist in der Host-Tabelle unter Hostid noch immer die alte ID eingetragen
Antworten