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

Return code 0 on unsuccessfull upload #93

Closed
grisu48 opened this issue Jul 19, 2022 · 4 comments
Closed

Return code 0 on unsuccessfull upload #93

grisu48 opened this issue Jul 19, 2022 · 4 comments

Comments

@grisu48
Copy link
Contributor

grisu48 commented Jul 19, 2022

The ec2uploadimg tool terminates with exit code 0, also if there are obvious configuration issues and thereby no image being uploaded. See the following output we obtained from one of our openQA test runs, where we rely on the return code of ec2uploadimg to determine, if the upload was successful.

# ec2uploadimg ... 'SLES15-SP4.aarch64-0.9.9-EC2-Build1.55.raw.xz'
Creating temporary security group
Temporary Security Group Created sg-062f66b1f33abb2bb in vpc 
Successfully allowed incoming SSH port 22 for security group sg-062f66b1f33abb2bb in 
Specified subnet subnet-b44c72df not found
Traceback (most recent call last):
  File "/root/.venv_ec2uploadimg/lib/python3.6/site-packages/ec2imgutils/ec2uploadimg.py", line 193, in _check_subnet_exists
    self._connect().describe_subnets(SubnetIds=[self.vpc_subnet_id])
  File "/root/.venv_ec2uploadimg/lib/python3.6/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/root/.venv_ec2uploadimg/lib/python3.6/site-packages/botocore/client.py", line 676, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (InvalidSubnetID.NotFound) when calling the DescribeSubnets operation: The subnet ID 'subnet-XXXXXXXX' does not exist

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/.venv_ec2uploadimg/bin/ec2uploadimg", line 670, in <module>
    ami = uploader.create_image_use_root_swap(args.source)
  File "/root/.venv_ec2uploadimg/lib/python3.6/site-packages/ec2imgutils/ec2uploadimg.py", line 1029, in create_image_use_root_swap
    target_root_volume = self._create_image_root_volume(source)
  File "/root/.venv_ec2uploadimg/lib/python3.6/site-packages/ec2imgutils/ec2uploadimg.py", line 332, in _create_image_root_volume
    self._check_subnet_exists()
  File "/root/.venv_ec2uploadimg/lib/python3.6/site-packages/ec2imgutils/ec2uploadimg.py", line 196, in _check_subnet_exists
    raise EC2UploadImgException(error_msg)
ec2imgutils.ec2imgutilsExceptions.EC2UploadImgException: Specified subnet subnet-XXXXXXXX not found
EC2UploadImgException: Specified subnet subnet-XXXXXXXX not found
Successfully deleted security group sg-062f66b1f33abb2bb

The issue is likely attributed to the except block here. I will try to create a pull request with a solution suggestion.

@rjschwei
Copy link
Collaborator

@grisu48 please file a bug in the SUSE bugzilla to allow us to update the package in SLE.

@grisu48
Copy link
Contributor Author

grisu48 commented Jul 19, 2022

Oh damn, I just created #94 as a solution suggestion.
Please let me know if this is roughly ok, otherwise I close it and file a bugzilla ticket.

@rjschwei
Copy link
Collaborator

That's fine, PR and bsc are independent, thanks for the PR.

@apozsuse
Copy link
Contributor

Thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants