You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@directory.apache.org by Maxim Solodovnik <so...@gmail.com> on 2017/03/24 15:26:29 UTC

The length of controls must not be null

Hello All,

We are using directory API 1.0.0-RC2 to perform LDAP queries
One of our users uses Samba 4.0.0alpha10 as LDAP server
And report he got weird stacktrace (sorry for the huge hex dump):

Maybe you can say what is wrong based on this dump?

The original report is in Russian, I can provide the link to it if you like
to

Thanks in advance for the help!

[ERROR] [NioProcessor-66] org.apache.directory.api.ldap.
codec.actions.controls.InitControls - The length of controls must not be
null
 WARN 03-24 10:54:10.115 LdapNetworkConnection.java 68766033 1912
org.apache.directory.ldap.client.api.LdapNetworkConnection
[NioProcessor-66] -
org.apache.directory.api.ldap.codec.api.ResponseCarryingException:
The length of controls must not be null (Hexdump: 20 00 20 00 20 00 20 00
20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 50 00 06 00 1A 00 08 00 01
00 43 00 74 00 78 00 43 00 66 00 67 00 50 00 72 00 65 00 73 00 65 00 6E 00
74 00 35 35 31 65 30 62 62 30 18 00 08 00 01 00 43 00 74 00 78 00 43 00 66
00 67 00 46 00 6C 00 61 00 67 00 73 00 31 00 30 30 66 30 65 30 65 37 12 00
08 00 01 00 43 00 74 00 78 00 53 00 68 00 61 00 64 00 6F 00 77 00 30 32 30
30 30 30 30 30 2A 00 02 00 01 00 43 00 74 00 78 00 4D 00 69 00 6E 00 45 00
6E 00 63 00 72 00 79 00 70 00 74 00 69 00 6F 00 6E 00 4C 00 65 00 76 00 65
00 6C 00 30 31 20 00 54 00 01 00 43 00 74 00 78 00 57 00 6F 00 72 00 6B 00
44 00 69 00 72 00 65 00 63 00 74 00 6F 00 72 00 79 00 34 33 33 61 35 63 35
30 37 32 36 66 36 37 37 32 36 31 36 64 32 30 34 36 36 39 36 63 36 35 37 33
32 30 32 38 37 38 33 38 33 36 32 39 35 63 34 62 36 35 37 39 34 33 36 66 36
63 36 63 36 35 36 33 37 34 36 66 37 32 35 37 35 30 34 36 34 38 34 34 34 34
30 30 22 00 7C 00 01 00 43 00 74 00 78 00 49 00 6E 00 69 00 74 00 69 00 61
00 6C 00 50 00 72 00 6F 00 67 00 72 00 61 00 6D 00 34 33 33 61 35 63 35 30
37 32 36 66 36 37 37 32 36 31 36 64 32 30 34 36 36 39 36 63 36 35 37 33 32
30 32 38 37 38 33 38 33 36 32 39 35 63 34 62 36 35 37 39 34 33 36 66 36 63
36 63 36 35 36 33 37 34 36 66 37 32 35 37 35 30 34 36 34 38 34 34 34 34 35
63 34 62 36 35 37 39 34 33 36 66 36 63 36 63 36 35 36 33 37 34 36 66 37 32
35 37 35 30 34 36 32 65 36 35 37 38 36 35 30 30 22 0A 41 00 00 00 00 00 00
00 00 00 00 00 70 B3 76 0A 00 00 00 00 00 00 00 00 00 00 00 00 28 FF 83 08
08 00 00 00 70 0C 15 E8 00 00 00 00 78 B4 2E 0A 00 00 00 00 6B 65 79 63 6F
6C 6C 00 00 00 00 00 41 00 00 00 70 B3 76 0A A8 9B C8 0A 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 98 9B C8 0A 0A 00 00 00 70 0C 15 E8 00 00 00
00 D0 98 C8 0A 00 00 00 00 67 69 76 65 6E 4E 61 6D 65 00 79 08 41 00 00 00
68 9B C8 0A 28 9C C8 0A 00 00 00 00 E8 9B C8 0A 00 00 00 00 00 00 00 00 8D
A0 7E 08 08 00 00 00 70 0C 15 E8 00 00 00 00 00 00 00 00 00 00 00 00 18 9C
C8 0A 07 00 00 00 73 0C 15 E8 41 00 00 00 00 00 00 00 00 00 00 00 A8 9B C8
0A 00 00 00 00 00 00 00 00 00 00 00 00 28 FF 83 08 08 00 00 00 70 0C 15 E8
00 00 00 00 F8 19 79 08 01 00 00 00 6B 65 79 63 6F 6C 6C 00 61 63 6B 22 49
00 00 00 A8 9B C8 0A 70 9C C8 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 58 9C C8 0A 0D 00 00 00 70 0C 15 E8 00 00 00 00 73 0C 15 E8 00 00 00
00 69 6E 73 74 61 6E 63 65 54 79 70 65 00 00 00 00 98 9A B4 0A 41 00 00 00
28 9C C8 0A A8 EB 1D 0A 00 00 00 00 B0 9C C8 0A 00 00 00 00 00 00 00 00 8D
A0 7E 08 08 00 00 00 70 0C 15 E8 00 00 00 00 5C 70 69 70 65 5C 73 70 E0 9C
C8 0A 01 00 00 00 00 00 00 00 39 00 00 00 00 00 00 00 00 00 00 00 70 9C C8
0A 00 00 00 00 00 00 00 00 00 00 00 00 28 FF 83 08 02 00 00 00 70 0C 15 E8
00 00 00 00 73 0C 15 E8 00 00 00 00 34 00 15 E8 19 00 00 00 80 98 C8 0A 78
C3 9B 0A 80 9D 08 0A 94 47 8E 08 18 00 00 00 18 00 00 00 00 00 00 00 AC 6B
0C 0A B4 6B 0C 0A 10 AD CE 0A A4 72 00 00 19 00 00 00 43 4F 4D 50 41 4E 59
2E 4C 4F 43 41 4C 00 20 20 2B 1C F2 E8 41 00 00 00 00 00 00 00 00 00 00 00
D8 86 0C 0A 00 00 00 00 00 00 00 00 30 2B 04 0E 6D 73 54 53 4D 61 6E 61 67
69 6E 67 4C 53 31 19 04 17 30 30 34 37 37 2D 30 30 31 2D 39 36 38 30 33 33
36 2D 38 34 37 36 38 30 1E 04 12 6D 73 54 53 4C 69 63 65 6E 73 65 56 65 72
73 69 6F 6E 31 08 04 06 33 39 33 32 31 36 30 27 04 0E 6D 73 54 53 45 78 70
69 72 65 44 61 74 65 31 15 04 13 32 30 31 37 30 35 30 36 30 36 30 33 32 30
2E 30 30 30 5A 30 22 04 0B 77 68 65 6E 43 68 61 6E 67 65 64 31 13 04 11 32
30 31 37 30 33 30 37 30 36 30 33 32 31 2E 30 5A 30 17 04 0A 75 53 4E 43 68
61 6E 67 65 64 31 09 04 07 31 34 30 39 31 30 38 30 4B 04 11 64 69 73 74 69
6E 67 75 69 73 68 65 64 4E 61 6D 65 31 36 04 34 43 4E 3D 6B 65 79 63 6F 6C
6C 2C 4F 55 3D 53 65 72 76 69 63 65 2C 4F 55 3D 48 6F 6C 64 69 6E 67 2C 44
43 3D 63 6F 6D 70 61 6E 79 2C 44 43 3D 6C 6F 63 61 6C 30 0E 02 01 03 65 07
0A 01 00 04 00 04 00 A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00)
org.apache.mina.filter.codec.ProtocolDecoderException:
org.apache.directory.api.ldap.codec.api.ResponseCarryingException: The
length of controls must not be null (Hexdump: 20 00 20 00 20 00 20 00 20 00
20 00 20 00 20 00 20 00 20 00 20 00 20 00 50 00 06 00 1A 00 08 00 01 00 43
00 74 00 78 00 43 00 66 00 67 00 50 00 72 00 65 00 73 00 65 00 6E 00 74 00
35 35 31 65 30 62 62 30 18 00 08 00 01 00 43 00 74 00 78 00 43 00 66 00 67
00 46 00 6C 00 61 00 67 00 73 00 31 00 30 30 66 30 65 30 65 37 12 00 08 00
01 00 43 00 74 00 78 00 53 00 68 00 61 00 64 00 6F 00 77 00 30 32 30 30 30
30 30 30 2A 00 02 00 01 00 43 00 74 00 78 00 4D 00 69 00 6E 00 45 00 6E 00
63 00 72 00 79 00 70 00 74 00 69 00 6F 00 6E 00 4C 00 65 00 76 00 65 00 6C
00 30 31 20 00 54 00 01 00 43 00 74 00 78 00 57 00 6F 00 72 00 6B 00 44 00
69 00 72 00 65 00 63 00 74 00 6F 00 72 00 79 00 34 33 33 61 35 63 35 30 37
32 36 66 36 37 37 32 36 31 36 64 32 30 34 36 36 39 36 63 36 35 37 33 32 30
32 38 37 38 33 38 33 36 32 39 35 63 34 62 36 35 37 39 34 33 36 66 36 63 36
63 36 35 36 33 37 34 36 66 37 32 35 37 35 30 34 36 34 38 34 34 34 34 30 30
22 00 7C 00 01 00 43 00 74 00 78 00 49 00 6E 00 69 00 74 00 69 00 61 00 6C
00 50 00 72 00 6F 00 67 00 72 00 61 00 6D 00 34 33 33 61 35 63 35 30 37 32
36 66 36 37 37 32 36 31 36 64 32 30 34 36 36 39 36 63 36 35 37 33 32 30 32
38 37 38 33 38 33 36 32 39 35 63 34 62 36 35 37 39 34 33 36 66 36 63 36 63
36 35 36 33 37 34 36 66 37 32 35 37 35 30 34 36 34 38 34 34 34 34 35 63 34
62 36 35 37 39 34 33 36 66 36 63 36 63 36 35 36 33 37 34 36 66 37 32 35 37
35 30 34 36 32 65 36 35 37 38 36 35 30 30 22 0A 41 00 00 00 00 00 00 00 00
00 00 00 70 B3 76 0A 00 00 00 00 00 00 00 00 00 00 00 00 28 FF 83 08 08 00
00 00 70 0C 15 E8 00 00 00 00 78 B4 2E 0A 00 00 00 00 6B 65 79 63 6F 6C 6C
00 00 00 00 00 41 00 00 00 70 B3 76 0A A8 9B C8 0A 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 98 9B C8 0A 0A 00 00 00 70 0C 15 E8 00 00 00 00 D0
98 C8 0A 00 00 00 00 67 69 76 65 6E 4E 61 6D 65 00 79 08 41 00 00 00 68 9B
C8 0A 28 9C C8 0A 00 00 00 00 E8 9B C8 0A 00 00 00 00 00 00 00 00 8D A0 7E
08 08 00 00 00 70 0C 15 E8 00 00 00 00 00 00 00 00 00 00 00 00 18 9C C8 0A
07 00 00 00 73 0C 15 E8 41 00 00 00 00 00 00 00 00 00 00 00 A8 9B C8 0A 00
00 00 00 00 00 00 00 00 00 00 00 28 FF 83 08 08 00 00 00 70 0C 15 E8 00 00
00 00 F8 19 79 08 01 00 00 00 6B 65 79 63 6F 6C 6C 00 61 63 6B 22 49 00 00
00 A8 9B C8 0A 70 9C C8 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
58 9C C8 0A 0D 00 00 00 70 0C 15 E8 00 00 00 00 73 0C 15 E8 00 00 00 00 69
6E 73 74 61 6E 63 65 54 79 70 65 00 00 00 00 98 9A B4 0A 41 00 00 00 28 9C
C8 0A A8 EB 1D 0A 00 00 00 00 B0 9C C8 0A 00 00 00 00 00 00 00 00 8D A0 7E
08 08 00 00 00 70 0C 15 E8 00 00 00 00 5C 70 69 70 65 5C 73 70 E0 9C C8 0A
01 00 00 00 00 00 00 00 39 00 00 00 00 00 00 00 00 00 00 00 70 9C C8 0A 00
00 00 00 00 00 00 00 00 00 00 00 28 FF 83 08 02 00 00 00 70 0C 15 E8 00 00
00 00 73 0C 15 E8 00 00 00 00 34 00 15 E8 19 00 00 00 80 98 C8 0A 78 C3 9B
0A 80 9D 08 0A 94 47 8E 08 18 00 00 00 18 00 00 00 00 00 00 00 AC 6B 0C 0A
B4 6B 0C 0A 10 AD CE 0A A4 72 00 00 19 00 00 00 43 4F 4D 50 41 4E 59 2E 4C
4F 43 41 4C 00 20 20 2B 1C F2 E8 41 00 00 00 00 00 00 00 00 00 00 00 D8 86
0C 0A 00 00 00 00 00 00 00 00 30 2B 04 0E 6D 73 54 53 4D 61 6E 61 67 69 6E
67 4C 53 31 19 04 17 30 30 34 37 37 2D 30 30 31 2D 39 36 38 30 33 33 36 2D
38 34 37 36 38 30 1E 04 12 6D 73 54 53 4C 69 63 65 6E 73 65 56 65 72 73 69
6F 6E 31 08 04 06 33 39 33 32 31 36 30 27 04 0E 6D 73 54 53 45 78 70 69 72
65 44 61 74 65 31 15 04 13 32 30 31 37 30 35 30 36 30 36 30 33 32 30 2E 30
30 30 5A 30 22 04 0B 77 68 65 6E 43 68 61 6E 67 65 64 31 13 04 11 32 30 31
37 30 33 30 37 30 36 30 33 32 31 2E 30 5A 30 17 04 0A 75 53 4E 43 68 61 6E
67 65 64 31 09 04 07 31 34 30 39 31 30 38 30 4B 04 11 64 69 73 74 69 6E 67
75 69 73 68 65 64 4E 61 6D 65 31 36 04 34 43 4E 3D 6B 65 79 63 6F 6C 6C 2C
4F 55 3D 53 65 72 76 69 63 65 2C 4F 55 3D 48 6F 6C 64 69 6E 67 2C 44 43 3D
63 6F 6D 70 61 6E 79 2C 44 43 3D 6C 6F 63 61 6C 30 0E 02 01 03 65 07 0A 01
00 04 00 04 00 A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00)
        at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(
ProtocolCodecFilter.java:240)
        at org.apache.mina.core.filterchain.DefaultIoFilterChain.
