Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to debug a prgCtx problem?

Status
Not open for further replies.

DrDDT

Technical User
Apr 6, 2005
88
NL
Hi!

We have a custom module that dumps a tracefile sometimes.
The problem seems to be with prgCtx. The function
seems to be undefined somehow.

I'm not a programmer, I can start up the builder and look at the code, but I have no clue where to search.

A typical tracefile looks like:

Start Stack Crawl ...
Thread: 1D75D698
Depth: 10
Status: An object was not specified
R0: E648871950
Frame: 1E3A7AB0 NodeFullPathById (0)

Any ideas where to start looking?

Opentext support does not support third party custom modules.
 
Greg,

Somehow one of the cached sessions breaks and loses its session data. This results in tracefiles like:

Code:
Start Stack Crawl ...
  Thread: 1EDE0218
  Depth:  2
  Status: An object was not specified
  R0:     E648871950
 Frame:     1F125688 GetConfig (0)
   ObjRef:  #20001f2c.'GetConfig'
   PC:      9
   Line:    7:7
   NStkVal: 2
   NLocals: 3
   NArgs:   1
   Stack:   SP-1 = 'fDBConnect'
   Stack:   SP-2 = #41d66b2
   Local:   temp (0) = ?
   Local:   stmt (1) = 'select StateNum from KState where StateID=:A1'
   Local:   cnct (2) = ?
   Args:    prgCtx (0) = #41d66b2
 Frame:     1DA6C000 Callback (0)
   ObjRef:  #20001f3c.<LL:Script><<object:&storageprovider[338].Callback>//	P1 = The DAPI session\n//	P2 = The callback reason (see the switch statemtn below)\n//	P3 = The provider name used in DAPI.AddVersion\n//	P4 = The provider data found in the DAPI provider table\n//	P5 = resFork or datafork (true or false).  Used only for version streaming.\n//	P6 = The version this callback is operating on\n//	P7 = Context for this callback reason\n\nfunction Dynamic Callback(\\\n	DAPISESSION		session,\\\n	Integer			reason,\\\n	String			providerName,\\\n	String			providerData,\\\n	Integer			resFork,\\\n	DAPIVERSION		version,\\\n	Dynamic			context )\n\n	Dynamic			retVal\n	Dynamic			providerInfo\n	Boolean			debug = FALSE\n	Object			provider\n	Object			dapiCtx\n	Assoc			config\n	Assoc			pData\n	Assoc			lProvider\n	String			subProviderName\n	String			storageProviderName\n	\n	Object			prgCtx = Undefined\n	Boolean			tellSubscribers = false\n	\n\n	if ( IsUndefined( Error.Get( 6007 ) ) )\n		Error.Define( 6007, "Error obtaining a program context to load Storage Provider configuration" )\n		if ( IsUndefined( Error.Get( 6007 ) ) )\n			echo( "TEGTEGTEG Error doesn't define!" )\n		end\n	end\n\n	\n	// create assoc for info\n	\n	Assoc nodeVals = Assoc.CreateAssoc()\n\n	// set provider name\n	\n	nodeVals.Providername = providerName\n	\n	dapiCtx = Capi.ContextData( session )\n	\n	if ( IsDefined( dapiCtx ) && IsNotError( dapiCtx ) )\n		prgCtx = dapiCtx.fPrgCtx\n	end\n	\n	if ( IsDefined( providerdata ) )\n		pData = Str.StringToValue( providerData )\n\n		storageProviderName = pData.storageProviderName\n		subProviderName = pData.subProviderName // logical provider name\n		providerInfo = pData.providerInfo // from provider code\n\n\n		if ( IsUndefined( prgCtx ) )\n			//uh-oh, this is really bad\n			echo( "TEGTEGTEG CATASTROPHE" )\n		else\n			if ( reason == DAPI.BLK_READ || reason == DAPI.BLK_WRITE )\n				\n				// This is a huge mistake. fConfig could be out of date\n				config = $StorageProvider.StorageProviderSubsystem.fConfig\n				\n				\n				//echo( "TEGTEGTEGTEGTEGTEGTEGTEGTEGTEGTEGTEGTEGTEGTEGTEGTEGTEGTEGTEGTEGTEGTEGTEG" )\n				//echo( "TEGTEGTEG              cheated on loading config			   TEGTEGTEG" )\n				//echo( "TEGTEGTEGTEGTEGTEGTEGTEGTEGTEGTEGTEGTEGTEGTEGTEGTEGTEGTEGTEGTEGTEGTEGTEG" )\n			else\n				config = $StorageProvider.StorageProviderSubsystem.GetConfig( prgCtx )\n			end\n			lProvider = config.LogicalProviders.( subProviderName )\n			provider = lProvider.Provider\n		end\n	else		\n		storageProviderName = this.OSParent.fName\n		subProviderName = this.fName\n		provider = this\n		\n		pData.storageProviderName = storageProviderName\n		pData.subProviderName = subProviderName\n	end\n\n	if ( IsDefined( pData ) && ( IsDefined( provider ) || ( reason == DAPI.FETCHABLE ) ) )\n	\n		switch reason\n		\n			case DAPI.FILE_PUT\n				retVal = provider.ProviderFilePut( session, subProviderName, providerData, version, nodeVals, context )\n				if ( isNotError( retVal ) )\n					pData.providerInfo = retVal\n				\n					retVal = Str.ValueToString( pData )\n				end\n			end\n		\n			case DAPI.FILE_GET\n				retVal = provider.ProviderFileGet( session, subProviderName, providerData, version, nodeVals, context )\n			end\n		\n			case DAPI.DELETE\n				retVal = provider.ProviderDelete( session, subProviderName, providerInfo, version, nodeVals, context )\n			end\n			\n			case DAPI.OPEN_IN\n				retVal = provider.ProviderOpenIn( session, subProviderName, providerInfo, version, nodeVals, context )\n			end\n	\n			case DAPI.OPEN_OUT\n				retVal = provider.ProviderOpenOut( session, subProviderName, providerInfo, version, nodeVals, context )\n				if ( isNotError( retVal ) )\n					pData.providerInfo = retVal\n				\n					retVal = Str.ValueToString( pData )\n				END\n			end\n	\n			case DAPI.CLOSE\n				retVal = provider.ProviderClose( session, subProviderName, providerInfo, version, nodeVals, context )\n			end\n	\n			case DAPI.BLK_READ\n				retVal = provider.ProviderReadBlk( session, subProviderName, providerInfo, version, nodeVals, context )\n			end\n	\n			case DAPI.BLK_WRITE\n				retVal = provider.ProviderWriteBlk( session, subProviderName, providerInfo, version, nodeVals, context )\n			end\n\n			case DAPI.SEEK\n				retVal = provider.ProviderSeek( session, subProviderName, providerInfo, version, nodeVals, context )\n			end\n			\n			case DAPI.FETCHABLE\n				// Externally stored documents are always fetchable\n				retVal = TRUE\n			end\n				\n		end\n	\n		if ( nodeVals.tellSubscribers )\n		\n			// tell subscibers\n			\n			Object subscriber\n			\n			for subscriber in $LLiApi.AuditCallbackSubsystem.GetItems()\n			\n				if ( IsDefined( subscriber ) )\n				\n					subscriber.ProviderCallback( providerName, reason, session, nodeVals )\n				\n				end\n				\n			end\n			\n		end\n	else\n		echo( [StorageProvider_ErrMsg.ErrorLocatingAValidProviderForOperation] )\n	end	\n\n\n	return( retVal )\nend\n></LL:Script>
   PC:      219
   Line:    77:77
   NStkVal: 1
   NLocals: 14
   NArgs:   7
   Stack:   SP-1 = #41d66b2
   Local:   retVal (0) = ?
   Local:   providerInfo (1) = '0027\\524\\27524805.dat'
   Local:   debug (2) = false
   Local:   provider (3) = ?
   Local:   dapiCtx (4) = #41d63a3
   Local:   config (5) = A<1,?>
   Local:   pData (6) = A<1,?,'providerInfo'='0027\\524\\27524805.dat','storageProviderName'='ExtShared','subProviderName'='Default'>
   Local:   lProvider (7) = A<1,?>
   Local:   subProviderName (8) = 'Default'
   Local:   storageProviderName (9) = 'ExtShared'
   Local:   prgCtx (10) = #41d66b2
   Local:   tellSubscribers (11) = false
   Local:   nodeVals (12) = A<1,?,'Providername'='Default'>
   Local:   subscriber (13) = ?
   Args:    session (0) = U<DAPISession(-74)=1ACCBC10>
   Args:    reason (1) = 9
   Args:    providerName (2) = 'Default'
   Args:    providerData (3) = 'A<1,?,\'providerInfo\'=\'0027\\\\524\\\\27524805.dat\',\'storageProviderName\'=\'ExtShared\',\'subProviderName\'=\'Default\'>'
   Args:    resFork (4) = ?
   Args:    version (5) = U<DAPIVersion(-69)=1EED4530>
   Args:    context (6) = 32236943
