Bug 478166 - MIGRATED_FROM_JIRA: Search fails due to Nullpointer
MIGRATED_FROM_JIRA: Search fails due to Nullpointer
Status: MODIFIED
Product: penrose
Classification: Retired
Component: Engine (Show other bugs)
2.0
All Linux
low Severity low
: ---
: ---
Assigned To: Endi Sukma Dewata
Ben Levenson
:
Depends On:
Blocks: 471500
  Show dependency treegraph
 
Reported: 2008-12-27 03:05 EST by Chandrasekar Kannan
Modified: 2018-02-07 15:48 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Chandrasekar Kannan 2008-12-27 03:05:21 EST
Running a ldap search. Works fine if I do "uid=xxx,ou=Users" and no filter, but if I change it to search "ou=Users" with filter "uid=xxx" we die.

The exception is: 
[10/30/2006 15:45:16] Returning entry uid=jstockton1,ou=Users,dc=JDBC,dc=Example,dc=com
[10/30/2006 15:45:16] Requested: [cn, ref]
[10/30/2006 15:45:16] Returned: [objectclass, uid, userpassword, sn, cn]
[10/30/2006 15:45:16] Checking readable attributes
[10/30/2006 15:45:16] Root user => SUCCESS
[10/30/2006 15:45:16] Granted: [sn, cn, objectclass, userpassword, uid]
[10/30/2006 15:45:16] Denied: []
[10/30/2006 15:45:16] Remove unrequested attribute objectclass
[10/30/2006 15:45:16] Remove unrequested attribute uid
[10/30/2006 15:45:16] Remove unrequested attribute userpassword
[10/30/2006 15:45:16] Remove unrequested attribute sn
[10/30/2006 15:45:16] Keep requested attribute cn
[10/30/2006 15:45:16] Returning "uid=jstockton1,ou=Users,dc=JDBC,dc=Example,dc=com" to client.
[10/30/2006 15:45:16] Row: {encPassword=[2228772fc7ec8246dd4f804827ba3b269a0b0d2c], firstName=[Jim], lastName=[Stockton], primaryKey.username=[jstockton1], username=[jstockton1]}
[10/30/2006 15:45:16] Creating batches of entries.
[10/30/2006 15:45:16] Loading batches.
[10/30/2006 15:45:16] Loading data for uid=...,ou=Users,dc=JDBC,dc=Example,dc=com.
[10/30/2006 15:45:16] +------------------------------------------------------------------------------+
[10/30/2006 15:45:16] | EXPAND MAPPING                                                               |
[10/30/2006 15:45:16] | Return code: 0                                                               |
[10/30/2006 15:45:16] +------------------------------------------------------------------------------+
[10/30/2006 15:45:16] RC: 0
[10/30/2006 15:45:16] Searching children of uid=...,ou=Users,dc=JDBC,dc=Example,dc=com
[10/30/2006 15:45:16] Generating attributes with source values:
[10/30/2006 15:45:16]
java.lang.NullPointerException
        at org.safehaus.penrose.engine.Engine.computeAttributeValues(Engine.java:178)
        at org.safehaus.penrose.engine.Engine.computeAttributeValues(Engine.java:158)
        at org.safehaus.penrose.engine.Engine.computeAttributeValues(Engine.java:149)
        at org.safehaus.penrose.handler.SearchHandler.searchChildren(SearchHandler.java:249)
        at org.safehaus.penrose.handler.SearchHandler.search(SearchHandler.java:157)
        at org.safehaus.penrose.handler.Handler.searchInBackground(Handler.java:697)
        at org.safehaus.penrose.handler.Handler$1.run(Handler.java:561)
        at org.safehaus.penrose.thread.ThreadWorker.runIt(ThreadWorker.java:94)
        at org.safehaus.penrose.thread.ThreadWorker.runJobs(ThreadWorker.java:85)
        at org.safehaus.penrose.thread.ThreadWorker.access$000(ThreadWorker.java:23)
        at org.safehaus.penrose.thread.ThreadWorker$1.run(ThreadWorker.java:48)
        at java.lang.Thread.run(Thread.java:595)


It is obvious why this error is happening. The stack trace shows it clearly. ComputeAttributeValues at line 149 calls computeAttributeValues, passing through NULL for sourceAttributes. The next call passes it to, and then tries to use it. Of course if its NULL its going to blow. Need a check at ln 177 to see whether its null. If it is return.
Additional Comments From endisd dated Sun Oct 29 21:21:16 CST 2006 
Hi Paul,

This problem has been fixed in Penrose Server 1.1.1 that we just released recently. You can also install the patch for Penrose 1.1 to fix this problem. The patch is available here:
http://docs.safehaus.org/display/PENROSE/Penrose+1.1+Release

Endi


