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

CI: Acceptance jobs are failing #631

Open
phansys opened this issue Oct 19, 2024 · 0 comments
Open

CI: Acceptance jobs are failing #631

phansys opened this issue Oct 19, 2024 · 0 comments

Comments

@phansys
Copy link

phansys commented Oct 19, 2024

Acceptance jobs are failing for different reasons between the 2 Ruby versions in the CI workflow.

Related to #80, #339.


Acceptance (2.5)

/opt/hostedtoolcache/Ruby/2.5.9/x64/lib/ruby/gems/2.5.0/gems/cfn-model-0.6.6/lib/cfn-model/validator/resource_type_validator.rb:20:in `block in validate': no implicit conversion of String into Integer (TypeError)

In this case, I think the problem is caused by the introduction of the Custom::GetFromJson resource type, which is not supported currently by cfn-model. See aws-cloudformation/aws-cloudformation-templates#439.

See stack trace
Linting sample templates..

/opt/hostedtoolcache/Ruby/2.5.9/x64/lib/ruby/gems/2.5.0/gems/cfn-model-0.6.6/lib/cfn-model/validator/resource_type_validator.rb:20:in `block in validate': no implicit conversion of String into Integer (TypeError)
    from /opt/hostedtoolcache/Ruby/2.5.9/x64/lib/ruby/gems/2.5.0/gems/cfn-model-0.6.6/lib/cfn-model/validator/resource_type_validator.rb:19:in `each'
    from /opt/hostedtoolcache/Ruby/2.5.9/x64/lib/ruby/gems/2.5.0/gems/cfn-model-0.6.6/lib/cfn-model/validator/resource_type_validator.rb:19:in `validate'
    from /opt/hostedtoolcache/Ruby/2.5.9/x64/lib/ruby/gems/2.5.0/gems/cfn-model-0.6.6/lib/cfn-model/validator/schema_generator.rb:17:in `generate'
    from /opt/hostedtoolcache/Ruby/2.5.9/x64/lib/ruby/gems/2.5.0/gems/cfn-model-0.6.6/lib/cfn-model/validator/cloudformation_validator.rb:13:in `validate'
    from /opt/hostedtoolcache/Ruby/2.5.9/x64/lib/ruby/gems/2.5.0/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:220:in `pre_validate_model'
    from /opt/hostedtoolcache/Ruby/2.5.9/x64/lib/ruby/gems/2.5.0/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:62:in `parse_without_parameters'
    from /opt/hostedtoolcache/Ruby/2.5.9/x64/lib/ruby/gems/2.5.0/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:43:in `parse'
    from /opt/hostedtoolcache/Ruby/2.5.9/x64/lib/ruby/gems/2.5.0/gems/cfn-nag-0.0.0/lib/cfn-nag/cfn_nag.rb:87:in `audit'
    from /opt/hostedtoolcache/Ruby/2.5.9/x64/lib/ruby/gems/2.5.0/gems/cfn-nag-0.0.0/lib/cfn-nag/cfn_nag.rb:68:in `block in audit_aggregate_across_files'
    from /opt/hostedtoolcache/Ruby/2.5.9/x64/lib/ruby/gems/2.5.0/gems/cfn-nag-0.0.0/lib/cfn-nag/cfn_nag.rb:65:in `each'
    from /opt/hostedtoolcache/Ruby/2.5.9/x64/lib/ruby/gems/2.5.0/gems/cfn-nag-0.0.0/lib/cfn-nag/cfn_nag.rb:65:in `audit_aggregate_across_files'
    from /opt/hostedtoolcache/Ruby/2.5.9/x64/lib/ruby/gems/2.5.0/gems/cfn-nag-0.0.0/lib/cfn-nag/cfn_nag.rb:35:in `audit_aggregate_across_files_and_render_results'
    from /opt/hostedtoolcache/Ruby/2.5.9/x64/lib/ruby/gems/2.5.0/gems/cfn-nag-0.0.0/lib/cfn-nag/cfn_nag_executor.rb:50:in `execute_aggregate_scan'
    from /opt/hostedtoolcache/Ruby/2.5.9/x64/lib/ruby/gems/2.5.0/gems/cfn-nag-0.0.0/lib/cfn-nag/cfn_nag_executor.rb:30:in `scan'
    from /opt/hostedtoolcache/Ruby/2.5.9/x64/lib/ruby/gems/2.5.0/gems/cfn-nag-0.0.0/bin/cfn_nag_scan:11:in `<top (required)>'
    from /opt/hostedtoolcache/Ruby/2.5.9/x64/bin/cfn_nag_scan:23:in `load'
    from /opt/hostedtoolcache/Ruby/2.5.9/x64/bin/cfn_nag_scan:23:in `<main>'

Exception found in cfn_nag_scan, exiting..

Example CI job: https://github.com/phansys/cfn_nag/actions/runs/11420528863/job/31776340749#step:4:156.

Acceptance (3.0)

/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:319:in `const_set': wrong constant name Boto3CodeCommit.put_file (NameError)

Here, the issue seems related to the Boto3::CodeCommit.put_file macro: aws-cloudformation/aws-cloudformation-templates#105.

See stack trace
Linting sample templates..

/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:319:in `const_set': wrong constant name Boto3CodeCommit.put_file (NameError)
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:319:in `rescue in generate_resource_class_from_type'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:315:in `generate_resource_class_from_type'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:267:in `rescue in class_from_type_name'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:263:in `class_from_type_name'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:166:in `block in transform_hash_into_model_elements_with_numbers'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:165:in `each'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:165:in `transform_hash_into_model_elements_with_numbers'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:86:in `parse_without_parameters'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:43:in `parse'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-nag-0.0.0/lib/cfn-nag/cfn_nag.rb:87:in `audit'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-nag-0.0.0/lib/cfn-nag/cfn_nag.rb:68:in `block in audit_aggregate_across_files'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-nag-0.0.0/lib/cfn-nag/cfn_nag.rb:65:in `each'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-nag-0.0.0/lib/cfn-nag/cfn_nag.rb:65:in `audit_aggregate_across_files'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-nag-0.0.0/lib/cfn-nag/cfn_nag.rb:35:in `audit_aggregate_across_files_and_render_results'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-nag-0.0.0/lib/cfn-nag/cfn_nag_executor.rb:50:in `execute_aggregate_scan'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-nag-0.0.0/lib/cfn-nag/cfn_nag_executor.rb:30:in `scan'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-nag-0.0.0/bin/cfn_nag_scan:11:in `<top (required)>'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/bin/cfn_nag_scan:25:in `load'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/bin/cfn_nag_scan:25:in `<main>'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:316:in `const_get': wrong constant name Boto3CodeCommit.put_file (NameError)
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:316:in `generate_resource_class_from_type'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:267:in `rescue in class_from_type_name'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:263:in `class_from_type_name'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:166:in `block in transform_hash_into_model_elements_with_numbers'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:[165](https://github.com/phansys/cfn_nag/actions/runs/11420528863/job/31776340963#step:4:166):in `each'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:165:in `transform_hash_into_model_elements_with_numbers'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:86:in `parse_without_parameters'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:43:in `parse'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-nag-0.0.0/lib/cfn-nag/cfn_nag.rb:87:in `audit'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-nag-0.0.0/lib/cfn-nag/cfn_nag.rb:68:in `block in audit_aggregate_across_files'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-nag-0.0.0/lib/cfn-nag/cfn_nag.rb:65:in `each'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-nag-0.0.0/lib/cfn-nag/cfn_nag.rb:65:in `audit_aggregate_across_files'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-nag-0.0.0/lib/cfn-nag/cfn_nag.rb:35:in `audit_aggregate_across_files_and_render_results'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-nag-0.0.0/lib/cfn-nag/cfn_nag_executor.rb:50:in `execute_aggregate_scan'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-nag-0.0.0/lib/cfn-nag/cfn_nag_executor.rb:30:in `scan'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-nag-0.0.0/bin/cfn_nag_scan:11:in `<top (required)>'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/bin/cfn_nag_scan:25:in `load'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/bin/cfn_nag_scan:25:in `<main>'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:264:in `class_from_type_name': uninitialized constant Boto3 (NameError)
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:[166](https://github.com/phansys/cfn_nag/actions/runs/11420528863/job/31776340963#step:4:167):in `block in transform_hash_into_model_elements_with_numbers'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:165:in `each'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:165:in `transform_hash_into_model_elements_with_numbers'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:86:in `parse_without_parameters'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:43:in `parse'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-nag-0.0.0/lib/cfn-nag/cfn_nag.rb:87:in `audit'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-nag-0.0.0/lib/cfn-nag/cfn_nag.rb:68:in `block in audit_aggregate_across_files'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-nag-0.0.0/lib/cfn-nag/cfn_nag.rb:65:in `each'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-nag-0.0.0/lib/cfn-nag/cfn_nag.rb:65:in `audit_aggregate_across_files'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-nag-0.0.0/lib/cfn-nag/cfn_nag.rb:35:in `audit_aggregate_across_files_and_render_results'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-nag-0.0.0/lib/cfn-nag/cfn_nag_executor.rb:50:in `execute_aggregate_scan'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-nag-0.0.0/lib/cfn-nag/cfn_nag_executor.rb:30:in `scan'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/cfn-nag-0.0.0/bin/cfn_nag_scan:11:in `<top (required)>'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/bin/cfn_nag_scan:25:in `load'
    from /opt/hostedtoolcache/Ruby/3.0.7/x64/bin/cfn_nag_scan:25:in `<main>'

Exception found in cfn_nag_scan, exiting..

Example CI job: https://github.com/phansys/cfn_nag/actions/runs/11420528863/job/31776340963#step:4:143.

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

1 participant