callNextMessageReceived(DefaultIoFilterChain.java:542)
        at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$
1300(DefaultIoFilterChain.java:48)
        at org.apache.mina.core.filterchain.DefaultIoFilterChain$
EntryImpl$1.messageReceived(DefaultIoFilterChain.java:947)
        at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(
IoFilterAdapter.java:109)
        at org.apache.mina.core.filterchain.DefaultIoFilterChain.
callNextMessageReceived(DefaultIoFilterChain.java:542)
        at org.apache.mina.core.filterchain.DefaultIoFilterChain.
fireMessageReceived(DefaultIoFilterChain.java:535)
        at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(
AbstractPollingIoProcessor.java:703)
        at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(
AbstractPollingIoProcessor.java:659)
        at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(
AbstractPollingIoProcessor.java:648)
        at org.apache.mina.core.polling.AbstractPollingIoProcessor.
access$600(AbstractPollingIoProcessor.java:68)
        at org.apache.mina.core.polling.AbstractPollingIoProcessor$
Processor.run(AbstractPollingIoProcessor.java:1120)
        at org.apache.mina.util.NamePreservingRunnable.run(
NamePreservingRunnable.java:64)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(
ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(
ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.directory.api.ldap.codec.api.ResponseCarryingException:
The length of controls must not be null
        at org.apache.directory.api.ldap.codec.protocol.mina.
LdapProtocolDecoder.decode(LdapProtocolDecoder.java:176)
        at org.apache.directory.api.ldap.codec.protocol.mina.
LdapProtocolDecoder.decode(LdapProtocolDecoder.java:92)
        at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(
ProtocolCodecFilter.java:231)
        ... 15 common frames omitted
Caused by: org.apache.directory.api.asn1.DecoderException: The length of
controls must not be null
        at org.apache.directory.api.ldap.codec.actions.controls.
InitControls.action(InitControls.java:73)
        at org.apache.directory.api.ldap.codec.actions.controls.
InitControls.action(InitControls.java:41)
        at org.apache.directory.api.asn1.ber.grammar.AbstractGrammar.
executeAction(AbstractGrammar.java:136)
        at org.apache.directory.api.asn1.ber.Asn1Decoder.
treatTLVDoneState(Asn1Decoder.java:600)
        at org.apache.directory.api.asn1.ber.Asn1Decoder.decode(
Asn1Decoder.java:736)
        at org.apache.directory.api.ldap.codec.protocol.mina.
LdapProtocolDecoder.decode(LdapProtocolDecoder.java:143)
        ... 17 common frames omitted
ERROR 03-24 10:54:10.122 LdapLoginManagement.java 68766040 336
org.apache.openmeetings.core.ldap.LdapLoginManagement
[http-nio-0.0.0.0-5080-exec-4] - LDAP entry is null, search or lookup by Dn
failed


-- 
WBR
Maxim aka solomax

Re: The length of controls must not be null

Posted by Maxim Solodovnik <so...@gmail.com>.
The issue is created: https://issues.apache.org/jira/browse/DIRAPI-295

On Mon, Apr 3, 2017 at 10:07 PM, Maxim Solodovnik <so...@gmail.com> wrote:
> Sure
>
> Thanks a lot for the investigation!
>
> On Mon, Apr 3, 2017 at 9:58 PM, Emmanuel Lécharny <el...@gmail.com> wrote:
>>
>>
>> Le 03/04/2017 à 14:22, Maxim Solodovnik a écrit :
>>> Yes,
>>> Search for the user from OM (via directory API) fails with
>>> "DecoderException: The length of controls must not be null"
>>> (The full stack trace is in the first message of this thread)
>>
>>
>>
>> Sorry that it took me so understand what was going on. The stack trace
>> is clear a control should not be null. We do have a null control in the
>> SearcResultDone :
>>
>> 0000   30 0e 02 01 02 65 07 0a 01 00 04 00 04 00 a0 00
>>
>> which is :
>>
>> 30 0e             LdapMessage
>>   02 01 02        Message ID : 02
>>   65 07           ProtocolOp : SearchResultDone
>>     0a 01 00      LDAPResult.resultCode  : LDAP_SUCCESS
>>     04 00         LDAPResult.matchedDN : ""
>>     04 00         LDAPResult.errorMessage : ""
>>     a0 00         Controls : empty
>>
>>
>> Going back to RFC 4511 :
>>
>> LDAPMessage ::= SEQUENCE {
>>              messageID       MessageID,
>>              protocolOp      CHOICE {
>>                   ...
>>                   searchResDone         SearchResultDone,
>>                   ...,
>>                   intermediateResponse  IntermediateResponse },
>>              controls       [0] Controls OPTIONAL }
>>
>> We may have no controls, as it's optional. In this case, the 0xA0 ...
>> part at the end will simply not exist. Let's see what is Controls
>> structure :
>>
>> Controls ::= SEQUENCE OF control Control
>>
>>
>> Here, if the SEQUENCE is empty, the encoded bytes for the length wll be
>> 0x00, so we will have 0xA0 0x00.
>>
>> The Controls code in the API is :
>>
>>     public void action( LdapMessageContainer<MessageDecorator<? extends
>> Message>> container ) throws DecoderException
>>     {
>>         TLV tlv = container.getCurrentTLV();
>>         int expectedLength = tlv.getLength();
>>
>>         // The Length should be null
>>         if ( expectedLength == 0 )
>>         {
>>             LOG.error( "The length of controls must not be null" );
>>
>>             // This will generate a PROTOCOL_ERROR
>>             throw new DecoderException( "The length of controls must not
>> be null" );
>>         }
>>
>>         if ( IS_DEBUG )
>>         {
>>             LOG.debug( "A new list of controls has been initialized" );
>>         }
>>     }
>>
>>
>> As you can see, there are two errors :
>> - the comment is wrong and should read : "The Length should *not* be null
>> - the length could actually be null
>>
>> Bottom line, this is a bug that need to be fixed, and I'll do that ASAP.
>>
>> May I ask you to filla  JIRA with your first mail ad the stack trace for
>> clarity ?
>>
>> Thanks !
>>
>> --
>> Emmanuel Lecharny
>>
>> Symas.com
>> directory.apache.org
>>
>
>
>
> --
> WBR
> Maxim aka solomax



-- 
WBR
Maxim aka solomax

Re: The length of controls must not be null

Posted by Maxim Solodovnik <so...@gmail.com>.
Sure

Thanks a lot for the investigation!

On Mon, Apr 3, 2017 at 9:58 PM, Emmanuel Lécharny <el...@gmail.com> wrote:
>
>
> Le 03/04/2017 à 14:22, Maxim Solodovnik a écrit :
>> Yes,
>> Search for the user from OM (via directory API) fails with
>> "DecoderException: The length of controls must not be null"
>> (The full stack trace is in the first message of this thread)
>
>
>
> Sorry that it took me so understand what was going on. The stack trace
> is clear a control should not be null. We do have a null control in the
> SearcResultDone :
>
> 0000   30 0e 02 01 02 65 07 0a 01 00 04 00 04 00 a0 00
>
> which is :
>
> 30 0e             LdapMessage
>   02 01 02        Message ID : 02
>   65 07           ProtocolOp : SearchResultDone
>     0a 01 00      LDAPResult.resultCode  : LDAP_SUCCESS
>     04 00         LDAPResult.matchedDN : ""
>     04 00         LDAPResult.errorMessage : ""
>     a0 00         Controls : empty
>
>
> Going back to RFC 4511 :
>
> LDAPMessage ::= SEQUENCE {
>              messageID       MessageID,
>              protocolOp      CHOICE {
>                   ...
>                   searchResDone         SearchResultDone,
>                   ...,
>                   intermediateResponse  IntermediateResponse },
>              controls       [0] Controls OPTIONAL }
>
> We may have no controls, as it's optional. In this case, the 0xA0 ...
> part at the end will simply not exist. Let's see what is Controls
> structure :
>
> Controls ::= SEQUENCE OF control Control
>
>
> Here, if the SEQUENCE is empty, the encoded bytes for the length wll be
> 0x00, so we will have 0xA0 0x00.
>
> The Controls code in the API is :
>
>     public void action( LdapMessageContainer<MessageDecorator<? extends
> Message>> container ) throws DecoderException
>     {
>         TLV tlv = container.getCurrentTLV();
>         int expectedLength = tlv.getLength();
>
>         // The Length should be null
>         if ( expectedLength == 0 )
>         {
>             LOG.error( "The length of controls must not be null" );
>
>             // This will generate a PROTOCOL_ERROR
>             throw new DecoderException( "The length of controls must not
> be null" );
>         }
>
>         if ( IS_DEBUG )
>         {
>             LOG.debug( "A new list of controls has been initialized" );
>         }
>     }
>
>
> As you can see, there are two errors :
> - the comment is wrong and should read : "The Length should *not* be null
> - the length could actually be null
>
> Bottom line, this is a bug that need to be fixed, and I'll do that ASAP.
>
> May I ask you to filla  JIRA with your first mail ad the stack trace for
> clarity ?
>
> Thanks !
>
> --
> Emmanuel Lecharny
>
> Symas.com
> directory.apache.org
>



-- 
WBR
Maxim aka solomax

Re: The length of controls must not be null

Posted by Emmanuel Lécharny <el...@gmail.com>.

Le 03/04/2017 à 14:22, Maxim Solodovnik a écrit :
> Yes,
> Search for the user from OM (via directory API) fails with
> "DecoderException: The length of controls must not be null"
> (The full stack trace is in the first message of this thread)



Sorry that it took me so understand what was going on. The stack trace
is clear a control should not be null. We do have a null control in the
SearcResultDone :

0000   30 0e 02 01 02 65 07 0a 01 00 04 00 04 00 a0 00

which is :

30 0e             LdapMessage
  02 01 02        Message ID : 02
  65 07           ProtocolOp : SearchResultDone
    0a 01 00      LDAPResult.resultCode  : LDAP_SUCCESS
    04 00         LDAPResult.matchedDN : ""
    04 00         LDAPResult.errorMessage : ""
    a0 00         Controls : empty


Going back to RFC 4511 :

LDAPMessage ::= SEQUENCE {
             messageID       MessageID,
             protocolOp      CHOICE {
                  ...
                  searchResDone         SearchResultDone,
                  ...,
                  intermediateResponse  IntermediateResponse },
             controls       [0] Controls OPTIONAL }

We may have no controls, as it's optional. In this case, the 0xA0 ...
part at the end will simply not exist. Let's see what is Controls
structure :

Controls ::= SEQUENCE OF control Control


Here, if the SEQUENCE is empty, the encoded bytes for the length wll be
0x00, so we will have 0xA0 0x00.

The Controls code in the API is :

    public void action( LdapMessageContainer<MessageDecorator<? extends
Message>> container ) throws DecoderException
    {
        TLV tlv = container.getCurrentTLV();
        int expectedLength = tlv.getLength();

        // The Length should be null
        if ( expectedLength == 0 )
        {
            LOG.error( "The length of controls must not be null" );

            // This will generate a PROTOCOL_ERROR
            throw new DecoderException( "The length of controls must not
be null" );
        }

        if ( IS_DEBUG )
        {
            LOG.debug( "A new list of controls has been initialized" );
        }
    }


As you can see, there are two errors :
- the comment is wrong and should read : "The Length should *not* be null
- the length could actually be null

Bottom line, this is a bug that need to be fixed, and I'll do that ASAP.

May I ask you to filla  JIRA with your first mail ad the stack trace for
clarity ?

Thanks !

-- 
Emmanuel Lecharny

Symas.com
directory.apache.org


Re: The length of controls must not be null

Posted by Maxim Solodovnik <so...@gmail.com>.
Yes,
Search for the user from OM (via directory API) fails with
"DecoderException: The length of controls must not be null"
(The full stack trace is in the first message of this thread)

On Mon, Apr 3, 2017 at 7:19 PM, Emmanuel Lécharny <el...@gmail.com> wrote:
> Hi Maxim,
>
>
> I checked both pcap files, they seems to be ok (except that they are
> truncated).
>
>
> The difference bewteen the ldapSearch pcap file and the om pcap file is
> that there is a unbind in the ldapSearch one, but otherwise, there is no
> control in any of them.
>
>
> Did you get the error with 'om' ?
>
>
>
> Le 29/03/2017 à 12:22, Maxim Solodovnik a écrit :
>> Hello Emmanuel,
>>
>> Here are 2 dumps: one made by ldapsearch tool, other made by directory java API
>> https://yadi.sk/d/fl2jDtBQ3GSuuq
>>
>> Hope this helps
>>
>> BTW everything works as expected with recent Samba
>>
>> On Sat, Mar 25, 2017 at 12:18 AM, Maxim Solodovnik <so...@gmail.com> wrote:
>>> Thanks for the quick answer
>>> I'll ask issue reported to capture request/response with whireshark and
>>> share it
>>>
>>>
>>> On Sat, Mar 25, 2017 at 12:14 AM, Emmanuel Lécharny <el...@gmail.com>
>>> wrote:
>>>> Hi Maxim,
>>>>
>>>>
>>>> sorry, but the dump does not make a lot of sense. All that I can tell is
>>>> that the end of this dump looks like some SearchResultEntry :
>>>>
>>>> 30 2B
>>>>   04 0E
>>>>     msTSManagingLS
>>>>   31 19
>>>>     04 17
>>>>       00455-001-9680336-84768
>>>>
>>>> 30 1E
>>>>   04 12
>>>>     msTSLicenseVersion
>>>>   31 08
>>>>     04 06
>>>>       33 39 33 32 31 36
>>>>
>>>> 30 27
>>>>   04 0E
>>>>     msRSEpireDate
>>>>   31 15
>>>>     04 13
>>>>       20170506060320.000Z
>>>>
>>>> 30 22
>>>>   04 0B
>>>>     whenChanged
>>>>   31 13
>>>>     04 11
>>>>       20170307060321.0Z
>>>>
>>>> 30 17
>>>>   04 0A
>>>>     uSNChanged
>>>>   31 09
>>>>     04 07
>>>>       1409108
>>>>
>>>> 30 4B
>>>>   04 11
>>>>     d i s t i n g u i s h e d N a m e
>>>>   31 36
>>>>     04 34
>>>>       CN=keycoll,OU=Service,OU=Holding,dc=company,DC=local
>>>>
>>>>
>>>> And that there is a SearchResultDone at the very end :
>>>>
>>>>
>>>> 30 0E
>>>>   02 01 03
>>>>   e(65) 07             SearchResultDone
>>>>     0A 01 00
>>>>     04 00
>>>>     04 00
>>>>     A0 00
>>>>
>>>>
>>>> but everything before is pretty much garbage (with some 2bytes chars in
>>>> it.)
>>>>
>>>>
>>>> What would be valuable is to capture some PDU with Wireshark. That would
>>>> be much better.
>>>>
>>>>
>>>> --
>>>> Emmanuel Lecharny
>>>>
>>>> Symas.com
>>>> directory.apache.org
>>>>
>>>
>>>
>>> --
>>> WBR
>>> Maxim aka solomax
>>
>>
>
> --
> Emmanuel Lecharny
>
> Symas.com
> directory.apache.org
>



-- 
WBR
Maxim aka solomax

Re: The length of controls must not be null

Posted by Emmanuel Lécharny <el...@gmail.com>.
Hi Maxim,


I checked both pcap files, they seems to be ok (except that they are
truncated).


The difference bewteen the ldapSearch pcap file and the om pcap file is
that there is a unbind in the ldapSearch one, but otherwise, there is no
control in any of them.


Did you get the error with 'om' ?



Le 29/03/2017 à 12:22, Maxim Solodovnik a écrit :
> Hello Emmanuel,
>
> Here are 2 dumps: one made by ldapsearch tool, other made by directory java API
> https://yadi.sk/d/fl2jDtBQ3GSuuq
>
> Hope this helps
>
> BTW everything works as expected with recent Samba
>
> On Sat, Mar 25, 2017 at 12:18 AM, Maxim Solodovnik <so...@gmail.com> wrote:
>> Thanks for the quick answer
>> I'll ask issue reported to capture request/response with whireshark and
>> share it
>>
>>
>> On Sat, Mar 25, 2017 at 12:14 AM, Emmanuel Lécharny <el...@gmail.com>
>> wrote:
>>> Hi Maxim,
>>>
>>>
>>> sorry, but the dump does not make a lot of sense. All that I can tell is
>>> that the end of this dump looks like some SearchResultEntry :
>>>
>>> 30 2B
>>>   04 0E
>>>     msTSManagingLS
>>>   31 19
>>>     04 17
>>>       00455-001-9680336-84768
>>>
>>> 30 1E
>>>   04 12
>>>     msTSLicenseVersion
>>>   31 08
>>>     04 06
>>>       33 39 33 32 31 36
>>>
>>> 30 27
>>>   04 0E
>>>     msRSEpireDate
>>>   31 15
>>>     04 13
>>>       20170506060320.000Z
>>>
>>> 30 22
>>>   04 0B
>>>     whenChanged
>>>   31 13
>>>     04 11
>>>       20170307060321.0Z
>>>
>>> 30 17
>>>   04 0A
>>>     uSNChanged
>>>   31 09
>>>     04 07
>>>       1409108
>>>
>>> 30 4B
>>>   04 11
>>>     d i s t i n g u i s h e d N a m e
>>>   31 36
>>>     04 34
>>>       CN=keycoll,OU=Service,OU=Holding,dc=company,DC=local
>>>
>>>
>>> And that there is a SearchResultDone at the very end :
>>>
>>>
>>> 30 0E
>>>   02 01 03
>>>   e(65) 07             SearchResultDone
>>>     0A 01 00
>>>     04 00
>>>     04 00
>>>     A0 00
>>>
>>>
>>> but everything before is pretty much garbage (with some 2bytes chars in
>>> it.)
>>>
>>>
>>> What would be valuable is to capture some PDU with Wireshark. That would
>>> be much better.
>>>
>>>
>>> --
>>> Emmanuel Lecharny
>>>
>>> Symas.com
>>> directory.apache.org
>>>
>>
>>
>> --
>> WBR
>> Maxim aka solomax
>
>

-- 
Emmanuel Lecharny

Symas.com
directory.apache.org


Re: The length of controls must not be null

Posted by Maxim Solodovnik <so...@gmail.com>.
Hello Emmanuel,

Here are 2 dumps: one made by ldapsearch tool, other made by directory java API
https://yadi.sk/d/fl2jDtBQ3GSuuq

Hope this helps

BTW everything works as expected with recent Samba

On Sat, Mar 25, 2017 at 12:18 AM, Maxim Solodovnik <so...@gmail.com> wrote:
> Thanks for the quick answer
> I'll ask issue reported to capture request/response with whireshark and
> share it
>
>
> On Sat, Mar 25, 2017 at 12:14 AM, Emmanuel Lécharny <el...@gmail.com>
> wrote:
>>
>> Hi Maxim,
>>
>>
>> sorry, but the dump does not make a lot of sense. All that I can tell is
>> that the end of this dump looks like some SearchResultEntry :
>>
>> 30 2B
>>   04 0E
>>     msTSManagingLS
>>   31 19
>>     04 17
>>       00455-001-9680336-84768
>>
>> 30 1E
>>   04 12
>>     msTSLicenseVersion
>>   31 08
>>     04 06
>>       33 39 33 32 31 36
>>
>> 30 27
>>   04 0E
>>     msRSEpireDate
>>   31 15
>>     04 13
>>       20170506060320.000Z
>>
>> 30 22
>>   04 0B
>>     whenChanged
>>   31 13
>>     04 11
>>       20170307060321.0Z
>>
>> 30 17
>>   04 0A
>>     uSNChanged
>>   31 09
>>     04 07
>>       1409108
>>
>> 30 4B
>>   04 11
>>     d i s t i n g u i s h e d N a m e
>>   31 36
>>     04 34
>>       CN=keycoll,OU=Service,OU=Holding,dc=company,DC=local
>>
>>
>> And that there is a SearchResultDone at the very end :
>>
>>
>> 30 0E
>>   02 01 03
>>   e(65) 07             SearchResultDone
>>     0A 01 00
>>     04 00
>>     04 00
>>     A0 00
>>
>>
>> but everything before is pretty much garbage (with some 2bytes chars in
>> it.)
>>
>>
>> What would be valuable is to capture some PDU with Wireshark. That would
>> be much better.
>>
>>
>> --
>> Emmanuel Lecharny
>>
>> Symas.com
>> directory.apache.org
>>
>
>
>
> --
> WBR
> Maxim aka solomax



-- 
WBR
Maxim aka solomax

Re: The length of controls must not be null

Posted by Maxim Solodovnik <so...@gmail.com>.
Thanks for the quick answer
I'll ask issue reported to capture request/response with whireshark and
share it


On Sat, Mar 25, 2017 at 12:14 AM, Emmanuel Lécharny <el...@gmail.com>
wrote:

> Hi Maxim,
>
>
> sorry, but the dump does not make a lot of sense. All that I can tell is
> that the end of this dump looks like some SearchResultEntry :
>
> 30 2B
>   04 0E
>     msTSManagingLS
>   31 19
>     04 17
>       00455-001-9680336-84768
>
> 30 1E
>   04 12
>     msTSLicenseVersion
>   31 08
>     04 06
>       33 39 33 32 31 36
>
> 30 27
>   04 0E
>     msRSEpireDate
>   31 15
>     04 13
>       20170506060320.000Z
>
> 30 22
>   04 0B
>     whenChanged
>   31 13
>     04 11
>       20170307060321.0Z
>
> 30 17
>   04 0A
>     uSNChanged
>   31 09
>     04 07
>       1409108
>
> 30 4B
>   04 11
>     d i s t i n g u i s h e d N a m e
>   31 36
>     04 34
>       CN=keycoll,OU=Service,OU=Holding,dc=company,DC=local
>
>
> And that there is a SearchResultDone at the very end :
>
>
> 30 0E
>   02 01 03
>   e(65) 07             SearchResultDone
>     0A 01 00
>     04 00
>     04 00
>     A0 00
>
>
> but everything before is pretty much garbage (with some 2bytes chars in
> it.)
>
>
> What would be valuable is to capture some PDU with Wireshark. That would
> be much better.
>
>
> --
> Emmanuel Lecharny
>
> Symas.com
> directory.apache.org
>
>


-- 
WBR
Maxim aka solomax

Re: The length of controls must not be null

Posted by Emmanuel Lécharny <el...@gmail.com>.
Hi Maxim,


sorry, but the dump does not make a lot of sense. All that I can tell is
that the end of this dump looks like some SearchResultEntry :

30 2B
  04 0E
    msTSManagingLS
  31 19
    04 17
      00455-001-9680336-84768

30 1E
  04 12
    msTSLicenseVersion
  31 08
    04 06
      33 39 33 32 31 36
   
30 27
  04 0E
    msRSEpireDate
  31 15
    04 13
      20170506060320.000Z

30 22
  04 0B
    whenChanged
  31 13
    04 11
      20170307060321.0Z

30 17
  04 0A
    uSNChanged
  31 09
    04 07
      1409108
     
30 4B
  04 11
    d i s t i n g u i s h e d N a m e
  31 36
    04 34
      CN=keycoll,OU=Service,OU=Holding,dc=company,DC=local


And that there is a SearchResultDone at the very end :


30 0E
  02 01 03
  e(65) 07             SearchResultDone
    0A 01 00
    04 00
    04 00
    A0 00


but everything before is pretty much garbage (with some 2bytes chars in it.)


What would be valuable is to capture some PDU with Wireshark. That would
be much better.


-- 
Emmanuel Lecharny

Symas.com
directory.apache.org