Results 1 to 2 of 2

Thread: 16.04 apt upgrade failing on cloud-init

  1. #1
    Join Date
    Oct 2022
    Beans
    2

    Question 16.04 apt upgrade failing on cloud-init

    Hi,

    First post here so sorry if I miss any information etc.

    We're upgrading our estate across the board and one of the major projects I'm doing is updating MongoDB using Ops Manager, I have reached the stage where I need to upgrade 16.04 to 18.04 and then to 20.04 but after running 'apt update' and then 'apt upgrade' as root they both complete but upgrade fires out one final error:

    Errors were encountered while processing:
    cloud-init
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    I've tried this on two 16.04 machines built using the same ansible script (after upgrading them from MongoDB 3.6 manually and then to 4.4 using Ops Manager) and now whenever I try to attempt any upgrade, I just get cloud-init errors thrown at me that seem to relate to python3:

    SyntaxError: invalid syntax


    File "/usr/lib/python3/dist-packages/cloudinit/url_helper.py", line 638
    loop_n: int = 0
    ^
    SyntaxError: invalid syntax


    File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 408
    sys.stdout.write(f"{console_error}\n")
    ^
    SyntaxError: invalid syntax


    Theres about 400 lines of these so won't past them all but you can get the gist.

    'Python' is set to 2.7.12
    'Python3' is set to 3.5.2

    Any help would be greatly appreciated here as I'm pulling hair out!

  2. #2
    Join Date
    Oct 2022
    Beans
    2

    Re: 16.04 apt upgrade failing on cloud-init

    Sorry my bad on this our tech director pointed it out. When logging in it showed 16.04 but the server itself is on 18.04 (something broken with cloud-init funnily enough) so we've changed the repo and seems to be good now

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •