Uploaded image for project: 'Mender'
  1. Mender
  2. MEN-3047

mender setup triggers a segfault when ServerCertificate is not found

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: (None)
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.0, 2.2.2
    • Labels:
    • Days in progress:
      4

      Description

      It affects Yocto builds.

      Steps to reproduce:

      docker run -it --rm mendersoftware/mender-client-qemu:master
      mender setup  -> use demo settings
      systemctl restart mender
      

      Error trace:

      Jan 13 09:04:04 qemux86-64 mender[460]: time="2020-01-13T09:04:04Z" level=error msg="/usr/share/doc/mender-client/examples/demo.crt is inaccessible: open /usr/share/doc/mender-client/examples/demo.crt: no such file or directory" module=client
      Jan 13 09:04:04 qemux86-64 mender[460]: time="2020-01-13T09:04:04Z" level=warning msg="IGNORING ERROR: The client server-certificate can not be loaded error: (error creating HTTP client: cannot initialize server trust: open /usr/share/doc/mender-client/examples/demo.crt: no such file or directory). The client will continue running, but will not be able to communicate with the server. If this is not your intention please add a valid server certificate" module=commands
      Jan 13 09:04:04 qemux86-64 mender[460]: panic: runtime error: invalid memory address or nil pointer dereference
      Jan 13 09:04:04 qemux86-64 mender[460]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x7c1fb5]
      Jan 13 09:04:04 qemux86-64 mender[460]: goroutine 1 [running]:
      Jan 13 09:04:04 qemux86-64 mender[460]: github.com/mendersoftware/mender/app.(*Mender).GetCurrentState(0x0, 0xc000106150, 0x9f8f00)
      Jan 13 09:04:04 qemux86-64 mender[460]:         /builds/Northern.tech/Mender/build-qemux86-64-uefi-grub/tmp/work/core2-64-poky-linux/mender/master-git999-r0/mender-master-git999/src/github.com/mendersoftware/mender/app/mender.go:538 +0x5
      ...
      

      What is happening, is that mender setup is setting ServerCertificate path to the path used by the deb package, while Yocto build installs it in /etc/mender. (see related ticket MEN-3048 for addressing the actual demo cert install path)

      Acceptance criteria:

      • mender client gracefully handles the error.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                a10040 Kristian Amlie
                Reporter:
                lluis Lluís Campos
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel