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

Bad state script error handling

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: 2.2.0
    • Fix Version/s: None
    • Labels:
    • Days in progress:
      0

      Description

      When doing a update and some state script fails, the client may crash :

      hostname:~# mender -install <artifact-url.mender>
      INFO[0000] Loaded configuration file: /etc/mender/mender.conf 
      WARN[0000] Could not resolve path link: ubi0_0 Attempting to continue 
      WARN[0000] Could not resolve path link: ubi0_1 Attempting to continue 
      INFO[0000] Mender running on partition: ubi0_0          
      INFO[0000] Performing remote update from: [<artifact-url.mender>]. 
      Installing Artifact of size 67700224...
      INFO[0002] No public key was provided for authenticating the artifact 
      INFO[0002] Update Module path "/usr/share/mender/modules/v3" could not be opened (open /usr/share/mender/modules/v3: no such file or directory). Update modules will not be available 
      WARN[0002] Installer: Installing signed artifact without verification as verification key is missing 
      .ERRO[0005] Reading headers failed: installer: failed to read Artifact: readHeaderV3: handleHeaderReads: statescript: can not write script file: /var/lib/mender/scripts/ArtifactInstall_Enter_00_Install-version-compare: write /var/lib/mender/scripts/ArtifactInstall_Enter_00_Install-version-compare: no space left on device 
      fatal error: unexpected signal during runtime execution
      [signal SIGBUS: bus error code=0x2 addr=0xb6f9a040 pc=0xb6f1b31c]runtime stack:
      runtime.throw(0x3d6cf4, 0x2a)
              /usr/lib/go/src/runtime/panic.go:774 +0x5c
      runtime.sigpanic()
              /usr/lib/go/src/runtime/signal_unix.go:378 +0x398goroutine 1 [syscall, locked to thread]:
      runtime.cgocall(0x31c9bc, 0x8cd76c, 0xc54068)
              /usr/lib/go/src/runtime/cgocall.go:128 +0x5c fp=0x8cd754 sp=0x8cd73c pc=0x16588
      github.com/mendersoftware/mender/vendor/github.com/bmatsuo/lmdb-go/lmdb._Cfunc_mdb_txn_begin(0xa5a00700, 0x0, 0x0, 0xc54068, 0x0)
              _cgo_gotypes.go:872 +0x38 fp=0x8cd768 sp=0x8cd754 pc=0x2774e8
      github.com/mendersoftware/mender/vendor/github.com/bmatsuo/lmdb-go/lmdb.beginTxn.func1(0x811020, 0x0, 0x0, 0xc54060, 0x4be1c)
              src/github.com/mendersoftware/mender/vendor/github.com/bmatsuo/lmdb-go/lmdb/txn.go:73 +0xfc fp=0x8cd788 sp=0x8cd768 pc=0x2796d4
      github.com/mendersoftware/mender/vendor/github.com/bmatsuo/lmdb-go/lmdb.beginTxn(0x811020, 0x0, 0x0, 0xbf00a0, 0x8, 0x8)
              src/github.com/mendersoftware/mender/vendor/github.com/bmatsuo/lmdb-go/lmdb/txn.go:73 +0xa8 fp=0x8cd7ac sp=0x8cd788 pc=0x2781c8
      github.com/mendersoftware/mender/vendor/github.com/bmatsuo/lmdb-go/lmdb.(*Env).run(0x811020, 0x1, 0x0, 0x8cd828, 0x0, 0x0)
              src/github.com/mendersoftware/mender/vendor/github.com/bmatsuo/lmdb-go/lmdb/env.go:455 +0x48 fp=0x8cd80c sp=0x8cd7ac pc=0x277ce8
      github.com/mendersoftware/mender/vendor/github.com/bmatsuo/lmdb-go/lmdb.(*Env).Update(...)
              src/github.com/mendersoftware/mender/vendor/github.com/bmatsuo/lmdb-go/lmdb/env.go:437
      github.com/mendersoftware/mender/store.(*DBStore).WriteTransaction(0x811038, 0xbf00a0, 0x13, 0x8f6aa8)
              src/github.com/mendersoftware/mender/store/dbstore.go:151 +0x58 fp=0x8cd830 sp=0x8cd80c pc=0x299430
      github.com/mendersoftware/mender/app.doStandaloneCleanup(0x908000, 0xc54020, 0x454a10, 0x8567b0, 0x3be5e8, 0x8563f0)
              src/github.com/mendersoftware/mender/app/standalone.go:602 +0x188 fp=0x8cd870 sp=0x8cd830 pc=0x2e57f8
      github.com/mendersoftware/mender/app.doStandaloneFailureStates(0x908000, 0xc54020, 0x454a10, 0x8567b0, 0x10000, 0x1, 0x0)
              src/github.com/mendersoftware/mender/app/standalone.go:578 +0xd8 fp=0x8cd89c sp=0x8cd870 pc=0x2e54fc
      github.com/mendersoftware/mender/app.doStandaloneInstallStatesDownload(0x454a58, 0xbf1248, 0x0, 0x0, 0x0, 0x908000, 0x454a10, 0x8567b0, 0x38daa0, 0x10, ...)
              src/github.com/mendersoftware/mender/app/standalone.go:196 +0x7b4 fp=0x8cd948 sp=0x8cd89c pc=0x2e30ac
      github.com/mendersoftware/mender/app.doStandaloneInstallStates(0x454a58, 0xbf1248, 0x0, 0x0, 0x0, 0x908000, 0x454a10, 0x8567b0, 0x0, 0x0)
              src/github.com/mendersoftware/mender/app/standalone.go:312 +0x58 fp=0x8cd9dc sp=0x8cd948 pc=0x2e39cc
      github.com/mendersoftware/mender/app.DoStandaloneInstall(0x908000, 0xbeb37e52, 0x63, 0x0, 0x0, 0x900000, 0x0, 0x0, 0x0, 0x454a10, ...)
              src/github.com/mendersoftware/mender/app/standalone.go:168 +0x570 fp=0x8cdadc sp=0x8cd9dc pc=0x2e2644
      github.com/mendersoftware/mender/cli.handleArtifactOperations(0x80d600, 0x820260, 0x17, 0x820280, 0x1b, 0x3c83ac, 0xf, 0xbeb37e52, 0x63, 0x0, ...)
              src/github.com/mendersoftware/mender/cli/commands.go:167 +0x2fc fp=0x8cdbbc sp=0x8cdadc pc=0x3133d0
      github.com/mendersoftware/mender/cli.(*runOptionsType).handleCLIOptions(0x88e140, 0x80d600, 0x0, 0x0)
              src/github.com/mendersoftware/mender/cli/cli.go:454 +0x184 fp=0x8cdd70 sp=0x8cdbbc pc=0x311438
      github.com/mendersoftware/mender/cli.SetupCLI.func2(0x80d600, 0x1, 0x1)
              src/github.com/mendersoftware/mender/cli/cli.go:174 +0xa4 fp=0x8cdd88 sp=0x8cdd70 pc=0x319d3c
      github.com/mendersoftware/mender/vendor/github.com/urfave/cli.(*Command).Run(0x868990, 0x80d560, 0x0, 0x0)
              src/github.com/mendersoftware/mender/vendor/github.com/urfave/cli/command.go:161 +0x3c0 fp=0x8cde10 sp=0x8cdd88 pc=0x300ae0
      github.com/mendersoftware/mender/vendor/github.com/urfave/cli.(*App).RunContext(0x88c750, 0x455890, 0x81c078, 0x80c0a0, 0x3, 0x4, 0x0, 0x0)
              src/github.com/mendersoftware/mender/vendor/github.com/urfave/cli/app.go:302 +0x5c0 fp=0x8cdeb8 sp=0x8cde10 pc=0x2fea00
      github.com/mendersoftware/mender/vendor/github.com/urfave/cli.(*App).Run(...)
              src/github.com/mendersoftware/mender/vendor/github.com/urfave/cli/app.go:211
      github.com/mendersoftware/mender/cli.SetupCLI(0x80c0a0, 0x3, 0x4, 0x81a0b0, 0x0)
              src/github.com/mendersoftware/mender/cli/cli.go:397 +0x2250 fp=0x8cdf6c sp=0x8cdeb8 pc=0x30fc10
      main.doMain(0x8000e0)
              src/github.com/mendersoftware/mender/main.go:26 +0x38 fp=0x8cdf9c sp=0x8cdf6c pc=0x31bc34
      main.main()
              src/github.com/mendersoftware/mender/main.go:39 +0x14 fp=0x8cdfa4 sp=0x8cdf9c pc=0x31bdc0
      runtime.main()
              /usr/lib/go/src/runtime/proc.go:203 +0x208 fp=0x8cdfe4 sp=0x8cdfa4 pc=0x43af0
      runtime.goexit()
              /usr/lib/go/src/runtime/asm_arm.s:868 +0x4 fp=0x8cdfe4 sp=0x8cdfe4 pc=0x6e50cgoroutine 6 [syscall]:
      os/signal.signal_recv(0x0)
              /usr/lib/go/src/runtime/sigqueue.go:147 +0x130
      os/signal.loop()
              /usr/lib/go/src/os/signal/signal_unix.go:23 +0x14
      created by os/signal.init.0
              /usr/lib/go/src/os/signal/signal_unix.go:29 +0x30goroutine 10 [select]:
      net/http.setRequestCancel.func3(0x0, 0x80de80, 0x856840, 0x8f6ac8, 0x81a6c0)
              /usr/lib/go/src/net/http/client.go:321 +0x78
      created by net/http.setRequestCancel
              /usr/lib/go/src/net/http/client.go:320 +0x20cgoroutine 18 [select]:
      net/http.(*persistConn).readLoop(0x88e280)
              /usr/lib/go/src/net/http/transport.go:2021 +0x780
      created by net/http.(*Transport).dialConn
              /usr/lib/go/src/net/http/transport.go:1569 +0x8e8goroutine 19 [select]:
      net/http.(*persistConn).writeLoop(0x88e280)
              /usr/lib/go/src/net/http/transport.go:2199 +0xc0
      created by net/http.(*Transport).dialConn
              /usr/lib/go/src/net/http/transport.go:1570 +0x904

      Note : the lines may not match in standalone.go as this is a version with some added code. That said the added code is not used by the action performed.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              christian Christian Müller
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Summary Panel