Skip to content

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

Closed

Description

@jweisner

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.

Activity

  1. jweisner commented on Oct 21, 2020

    @jweisner
    Author

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

  2. stevemeier commented on Oct 21, 2020

    @stevemeier
    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!

  3. jweisner commented on Oct 22, 2020

    @jweisner
    Author

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

  4. g-kaplan commented on Oct 22, 2020

    @g-kaplan

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

  5. added a commit that references this issue on Oct 23, 2020
  6. stevemeier commented on Oct 23, 2020

    @stevemeier
    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

  7. jweisner commented on Oct 23, 2020

    @jweisner
    Author

    Completed successfully!

  8. stevemeier commented on Oct 24, 2020

    @stevemeier
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions