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 an undefined value as an ARRAY #31

Closed
jweisner opened this issue Oct 21, 2020 · 7 comments
Closed

Can't use an undefined value as an ARRAY #31

jweisner opened this issue Oct 21, 2020 · 7 comments

Comments

@jweisner
Copy link

I'm getting the following error running the script on CentOS 7:

Can't use an undefined value as an ARRAY reference at ./errata-import.pl line 687.

Steps to reproduce:

$ wget https://github.com/stevemeier/cefs/raw/master/errata-import.pl
$ chmod +x errata-import.pl 
$ ./errata-import.pl --server spacewalk.example.com --publish   --errata $PWD/errata.latest.xml --rhsa-oval $PWD/com.redhat.rhsa-all.xml --include-channels centos-6-base,centos-6-updates,centos-6-sclo,centos-6-extras centos-7-base,centos-7-updates,centos-7-extras

Output:

INFO: Server is running API version 23
INFO: API version 23 is supported
INFO: Authentication successful
INFO: User has administrator access to this server
INFO: Loading errata XML
INFO: Loading Red Hat OVAL XML
INFO: Getting server inventory
INFO: Checking for unpublished errata
INFO: Scanning channel CentOS 6 - Updates
...
INFO: Channel Elasticsearch 5.x - EL7 (elasticsearch-5-el7) is NOT included
INFO: Errata for CEBA-2018:0748 already exists
INFO: Adding packages to CEBA-2018:0748: 300141,300138,300140,300139,1154638
INFO: Errata for CEBA-2019:2322 already exists
INFO: Adding packages to CEBA-2019:2322: 1155709
INFO: Errata for CEBA-2020:1578 already exists
INFO: Adding packages to CEBA-2020:1578: 1025947
INFO: Errata for CEBA-2020:1580 already exists
INFO: Adding packages to CEBA-2020:1580: 1024428,1024404,1024412,1024423,1024401,1024400,1024402,1024414,1024418,1024403,1024419,1024413,1024411,1024406,1024433,1024432,1024431,1024435,1024407,1024421,1024434,1024410,1024425,1024415,1024409,1024417,1024436,1024408,1024426,1024427,1024420,1024422,1024405,1024424,1024430,1024416,1024429
INFO: Creating errata for CEBA-2020:1583 (CentOS scap-security-guide Update) (2 of 2)
INFO: Adding issue date to CEBA-2020:1583
INFO: Publishing Errata for CEBA-2020:1583
Can't use an undefined value as an ARRAY reference at ./errata-import.pl line 687.
@jweisner
Copy link
Author

The script at commit 54987bc doesn't have this bug. The import task completed successfully with the same inputs.

@stevemeier
Copy link
Owner

Can you please try again with --debug
Looking at the code I can't quite figure out how this could happen and I can't reproduce it on my test system.
Thanks!

@jweisner
Copy link
Author

Attached is the output of running the same command with --debug
Terminal Saved Output.txt

@g-kaplan
Copy link

Can confirm I've also run into this on the new build, would you like additional --debug output from mine?

@stevemeier
Copy link
Owner

@g-kaplan Thanks, I think I already spotted the problem.

@jweisner I just checked in a new version which should fix the issue. Please give it a try, thanks

@jweisner
Copy link
Author

Completed successfully!

@stevemeier
Copy link
Owner

Source of this issue was that the new find_package_by_name/find_packages_by_advisory subroutine did not handle --include-channels. It therefore returned packages which should not have been included in the search and the main loop (kind of rightfully) crashed.

To fix this, I have switched back to the previous subroutine which is tried and tested.

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