Skip to content
This repository has been archived by the owner on Jun 25, 2019. It is now read-only.

CFA: invalid index exception #61

Open
pohly opened this issue Jun 28, 2016 · 13 comments
Open

CFA: invalid index exception #61

pohly opened this issue Jun 28, 2016 · 13 comments

Comments

@pohly
Copy link
Contributor

pohly commented Jun 28, 2016

Sometimes, under uncertain circumstances, parsing manifest files fails because a line does not contain two words, leading to this exception (https://ostroproject.org/jenkins/job/build_intel-quark/1997/console):

ERROR: Exception in plugin ISA_LicenseChecker process_report():
03:46:29.670 Traceback (most recent call last):
03:46:29.670   File "/var/lib/jenkins/ostro-worker-19-slot-0-OTusb/ostro-os/meta-security-isafw/lib/isafw/isafw.py", line 133, in call_plugins
03:46:29.670     method(*parameters, **keywords)
03:46:29.670   File "/var/lib/jenkins/ostro-worker-19-slot-0-OTusb/ostro-os/meta-security-isafw/lib/isafw/isaplugins/ISA_la_plugin.py", line 262, in process_report
03:46:29.670     return LicenseChecker.process_report()
03:46:29.670   File "/var/lib/jenkins/ostro-worker-19-slot-0-OTusb/ostro-os/meta-security-isafw/lib/isafw/isaplugins/ISA_la_plugin.py", line 127, in process_report
03:46:29.670     self.process_pkg_list()
03:46:29.670   File "/var/lib/jenkins/ostro-worker-19-slot-0-OTusb/ostro-os/meta-security-isafw/lib/isafw/isaplugins/ISA_la_plugin.py", line 145, in process_pkg_list
03:46:29.670     orig_pkg_name = line.split()[2]
03:46:29.670 IndexError: list index out of range

That was with meta-security-isafw 89d4453.

At the very least we should add better error handling for the input files. Then if those errors trigger, we may get more information about the root cause of the problem.

@ereshetova
Copy link
Contributor

I made this fix now: 18c9b4c
It would gracefully handle the condition and also allow to produce the reports to see what is wrong. I wasn't able to reproduce locally, so real cause is still unknown, but this commit should help to show it.

@ereshetova
Copy link
Contributor

@pohly I cannot reproduce this issue anymore, can you?

@pohly
Copy link
Contributor Author

pohly commented Jul 8, 2016

We still need to check for "UNKNOWN" in the log files and figure out the root cause. I'd prefer to keep this open until we know that.

@ereshetova
Copy link
Contributor

Problem is that I cannot find any UKNOWN in the logs...

@pohly
Copy link
Contributor Author

pohly commented Jul 8, 2016

Is that perhaps because none of the packages where the problem occurs need to be reported? In that case we will have to add more debug output and check the isafw_lalog for that output.

@ereshetova
Copy link
Contributor

No, the file where now UNKNOWN should appear is the pkg list of the image: where first field is binary pkg name, second, pkg version and third one is source pkg. It has nothing to do with the license check yet at that point. I also made a small correction check for empty line there, I wonder if this was the case that was failing.

@pohly
Copy link
Contributor Author

pohly commented Jul 8, 2016

If it was the empty line, then why did we sometimes get that empty line and sometimes not? This still worries me. Which file is the code parsing?

@ereshetova
Copy link
Contributor

@pohly
Copy link
Contributor Author

pohly commented Jul 12, 2016

@ereshetova is that "isafw/intel-corei7-64/pkglist" the input file (the one which triggered the index exception), or the output file (where we should find the "UNKNOWN" valued in the third column)? Probably the latter. My question was about the former - what file is getting parsed by the ISAFW code?

@ereshetova
Copy link
Contributor

@pohly, actually I got you confused and was confused myself :( Task switching doesn't work very well recently for me. So, the isafw/intel-corei7-64/pkglist is the input file that triggers the exception. The output file doesn't exist, because the output data is only maintained in memory struct. I will add dump of that data now to the log to see if I see UNKNOWN present.

@pohly
Copy link
Contributor Author

pohly commented Jul 12, 2016

@ereshetova I know exactly what you mean with multitasking ;-} Okay, so it is as I thought ("none of the packages where the problem occurs need to be reported") and we need additional debug output to root-cause the problem.

@ereshetova
Copy link
Contributor

@pohly. Actually after sleeping and thinking on clear head to this: I have the data already dumped in logs. Here for example: http://ostro.ostc.intel.com/download/builds/meta-security-isafw_pull-requests/66/2016-07-06_02-10-08-build-85/isafw/intel-quark/isafw-logs/isafw_lalog

If you search for UNKNOWN, you will find entries like:
kernel-modu+git0+80d463be82-r0.0 from bundle-ostro-image-swupd-qa-bundle-b UNKNOWN

where the first item, binary pkg name, then image name and then source pkg name that is missing for some reason and therefore fix was writing UNKNOWN.

Now why this happens. If you check pkg list here (http://ostro.ostc.intel.com/download/builds/meta-security-isafw_pull-requests/66/2016-07-06_02-10-08-build-85/isafw/intel-quark/pkglist ), you can find that this is the entry for this binary pkg:

kernel-modu+git0+80d463be82-r0.0 linux-firmware-ralink-license

So, it does have source pkg name, what it is missing is the version in between (means supplied as empty from bitbake), so there are only two arguments. I didn't expect this to be possible before, but I will make a better line parsing now given that such things happen.

@ereshetova
Copy link
Contributor

there are also entries where source pkg name is also missing:
I am trying to investigate why...
kernel-module-nls-ascii 4.4.13+git1+44a6105173_2ae6amodule-adf4350

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants