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

Can't use undefined value as ARRAY reference #6

Open
Sjizo opened this issue Nov 28, 2018 · 7 comments
Open

Can't use undefined value as ARRAY reference #6

Sjizo opened this issue Nov 28, 2018 · 7 comments

Comments

@Sjizo
Copy link

Sjizo commented Nov 28, 2018

Hi, When running the program I get an error

Can't use an undefined value as an ARRAY reference at lib/AWS/Network/SecurityGroupMap.pm line 154.

@pplu
Copy link
Owner

pplu commented Dec 11, 2018

Hi,

Sorry for not seeing this before (It kind of got lost between other stuff). Since the error is here: https://github.com/pplu/aws-map/blob/master/lib/AWS/Network/SecurityGroupMap.pm#L154

It would look like you have an ELBv2 with no SecurityGroups. Can you do a DescribeLoadBalancers in the ELBv2 API (can be done with the AWS CLI) and send me the results? (please redact any identifying or delicate information).

This will probably be solved by adding a return if (not defined $elb->SecurityGroups) on line 153.

Can you try that and report if it worked?

@Hindmalti
Copy link

Hello !
I've got the same error," Can't use an undefined value as an ARRAY reference at lib/AWS/Network/SecurityGroupMap.pm line 154"
I've added :
return if (not defined $elb->SecurityGroups) on the line 153 but then I have too many errors.
Can I have some help please ?
Thank's !

@pplu
Copy link
Owner

pplu commented Aug 1, 2019

but then I have too many errors.

Can you attach the errors?

@Hindmalti
Copy link

"my" variable $elb masks earlier declaration in same scope at lib/AWS/Network/SecurityGroupMap.pm line 154.
"my" variable $sg masks earlier declaration in same statement at lib/AWS/Network/SecurityGroupMap.pm line 155.
"my" variable $elb masks earlier declaration in same statement at lib/AWS/Network/SecurityGroupMap.pm line 155.
Array found where operator expected at lib/AWS/Network/SecurityGroupMap.pm line 167, at end of line
(Missing operator before ?)
Array found where operator expected at lib/AWS/Network/SecurityGroupMap.pm line 180, at end of line
(Missing operator before ?)
Array found where operator expected at lib/AWS/Network/SecurityGroupMap.pm line 207, at end of line
(Missing operator before ?)
Use of my $_ is experimental at lib/AWS/Network/SecurityGroupMap.pm line 210.
Use of my $_ is experimental at lib/AWS/Network/SecurityGroupMap.pm line 210.
Array found where operator expected at lib/AWS/Network/SecurityGroupMap.pm line 210, at end of line
(Missing operator before ?)
Array found where operator expected at lib/AWS/Network/SecurityGroupMap.pm line 211, at end of line
(Missing operator before ?)
Array found where operator expected at lib/AWS/Network/SecurityGroupMap.pm line 220, at end of line
(Missing operator before ?)
syntax error at lib/AWS/Network/SecurityGroupMap.pm line 154, near ")
foreach "
syntax error at lib/AWS/Network/SecurityGroupMap.pm line 157, near "}"
syntax error at lib/AWS/Network/SecurityGroupMap.pm line 167, near "->@"
syntax error at lib/AWS/Network/SecurityGroupMap.pm line 170, near "}"
syntax error at lib/AWS/Network/SecurityGroupMap.pm line 180, near "->@
"
syntax error at lib/AWS/Network/SecurityGroupMap.pm line 183, near "}"
syntax error at lib/AWS/Network/SecurityGroupMap.pm line 200, near "}"
syntax error at lib/AWS/Network/SecurityGroupMap.pm line 207, near "->@"
syntax error at lib/AWS/Network/SecurityGroupMap.pm line 211, near "->@
"
syntax error at lib/AWS/Network/SecurityGroupMap.pm line 220, near "->@*"
lib/AWS/Network/SecurityGroupMap.pm has too many errors.
Compilation failed in require at bin/map-webserver line 3.
BEGIN failed--compilation aborted at bin/map-webserver line 3.

@Hindmalti
Copy link

Thank you ! ;)

pplu added a commit that referenced this issue Aug 5, 2019
@pplu
Copy link
Owner

pplu commented Aug 5, 2019

@Hindmalti : the way I had suggested the fix there was a syntax error (missing ;) at the end of the line. I've pushed to master correct code.

If you still get errors it could be because you're using a very old Perl (aws-map needs Perl > 5.18 #7). You can use https://perlbrew.pl/ to get a modern Perl running, or take a look at running aws-map from a Docker container (you have a working Dockerfile in the project).

Please tell me if this helped.

@pplu
Copy link
Owner

pplu commented Sep 24, 2019

@Hindmalti : did you finally get this working?

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