Page 1 of 1 1
Topic Options
#208702 - 2014-03-10 02:02 PM Strange problem assigning list to array
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
I suddenly started experiencing a problem that I cannot explain.

I am consolidating 4 "old" AD domains into a "new" domain. I have written a Kix script (see attached, domain names changed) that queries all 4 of the old domains, creating a report that contains the source domain name, an index number, a collection of user attributes, and then adds 5 calculated values to each record. 3 Index files are also created that include specific data. These index files are used to identify duplicate user or account names or email addresses that need to be changed prior to migration.

The script has been running for several months when, suddenly about 2 weeks ago, it started failing to collect data from the 4th domain in the list.

We made a subtle change to the script this weekend and the script began to work again. The original code:
 Code:
; Array of Source Domains                              v--Space                                    v--Space                                   v--NO Space
$aDomains = '1.olddomain.com/DC=1,DC=olddomain,DC=com', '2.olddomain.com/DC=2,DC=olddomain,DC=com', '3.olddomain.com/DC=3,DC=olddomain,DC=com','4.olddomain.net/DC=4,DC=olddomain,DC=net'
and the new code
 Code:
; Array of Source Domains                              v--Space                                    v--Space                                    v-- Space
$aDomains = '1.olddomain.com/DC=1,DC=olddomain,DC=com', '2.olddomain.com/DC=2,DC=olddomain,DC=com', '3.olddomain.com/DC=3,DC=olddomain,DC=com', '4.olddomain.net/DC=4, DC=olddomain,DC=net'
The only difference is the addition of a space between the third and fourth domain names in the list that assigns values to the $aDomains array.

When debugging, I displayed the values passed to the LDAPQuery() UDF and could not detect a difference in the values passed, but only when adding the space as shown above did the query work. Again, this worked for several months before suddenly throwing errors 2 weeks ago. The domain query logic is used in 5 other scripts that perform other tasks with the extracted data, all working until 2 weeks ago and now failing.

During testing, I removed the two middle domains and tested with just the first and last (with no space between) and it failed.. adding the space allowed it to work.

Does anyone have any insight as to why this subtle and seemingly irrelevant change would have such an impact?

Thanks,

Glenn

PS - the attached script requires at least two domains with trusts to function.


Attachments
extract.zip (148 downloads)
Description:


_________________________
Actually I am a Rocket Scientist! \:D

Top
#208703 - 2014-03-10 02:53 PM Re: Strange problem assigning list to array [Re: Glenn Barnas]
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Glenn. I just ran your script against two of my domains using Kixtart 4.53 and it worked with or without space.
Top
#208704 - 2014-03-10 04:20 PM Re: Strange problem assigning list to array [Re: Shawn]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
Yeah - this worked for quite a while.. now the LDAPQuery() will return a blank for BOF, -1 for EOF if there's no space, while with the space, the LDAPQuery() gets zeros for both the EOF and BOF tests and is able to return the attribute list. I've run out of hair to pull out on this.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#208705 - 2014-03-10 06:53 PM Re: Strange problem assigning list to array [Re: Glenn Barnas]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Could it be the space that was added in the string, rather than the space added between elements?

 Code:
'4.olddomain.net/DC=4,DC=olddomain,DC=net'

 Code:
'4.olddomain.net/DC=4, DC=olddomain,DC=net'


Just thinking out loud really. Trying to spot any possible differences.


Edited by ShaneEP (2014-03-10 06:54 PM)

Top
#208706 - 2014-03-10 07:35 PM Re: Strange problem assigning list to array [Re: ShaneEP]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
good point Shane \:\)

could also be bitrod in the kixtart-executable running in that domain.
_________________________
!

download KiXnet

Top
#208707 - 2014-03-10 07:47 PM Re: Strange problem assigning list to array [Re: ShaneEP]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
No - the spaces are after the comma, before the single quote. Further, it failed when the space WAS NOT there..

Just weird stuff going on at the client - now another domain is failing, and I even tried changing the array declaration to
 Code:
$aDomains = Split('dom1~dom2~Dom3~dom4', '~')
with no change in results...

I'm thinking that Jooel's got something there with a bad bitrod, but not in the Kix exe... more likely something else going on here.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#208708 - 2014-03-10 07:51 PM Re: Strange problem assigning list to array [Re: Glenn Barnas]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
Bitrod? Whats that?
Top
#208709 - 2014-03-10 07:53 PM Re: Strange problem assigning list to array [Re: Allen]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
Oops - that was a secret coding technology that Jooel was working on.. I guess the cat is out of the bag now.. \:D

I'd better let Jooel explain it - he has a much better handle on that technology.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#208710 - 2014-03-10 08:09 PM Re: Strange problem assigning list to array [Re: Glenn Barnas]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
lol.
I guess I should have used the proper term bitrot.
_________________________
!

download KiXnet

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 739 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.063 seconds in which 0.027 seconds were spent on a total of 14 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org