Bug 874785
| Summary: | Owner migration fails with null ptr exception | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Community] Candlepin (Migrated to Jira) | Reporter: | Andrew Edwards <aedwards> | ||||
| Component: | candlepin | Assignee: | Jesus M. Rodriguez <jesusr> | ||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Katello QA List <katello-qa-list> | ||||
| Severity: | unspecified | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 0.9 | CC: | bkearney, jesusr, tpfromme | ||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2014-11-07 16:00:13 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
Andrew Edwards
2012-11-08 20:33:17 UTC
Created attachment 641075 [details]
null pointer migrating owner
This looks like a n00b coding mistake, but it alludes to a consumer with *NO* facts coming across the wire.
295 for (Consumer consumer : rsp.getEntity()) {
296 log.info("importing consumer: " + consumer.toString());
297
298 log.info("consumer.id: " + consumer.getId());
299 log.info("consumer.entitlements: " +
300 consumer.getEntitlements().toString());
301 log.info("consumer.facts: " + consumer.getFacts().toString());
it can't be consumer because the lines preceding 301 worked. So this means that getFacts() is null. I will add a unit test and some null checking to this.
Fixed in 0.7.13-hotfix branch: 98dd321e7db604cec29b1eed92b7f13ddeee36ba Fixed in master: https://github.com/candlepin/candlepin/pull/117 Deployed candlepin 0.7.13.4 in dev environment. Migrations still fail but with new location. Exception is below. Nov 28 17:44:44 [ITClusteredScheduler_Worker-2] ERROR org.quartz.core.JobRunShell - Job async group.migrate_owner_f7a2cf4c-b8a3-4ad4-9d19-ca420dd7ac14 threw an unhandled Exception: java.lang.NullPointerException at org.candlepin.model.ConsumerCurator.replicate(ConsumerCurator.java:112) at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:66) at org.candlepin.pinsetter.tasks.MigrateOwnerJob.replicateConsumers(MigrateOwnerJob.java:308) at org.candlepin.pinsetter.tasks.MigrateOwnerJob.execute(MigrateOwnerJob.java:156) at org.candlepin.pinsetter.core.TransactionalPinsetterJob.execute(TransactionalPinsetterJob.java:50) at org.quartz.core.JobRunShell.run(Unknown Source) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(Unknown Source) Nov 28 17:44:44 [ITClusteredScheduler_Worker-2] ERROR org.quartz.core.ErrorLogger - Job (async group.migrate_owner_f7a2cf4c-b8a3-4ad4-9d19-ca420dd7ac14 threw an exception. org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.NullPointerException] at org.quartz.core.JobRunShell.run(Unknown Source) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(Unknown Source) Caused by: java.lang.NullPointerException at org.candlepin.model.ConsumerCurator.replicate(ConsumerCurator.java:112) at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:66) at org.candlepin.pinsetter.tasks.MigrateOwnerJob.replicateConsumers(MigrateOwnerJob.java:308) at org.candlepin.pinsetter.tasks.MigrateOwnerJob.execute(MigrateOwnerJob.java:156) at org.candlepin.pinsetter.core.TransactionalPinsetterJob.execute(TransactionalPinsetterJob.java:50) ... 2 more That's bad. Line 112 is this:
this.currentSession().replicate(idCert.getSerial(),
ReplicationMode.EXCEPTION);
That means either the currentSession is null (unlikely) or the idCert is null. Which also means we have a Consumer with no identity certificate. Since idCert is assigned on line 111 above:
IdentityCertificate idCert = consumer.getIdCert();
(In reply to comment #4)
> Deployed candlepin 0.7.13.4 in dev environment. Migrations still fail but
> with new location. Exception is below.
>
> Nov 28 17:44:44 [ITClusteredScheduler_Worker-2] ERROR
> org.quartz.core.JobRunShell - Job async
> group.migrate_owner_f7a2cf4c-b8a3-4ad4-9d19-ca420dd7ac14 threw an unhandled
> Exception:
> java.lang.NullPointerException
> at org.candlepin.model.ConsumerCurator.replicate(ConsumerCurator.java:112)
> at
> com.google.inject.persist.jpa.JpaLocalTxnInterceptor.
> invoke(JpaLocalTxnInterceptor.java:66)
> at
> org.candlepin.pinsetter.tasks.MigrateOwnerJob.
> replicateConsumers(MigrateOwnerJob.java:308)
> at
> org.candlepin.pinsetter.tasks.MigrateOwnerJob.execute(MigrateOwnerJob.java:
> 156)
> at
> org.candlepin.pinsetter.core.TransactionalPinsetterJob.
> execute(TransactionalPinsetterJob.java:50)
> at org.quartz.core.JobRunShell.run(Unknown Source)
> at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(Unknown Source)
> Nov 28 17:44:44 [ITClusteredScheduler_Worker-2] ERROR
> org.quartz.core.ErrorLogger - Job (async
> group.migrate_owner_f7a2cf4c-b8a3-4ad4-9d19-ca420dd7ac14 threw an exception.
> org.quartz.SchedulerException: Job threw an unhandled exception. [See nested
> exception: java.lang.NullPointerException]
> at org.quartz.core.JobRunShell.run(Unknown Source)
> at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(Unknown Source)
> Caused by: java.lang.NullPointerException
> at org.candlepin.model.ConsumerCurator.replicate(ConsumerCurator.java:112)
> at
> com.google.inject.persist.jpa.JpaLocalTxnInterceptor.
> invoke(JpaLocalTxnInterceptor.java:66)
> at
> org.candlepin.pinsetter.tasks.MigrateOwnerJob.
> replicateConsumers(MigrateOwnerJob.java:308)
> at
> org.candlepin.pinsetter.tasks.MigrateOwnerJob.execute(MigrateOwnerJob.java:
> 156)
> at
> org.candlepin.pinsetter.core.TransactionalPinsetterJob.
> execute(TransactionalPinsetterJob.java:50)
> ... 2 more
Closing this out. The code was deliverded 0.7.13, and future versions have removed it. If you are still seeing issues.. please feel free to re-open this bug. |