StrToMember MDX function causing a server crash

Post Reply
User avatar
PavoGa
Community Contributor
Posts: 367
Joined: Thu Apr 18, 2013 6:59 pm
OLAP Product: TM1
Version: 10.2.2 FP7, PA2.0.05
Excel Version: 2013 PAW
Location: Cleveland, Tennessee

StrToMember MDX function causing a server crash

Post by PavoGa » Mon May 06, 2019 1:09 pm

We have isolated a problem where StrToMember will cause a server crash. This may be a well known problem, but a cursory Google search did not reveal anything on it.

The code is building a subset of accounts based on values in a cube:

Code: Select all

GENERATE( FILTER( TM1SUBSETALL( [Account] ),
	LEN([mycube].([Version].[Active1], [Measure].[myMeasure])) > 0)
	, {StrToMember("[Account].[" + [mycube].([Version].[Active1], [Measure].[RollupAccount]) + "]")})
when the conditional returns a blank to the StrToMember function, the server crashes. Of course, we'll prevent that from happening henceforth, but if this has not been recognized, should it be considered a bug and reported? I think crashing the server is a bit of an extreme response to a bad argument to the MDX function.
Ty
Cleveland, TN

Drg
Posts: 132
Joined: Fri Aug 12, 2016 10:02 am
OLAP Product: tm1
Version: 10.2.0 - 10.3.0
Excel Version: 2010

Re: StrToMember MDX function causing a server crash

Post by Drg » Tue May 07, 2019 12:25 pm

you tried to put more curly braces???

Code: Select all

{GENERATE( {FILTER( TM1SUBSETALL( [Account] ),
	LEN([mycube].([Version].[Active1], [Measure].[myMeasure])) > 0)}
	, {StrToMember("[Account].[" + [mycube].([Version].[Active1], [Measure].[RollupAccount]) + "]")})}

User avatar
PavoGa
Community Contributor
Posts: 367
Joined: Thu Apr 18, 2013 6:59 pm
OLAP Product: TM1
Version: 10.2.2 FP7, PA2.0.05
Excel Version: 2013 PAW
Location: Cleveland, Tennessee

Re: StrToMember MDX function causing a server crash

Post by PavoGa » Tue May 07, 2019 12:52 pm

Drg wrote:
Tue May 07, 2019 12:25 pm
you tried to put more curly braces???

Code: Select all

{GENERATE( {FILTER( TM1SUBSETALL( [Account] ),
	LEN([mycube].([Version].[Active1], [Measure].[myMeasure])) > 0)}
	, {StrToMember("[Account].[" + [mycube].([Version].[Active1], [Measure].[RollupAccount]) + "]")})}
Those are not necessary with functions that return a set to begin with. And the problem is occurs when the RollupAccount is blank for the filtered Account set. I would expect an error in this case (and modified the FILTER to avoid it), but think a server crash is a bit harsh. We'll report to IBM, although hopefully this is taken care of in one of the subsequent releases we do not have as of yet.

I did not see anything related to this when I googled it and wanted to put it out there for information.
Ty
Cleveland, TN

Drg
Posts: 132
Joined: Fri Aug 12, 2016 10:02 am
OLAP Product: tm1
Version: 10.2.0 - 10.3.0
Excel Version: 2010

Re: StrToMember MDX function causing a server crash

Post by Drg » Tue May 07, 2019 1:15 pm

Yes, the server crash is unacceptably cruel. But you can use the workaround using the union of two members and take only one upper one, then if the first one is empty, you can take the default one. But this is terrible in terms of finding bugs.

User avatar
PavoGa
Community Contributor
Posts: 367
Joined: Thu Apr 18, 2013 6:59 pm
OLAP Product: TM1
Version: 10.2.2 FP7, PA2.0.05
Excel Version: 2013 PAW
Location: Cleveland, Tennessee

Re: StrToMember MDX function causing a server crash

Post by PavoGa » Tue May 07, 2019 3:13 pm

Drg wrote:
Tue May 07, 2019 1:15 pm
Yes, the server crash is unacceptably cruel. But you can use the workaround using the union of two members and take only one upper one, then if the first one is empty, you can take the default one. But this is terrible in terms of finding bugs.
I am responding to this to make sure anyone who sees does not get the wrong idea.

A UNION will not help this. In actuality, the full MDX statement in the TI uses a UNION (I use UNION in virtually all TI MDX for a couple of purposes). The problem is when the MDX submits a blank/null value to StrToMember. All the UNIONs in the world are not going to prevent that. The "workaround" (better described as preventative method) is a filter to prevent a null value hitting the StrToMember function.
Ty
Cleveland, TN

User avatar
Elessar
Regular Participant
Posts: 166
Joined: Mon Nov 21, 2011 12:33 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2010
Location: Russia

Re: StrToMember MDX function causing a server crash

Post by Elessar » Mon May 13, 2019 3:32 pm

Hello,

IMHO this is a serious bug: any user can open Architect, write this MDX expression and crash the server.
I've already reported a similar bug: https://www-01.ibm.com/support/entdocvi ... wg1PH06648
Sorry for my English ;)

User avatar
PavoGa
Community Contributor
Posts: 367
Joined: Thu Apr 18, 2013 6:59 pm
OLAP Product: TM1
Version: 10.2.2 FP7, PA2.0.05
Excel Version: 2013 PAW
Location: Cleveland, Tennessee

Re: StrToMember MDX function causing a server crash

Post by PavoGa » Mon May 13, 2019 7:23 pm

Elessar,

Have not looked at your link yet, but I do have an update. This also happens when a bad alias is handed to StrToMember. That should not have happened in our case, but we had a bad alias stored in a cube and, Whoa Nellie! it crashed the server while building a subset off that measure.
Ty
Cleveland, TN

Drg
Posts: 132
Joined: Fri Aug 12, 2016 10:02 am
OLAP Product: tm1
Version: 10.2.0 - 10.3.0
Excel Version: 2010

Re: StrToMember MDX function causing a server crash

Post by Drg » Fri May 17, 2019 8:52 am

Fixit on PA local 2.0.7

Post Reply