Bug 577704

Summary: NPE in org.eclipse.equinox.internal.p2.engine.phases.CheckTrust
Product: [Eclipse Project] Equinox Reporter: Lars Vogel <Lars.Vogel>
Component: p2Assignee: Mickael Istria <mistria>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Lars.Vogel, loskutov, mistria
Version: 4.22Keywords: regression
Target Milestone: 4.23 M1   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=577193
https://git.eclipse.org/r/c/equinox/rt.equinox.p2/+/188689
https://git.eclipse.org/c/equinox/rt.equinox.p2.git/commit/?id=556f831a5bcb586a01761cb80b1efd51472ef48a
https://bugs.eclipse.org/bugs/show_bug.cgi?id=577863
Whiteboard:

Description Lars Vogel CLA 2021-12-09 03:12:10 EST
Trying to install the Asciidoc editor into latest I-Build from the following update site results in an error:
 https://de-jcup.github.io/update-site-eclipse-asciidoctor-editor/update-site/

Worked fine in 4.22.

An error occurred during the org.eclipse.equinox.internal.p2.engine.phases.CheckTrust phase.
session context was:(profile=SDKProfile, phase=org.eclipse.equinox.internal.p2.engine.phases.CheckTrust, operand=, action=).
NullPointerException
java.lang.NullPointerException
Comment 1 Andrey Loskutov CLA 2021-12-09 03:13:56 EST
(In reply to Lars Vogel from comment #0)
> An error occurred during the
> org.eclipse.equinox.internal.p2.engine.phases.CheckTrust phase.
> session context was:(profile=SDKProfile,
> phase=org.eclipse.equinox.internal.p2.engine.phases.CheckTrust, operand=,
> action=).
> NullPointerException
> java.lang.NullPointerException

Can you provide a stack trace please?
Comment 2 Lars Vogel CLA 2021-12-09 03:17:23 EST
Stack trace:

java.lang.NullPointerException
	at org.eclipse.equinox.internal.p2.engine.phases.CertificateChecker.checkCertificates(CertificateChecker.java:226)
	at org.eclipse.equinox.internal.p2.engine.phases.CertificateChecker.start(CertificateChecker.java:73)
	at org.eclipse.equinox.internal.p2.engine.phases.CheckTrust.completePhase(CheckTrust.java:63)
	at org.eclipse.equinox.internal.p2.engine.Phase.postPerform(Phase.java:254)
	at org.eclipse.equinox.internal.p2.engine.Phase.perform(Phase.java:105)
	at org.eclipse.equinox.internal.p2.engine.PhaseSet.perform(PhaseSet.java:50)
	at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:80)
	at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:48)
	at org.eclipse.equinox.p2.operations.ProvisioningSession.performProvisioningPlan(ProvisioningSession.java:181)
	at org.eclipse.equinox.p2.operations.ProfileModificationJob.runModal(ProfileModificationJob.java:76)
	at org.eclipse.equinox.p2.operations.ProvisioningJob.run(ProvisioningJob.java:188)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Comment 3 Andrey Loskutov CLA 2021-12-09 03:53:23 EST
Regression from bug 577193.
"trustedKeys" is null because it only initialized if code is not signed. Obviously we have signed code only?

I guess trustedKeys must be initialized to something useful if still is null after the big first "for" loop in org.eclipse.equinox.internal.p2.engine.phases.CertificateChecker.checkCertificates(SignedContentFactory)
Comment 4 Eclipse Genie CLA 2021-12-09 07:32:01 EST
New Gerrit change created: https://git.eclipse.org/r/c/equinox/rt.equinox.p2/+/188689
Comment 5 Mickael Istria CLA 2021-12-09 08:20:40 EST
This should now be fixed.
Comment 7 Lars Vogel CLA 2021-12-10 02:59:56 EST
Thanks Mickael for the fast fix, verified in the latest I-build.