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

Vague error message related to resource property #187

Closed
mrog opened this issue Jul 12, 2023 · 0 comments · Fixed by #596
Closed

Vague error message related to resource property #187

mrog opened this issue Jul 12, 2023 · 0 comments · Fixed by #596

Comments

@mrog
Copy link

mrog commented Jul 12, 2023

This input causes an error. Note the use of SourceSecurityGroupId in a SecurityGroupEgress. CloudFormation accepts this template and creates a stack, but Noctilucent produces a really vague error message.

AWSTemplateFormatVersion: 2010-09-09
Resources:
  SG1:
    Type: 'AWS::EC2::SecurityGroup'
    Properties:
      GroupDescription: 'SG1'
      VpcId: !Ref TestVPC
  SG2:
    Type: 'AWS::EC2::SecurityGroup'
    Properties:
      VpcId: !Ref TestVPC
      GroupDescription: 'SG2'
      SecurityGroupEgress:
        IpProtocol: 'TCP'
        FromPort: 10000
        ToPort: 10000
        SourceSecurityGroupId: !Ref SG1
  TestVPC:
    Type: 'AWS::EC2::VPC'
    Properties:
      CidrBlock: '10.0.0.0/16'

The output looks like this:

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/ir/resources/mod.rs:129:68
stack backtrace:
   0:        0x105483b87 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hae51cb91d407e2ef
   1:        0x1054195db - core::fmt::write::h746bc0969202388b
   2:        0x10545ee3c - std::io::Write::write_fmt::h4098c2c7437a0bd7
   3:        0x105487704 - std::sys_common::backtrace::print::h8360bf0158e89b36
   4:        0x1054874c9 - std::panicking::default_hook::{{closure}}::hedf04c568eb6e0bc
   5:        0x105487a67 - std::panicking::rust_panic_with_hook::h22edd02828aff274
   6:        0x105487878 - std::panicking::begin_panic_handler::{{closure}}::h6895f44a9b7e2caa
   7:        0x105487809 - std::sys_common::backtrace::__rust_end_short_backtrace::h013519e9b77978c5
   8:        0x1054877f2 - _rust_begin_unwind
   9:        0x10549ea63 - core::panicking::panic_fmt::h2a51b60c12d11322
  10:        0x10549eb47 - core::panicking::panic::h00b4c20719c0abc2
  11:        0x105437484 - noctilucent::ir::resources::ResourceTranslator::translate::hf043457459ff11fa
  12:        0x10542f4e7 - noctilucent::ir::resources::ResourceInstruction::from::ha9a604782ce9b876
  13:        0x10542a9e2 - noctilucent::ir::CloudformationProgramIr::from::hbee5e1fbc7775a35
  14:        0x1053d706e - noctilucent::main::hde7d4cf2812ec0cf
  15:        0x1053ae516 - std::sys_common::backtrace::__rust_begin_short_backtrace::hcdb722f1a5cc110d
  16:        0x1053d8449 - _main

There are actually two issues here. The first is that the template causes an error. The second is that the error message doesn't give the user any information they can use to locate the problem in the input. There's no line number, property name, resource name, etc.

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