Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sonic_installer]: Improve exception handling: introduce notes. #3029

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

nazariig
Copy link
Collaborator

@nazariig nazariig commented Oct 30, 2023

Signed-off-by: Nazarii Hnydyn [email protected]

What I did

  • Extended exception class with user notes

How I did it

  • Implemented new API

How to verify it

  • Run UTs

Tested branch (Please provide the tested image version)

  • master

Previous command output (if the output of a command-line utility has changed)

Traceback (most recent call last):
  File "/usr/local/bin/sonic_installer", line 8, in <module>
    sys.exit(sonic_installer())
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/sonic_installer/main.py", line 604, in install
    migrate_sonic_packages(bootloader, binary_image_version)
  File "/usr/local/lib/python3.9/dist-packages/sonic_installer/main.py", line 384, in migrate_sonic_packages
    run_command_or_raise(["chroot", new_image_mount, SONIC_PACKAGE_MANAGER, "migrate",
  File "/usr/local/lib/python3.9/dist-packages/sonic_installer/common.py", line 56, in run_command_or_raise
    raise sre
sonic_installer.exception.SonicRuntimeException: Failed to run command '['chroot', '/tmp/image-202305_RC.6-8c7a14378_Internal-fs', 'sonic-package-manager', 'migrate', '/tmp/packages.json', '--dockerd-socket', '/tmp/docker.sock', '-y']'

New command output (if the output of a command-line utility has changed)

Traceback (most recent call last):
  File "/usr/local/bin/sonic_installer", line 8, in <module>
    sys.exit(sonic_installer())
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/sonic_installer/main.py", line 604, in install
    migrate_sonic_packages(bootloader, binary_image_version)
  File "/usr/local/lib/python3.9/dist-packages/sonic_installer/main.py", line 384, in migrate_sonic_packages
    run_command_or_raise(["chroot", new_image_mount, SONIC_PACKAGE_MANAGER, "migrate",
  File "/usr/local/lib/python3.9/dist-packages/sonic_installer/common.py", line 56, in run_command_or_raise
    raise sre
sonic_installer.exception.SonicRuntimeException: Failed to run command '['chroot', '/tmp/image-202305_RC.6-8c7a14378_Internal-fs', 'sonic-package-manager', 'migrate', '/tmp/packages.json', '--dockerd-socket', '/tmp/docker.sock', '-y']'

STDOUT:
Failed to migrate packages 500 Server Error for http+docker://localhost/v1.41/images/urm.nvidia.com/sw-nbu-sws-sonic-docker/doai:1.1.0-202305-6/get: Internal Server Error ("open /var/lib/docker/overlay2/abaca4cf4dead46a809f8a10d8488099cb6df653617b0017fc5913228d077436/merged/usr/lib/python3/dist-packages/_distutils_hack/__pycache__/__init__.cpython-39.pyc: no such file or directory")

@nazariig
Copy link
Collaborator Author

@stepanblyschak FYI

@nazariig
Copy link
Collaborator Author

@prsunny / @qiluo-msft would you please help to review & merge?

@liat-grozovik liat-grozovik requested review from saiarcot895 and removed request for qiluo-msft and volodymyrsamotiy November 14, 2023 17:21
StormLiangMS pushed a commit that referenced this pull request Nov 15, 2023
What I did
Extended exception class with user notes
How I did it
Implemented new API
How to verify it
Run UTs
Tested branch (Please provide the tested image version)
 202305
Details if related
Backport from master: [sonic_installer]: Improve exception handling: introduce notes. #3029
@nazariig
Copy link
Collaborator Author

@prsunny / @qiluo-msft just a kind reminder

@saiarcot895 saiarcot895 merged commit 8ebc56a into sonic-net:master Nov 20, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants