cancel
Showing results for 
Search instead for 
Did you mean: 

What could cause the error "External environment could not be started, main thread not found"?

VolkerBarth
Contributor
0 Kudos
8,343

While testing with an external DLL in an external C_ESQL32 environment on SA 12.0.0.2483 (GA), the above error (SQLCODE -675) was raised a few times - mainly when the same external function were called from different connections in parallel.

AFAIK, the error was only raised by events that called these functions (before doing backups and the like), not when calling these functions directly from a DBISQLC session.

As each event is always run on its own connection, it will always get its own external environment process. Therefore I don't know what kind of "main thread" might be missing.

Any hints are highly appreciated:)


Yes, I'm still testing the same DLL that has already triggered other questions as well...

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

The error is a bad one and currently being "fixed". The main problem is that the external environment's main connection thread did not establish a connection with the server within the 15 second timeout. The problem can arise if the server is very busy or if a large number of external environments are being started at the same time. Doing a backup could also cause the error while the backup starts up. If that is the case, try delaying the backup until the extenv call is complete.

VolkerBarth
Contributor
0 Kudos

Thanks for the explanation - I just notice that the error happens in the following situation: The server is busy validating the database (on a single CPU system) and in the meantime an event is triggered that calls an external function. So I guess this is due to the connection not being established in the 15 seconds timeframe. - I will try to run the validation process with lower priority, if that might matter.

Former Member
0 Kudos

You could also consider changing the event to trap the error and retry the call every few seconds until it succeeds.

Answers (0)