=========================================================
Issue dump from jira
$VAR1 = {
          'priority' => '4',
          'customFieldValues' => [],
          'project' => 'PENROSE',
          'status' => '5',
          'components' => [
                            {
                              'name' => 'Engine',
                              'id' => '10009'
                            }
                          ],
          'reporter' => 'pedwards',
          'key' => 'PENROSE-189',
          'assignee' => 'endisd',
          'summary' => 'Search fails due to Nullpointer',
          'id' => '10546',
          'updated' => '2006-10-30 23:17:18.0',
          'votes' => '0',
          'fixVersions' => [],
          'description' => 'Running a ldap search. Works fine if I do "uid=xxx,ou=Users" and no filter, but if I change it to search "ou=Users" with filter "uid=xxx" we die.

The exception is: 
[10/30/2006 15:45:16] Returning entry uid=jstockton1,ou=Users,dc=JDBC,dc=Example,dc=com
[10/30/2006 15:45:16] Requested: [cn, ref]
[10/30/2006 15:45:16] Returned: [objectclass, uid, userpassword, sn, cn]
[10/30/2006 15:45:16] Checking readable attributes
[10/30/2006 15:45:16] Root user => SUCCESS
[10/30/2006 15:45:16] Granted: [sn, cn, objectclass, userpassword, uid]
[10/30/2006 15:45:16] Denied: []
[10/30/2006 15:45:16] Remove unrequested attribute objectclass
[10/30/2006 15:45:16] Remove unrequested attribute uid
[10/30/2006 15:45:16] Remove unrequested attribute userpassword
[10/30/2006 15:45:16] Remove unrequested attribute sn
[10/30/2006 15:45:16] Keep requested attribute cn
[10/30/2006 15:45:16] Returning "uid=jstockton1,ou=Users,dc=JDBC,dc=Example,dc=com" to client.
[10/30/2006 15:45:16] Row: {encPassword=[2228772fc7ec8246dd4f804827ba3b269a0b0d2c], firstName=[Jim], lastName=[Stockton], primaryKey.username=[jstockton1], username=[jstockton1]}
[10/30/2006 15:45:16] Creating batches of entries.
[10/30/2006 15:45:16] Loading batches.
[10/30/2006 15:45:16] Loading data for uid=...,ou=Users,dc=JDBC,dc=Example,dc=com.
[10/30/2006 15:45:16] +------------------------------------------------------------------------------+
[10/30/2006 15:45:16] | EXPAND MAPPING                                                               |
[10/30/2006 15:45:16] | Return code: 0                                                               |
[10/30/2006 15:45:16] +------------------------------------------------------------------------------+
[10/30/2006 15:45:16] RC: 0
[10/30/2006 15:45:16] Searching children of uid=...,ou=Users,dc=JDBC,dc=Example,dc=com
[10/30/2006 15:45:16] Generating attributes with source values:
[10/30/2006 15:45:16]
java.lang.NullPointerException
        at org.safehaus.penrose.engine.Engine.computeAttributeValues(Engine.java:178)
        at org.safehaus.penrose.engine.Engine.computeAttributeValues(Engine.java:158)
        at org.safehaus.penrose.engine.Engine.computeAttributeValues(Engine.java:149)
        at org.safehaus.penrose.handler.SearchHandler.searchChildren(SearchHandler.java:249)
        at org.safehaus.penrose.handler.SearchHandler.search(SearchHandler.java:157)
        at org.safehaus.penrose.handler.Handler.searchInBackground(Handler.java:697)
        at org.safehaus.penrose.handler.Handler$1.run(Handler.java:561)
        at org.safehaus.penrose.thread.ThreadWorker.runIt(ThreadWorker.java:94)
        at org.safehaus.penrose.thread.ThreadWorker.runJobs(ThreadWorker.java:85)
        at org.safehaus.penrose.thread.ThreadWorker.access$000(ThreadWorker.java:23)
        at org.safehaus.penrose.thread.ThreadWorker$1.run(ThreadWorker.java:48)
        at java.lang.Thread.run(Thread.java:595)


It is obvious why this error is happening. The stack trace shows it clearly. ComputeAttributeValues at line 149 calls computeAttributeValues, passing through NULL for sourceAttributes. The next call passes it to, and then tries to use it. Of course if its NULL its going to blow. Need a check at ln 177 to see whether its null. If it is return.',
          'affectsVersions' => [
                               {
                                 'releaseDate' => '2006-09-18 00:00:00.0',
                                 'sequence' => '18',
                                 'name' => 'Penrose-1.1',
                                 'released' => 'true',
                                 'id' => '10037',
                                 'archived' => 'false'
                               }
                             ],
          'created' => '2006-10-29 21:07:51.0',
          'environment' => 'Linux - Unbuntu',
          'resolution' => '1',
          'type' => '1'
        };


=========================================================
Comment 1 Chandrasekar Kannan 2008-12-27 03:05:24 EST
Marking bug as MODIFIED as it was already resolved in Jira - PENROSE-189

Note You need to log in before you can comment on or make changes to this bug.