Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-3488

cf-remote --remote-download doesn't fail well

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Higher
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: N/A
    • Component/s: contrib: cf-remote
    • Labels:
      None
    • Story Points:
      1

      Description

      cf-remote doesn't detect when the remote curl gets a 404:

      $ cf-remote install --hub hub --bootstrap hub --demo --remote-download --package "https://example.com/blahblah.deb"
      
      ubuntu@34.245.219.130
      OS            : ubuntu (debian)
      Architecture  : x86_64
      CFEngine      : Not installed
      Policy server : None
      Binaries      : dpkg, apt
      
      Downloading 'https://example.com/blahblah.deb' on 'ubuntu@34.245.219.130' using curl
      Installing: 'blahblah.deb' on 'ubuntu@34.245.219.130'
      Encountered a bad command exit code!
      
      Command: 'sudo bash -c "dpkg -i blahblah.deb"'
      
      Exit code: 1
      
      Stdout:
      
      dpkg-deb: error: 'blahblah.deb' is not a debian format archive
      dpkg: error processing archive blahblah.deb (--install):
       subprocess dpkg-deb --control returned error exit status 2
      Errors were encountered while processing:
       blahblah.deb
      
      Stderr: n/a (PTYs have no stderr)
      
      
      [ERROR] Sudo command unexpectedly exited: 'dpkg -i blahblah.deb'
      
      
      ^CTraceback (most recent call last):
        File "/home/olehermanse/bin/cf-remote", line 11, in <module>
          main()
        File "/home/olehermanse/code/northern.tech/cfengine/core/contrib/cf-remote/cf_remote/main.py", line 348, in main
          exit_code = run_command_with_args(args.command, args)
        File "/home/olehermanse/code/northern.tech/cfengine/core/contrib/cf-remote/cf_remote/main.py", line 111, in run_command_with_args
          return commands.install(
        File "/home/olehermanse/code/northern.tech/cfengine/core/contrib/cf-remote/cf_remote/commands.py", line 179, in install
          hubs_install_pool.map(lambda job: job.run(), hub_jobs)
        File "/usr/lib/python3.8/multiprocessing/pool.py", line 364, in map
          return self._map_async(func, iterable, mapstar, chunksize).get()
        File "/usr/lib/python3.8/multiprocessing/pool.py", line 762, in get
          self.wait(timeout)
        File "/usr/lib/python3.8/multiprocessing/pool.py", line 759, in wait
          self._event.wait(timeout)
        File "/usr/lib/python3.8/threading.py", line 558, in wait
          signaled = self._cond.wait(timeout)
        File "/usr/lib/python3.8/threading.py", line 302, in wait
          waiter.acquire()
      KeyboardInterrupt
      
      olehermanse@OH-WIN core $
      

        Attachments

          Activity

            People

            • Assignee:
              olehermanse Ole Herman Schumacher Elgesem
              Reporter:
              olehermanse Ole Herman Schumacher Elgesem
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Summary Panel