Comment 6 for bug 1868730

Revision history for this message
Juanmi Taboada (juanmitaboada) wrote (last edit ):

Hello, after a fresh install, the folder /var/lib/landscape/client/ doesn't contain the usual folders. Bootstrap didn't happen yet. In effect, the folder sockets don't exist, which provokes the broker to fail during startup.

$ sudo -u landscape /usr/bin/python3 /usr/bin/landscape-broker
2023-03-06 05:23:38,705 INFO [MainThread] Broker started with config /etc/landscape/client.conf
Traceback (most recent call last):
  File "/usr/bin/landscape-broker", line 8, in <module>
    run(sys.argv)
  File "/usr/lib/python3/dist-packages/landscape/client/broker/service.py", line 94, in run
    run_landscape_service(BrokerConfiguration, BrokerService, args)
  File "/usr/lib/python3/dist-packages/landscape/client/service.py", line 115, in run_landscape_service
    startApplication(application, False)
  File "/usr/lib/python3/dist-packages/twisted/application/app.py", line 689, in startApplication
    service.IService(application).startService()
  File "/usr/lib/python3/dist-packages/twisted/application/service.py", line 276, in startService
    service.startService()
  File "/usr/lib/python3/dist-packages/landscape/client/broker/service.py", line 79, in startService
    self.publisher.start()
  File "/usr/lib/python3/dist-packages/landscape/client/amp.py", line 45, in start
    self._port = self._reactor.listen_unix(socket_path, factory)
  File "/usr/lib/python3/dist-packages/landscape/lib/reactor.py", line 228, in listen_unix
    return self._reactor.listenUNIX(socket, factory, wantPID=True)
  File "/usr/lib/python3/dist-packages/twisted/internet/posixbase.py", line 466, in listenUNIX
    p.startListening()
  File "/usr/lib/python3/dist-packages/twisted/internet/unix.py", line 388, in startListening
    if not self.lockFile.lock():
  File "/usr/lib/python3/dist-packages/landscape/client/lockfile.py", line 42, in lock
    result = super(PatchedFilesystemLock, self).lock()
  File "/usr/lib/python3/dist-packages/twisted/python/lockfile.py", line 157, in lock
    symlink(str(os.getpid()), self.name)
FileNotFoundError: [Errno 2] No such file or directory: '9872' -> b'/var/lib/landscape/client/sockets/broker.sock.lock'

Executing:
$ sudo /usr/bin/python3 /usr/bin/landscape-client

landscape-client will execute the bootstrap (then the sockets folder should be created) and the broker would work then.

I have published a possible solution for this situation, which enables the broker to bootstrap the landscape-client folder:
https://github.com/CanonicalLtd/landscape-client/pull/140