End Stack Crawl.
 
do you have access to the Livelink SDK (Builder) ? can you provide some more details on the custom module you are having issues with, is it a 3rd party or in house build ?

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
Does this have a pattern.I seem to have noticed the statenum table errors when livelink is sitting idle for long hours like in a friday thru monday scenario.In this time frame,the oracle server would have been taken offline for backups et al.You make livelink connect with repeated tries thru the web browser or by re-starting the service.I had opened a ticket with OT who wanted full debugging turned on and unfortunately with full debugging the problem went away.So it was never found out at root cause.

It might be worthwhile,(unless I am barking up the wrong pole here),to have a external program do a login every so minutes or so and see if this goes away.

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
 
I do have access to the builder.
The module is a custom made, non-OpenText module.

The bug seems to be triggered by using the module, but
I cannot reproduce it (yet).
 
That is the big problem. We cannot reproduce this problem reliable.
 
If you can't replicate reliably your best bet may be to leave builder running on a machine and then wait for it to trip and then you can debug it.

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
From taking a look at the stack crawl. It looks like your custom module is trying to fetch a version of a node. The problem seems to be that the DAPISESSION object that was used to connect to DAPI, was not created within the context of a complete PrgCtx. The prgCtx did not register the fDbConnect feature.

The first thing I would do is search the code for where it is trying to allocate it's own connection to the database. Somehow, it's not doing it right.
 
Again, I'm not an OScript programmer, but this is what is see:

Code:
	// Try imporsonating admin user
	prgAssoc 		= $PWA.Utils.ImpersonateAdmin()

	prgCtx 			= prgAssoc.pSession
	dSession 		= prgCtx.DSession().fSession
	cnct 			= PrgCtx.fDbConnect.fConnection


Code:
function Assoc ImpersonateAdmin()

		// Try imporsonating admin
	String	sDftConnection	= $Kernel.SystemPreferences.GetPrefGeneral( 'DftConnection' )
	
	Assoc 	prgAssoc 		= $LLIAPI.PrgSession.CreateNewNamed( sDftConnection, { "Admin", UNDEFINED }, 0 )
				
	return ( prgAssoc )
end

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top