Server Explorer Crash during security update

Post Reply
User avatar
Ajay
Regular Participant
Posts: 183
Joined: Wed May 14, 2008 8:27 am
OLAP Product: TM1
Version: 10.2.0, PA 2.0.9
Excel Version: 2016
Location: London

Server Explorer Crash during security update

Post by Ajay »

Morning all,

I have experienced something of an oddity over the last few days in a very tried and trusted process of adding users to our system.

So, in a nutshell, I have a very small file of users to add to the TM1 instance, and before doing so, I clear out the }Clients dimension (except for administrators) and then load the users in.

The code in my Prolog is:

Code: Select all

iMaxNoClients = DIMSIZ ( '}Clients' ) ;

i = 1 ;

WHILE ( i <= iMaxNoClients ) ;

	sClient = DIMNM ( '}Clients', i ) ;

	IF ( sClient @<>'ADMIN'    %     CellGetS ( '}ClientGroups', sClient, 'ADMIN' ) @<> 'ADMIN' ) ;

		DeleteClient ( sClient ) ;

	ENDIF ;

	i = i + 1 ;

END ;

And then in my Metadata I have the following, used to add in the users:

Code: Select all

IF ( DIMIX ( '}Clients', vUser ) = 0 ) ;

	AddClient ( vUser ) ;

ENDIF ;

When I processed this, my Server Explorer session kicked me out and I could see that my process was still running in TM1Top, but was in an endless loop - so I have to crash the server and restart. Incidentally I am running this in IntegratedSecurityMode 1 at the moment.

Upon, hashing out the Prolog lines, the process works fine by adding the new users into the }Clients dimension......so it must be my prolog code.....my user id is in the admin group so I wasn't expecting to be booted out as my code is simply trying to remove clients who are not admins........any assistance to confirm my madness would be appreciated !!!

We are using 10.2.20200.55

Cheers Ajay
User avatar
qml
MVP
Posts: 1098
Joined: Mon Feb 01, 2010 1:01 pm
OLAP Product: TM1 / Planning Analytics
Version: 2.0.9 and all previous
Excel Version: 2007 - 2016
Location: London, UK, Europe

Re: Server Explorer Crash during security update

Post by qml »

Pretty sure you must not delete the Client under which you are running the TI. I know you are probably adding the Client back in Metadata, which would be fine for a regular dimension, but not for a security-related control dimension like }Clients.
Kamil Arendt
User avatar
Ajay
Regular Participant
Posts: 183
Joined: Wed May 14, 2008 8:27 am
OLAP Product: TM1
Version: 10.2.0, PA 2.0.9
Excel Version: 2016
Location: London

Re: Server Explorer Crash during security update

Post by Ajay »

Hi Kamil

I am running the process at the moment, and I am an ADMIN, so I would have expected me to be fine, as the code should only remove clients who are not Admins.

That's what's causing me to loose more hair from my bald head ! :o

Ajay
User avatar
qml
MVP
Posts: 1098
Joined: Mon Feb 01, 2010 1:01 pm
OLAP Product: TM1 / Planning Analytics
Version: 2.0.9 and all previous
Excel Version: 2007 - 2016
Location: London, UK, Europe

Re: Server Explorer Crash during security update

Post by qml »

Ajay wrote:the code should only remove clients who are not Admins
That's not what your code is doing. If the first condition is met (i.e. Client is not ADMIN) then the deletion will still happen, even if the user belongs to the group ADMIN. Your OR (%) should be replaced with AND (&).

As a separate note, when you are removing dimension elements in a loop you should start from the end of the dim and decrement your counter, otherwise you are re-indexing the dimension with every deletion and skipping some elements as a result.
Kamil Arendt
User avatar
Ajay
Regular Participant
Posts: 183
Joined: Wed May 14, 2008 8:27 am
OLAP Product: TM1
Version: 10.2.0, PA 2.0.9
Excel Version: 2016
Location: London

Re: Server Explorer Crash during security update

Post by Ajay »

Aaaaaaaaaaaargh !!!!!!!!

Good spot Kamil.....wouldn't it be nice in the next version to actually have the words "OR" and "AND" :roll:

Cheers for that Kamil... and have reversed the increment too.....now working as required.

Ajay
Post Reply