ISAM logging, error codes, and troubleshooting

This section lists error codes that are specific to FairCom RTG/ISAM. You may encounter these errors in addition to FairCom DB errors and standard Btrieve errors.

Configurable Log Output

The output of the FairCom RTG log includes a file name with the log messages. Warning and error log messages are formatted with the file name appended at the end of the message. The file name is preceded by the instance name, when specified in ctree.conf with the <instance name> attribute, or by the instance number and file number to uniquely identify the file as follows:

instance_number#file_number:file_name.

The file name is logged for START, READ, NEXT, PREVIOUS, WRITE, REWRITE, DELETE, and UNLOCK operations.

In addition, every entry in the log is pre-pended with a thread ID to uniquely identify the process/thread that made the log entry. The thread ID is made of 8 hexadecimal digits followed by a “>” sign.

Example:

00002D40> 20140915T141358 core:3494:cts_rewdel ERROR 5:42:0 record is locked 0#0:arc1.dat

 

Substitution Specifiers

The following substitution specifiers can be used in the name attribute of the <instance> and its variant elements:

  • %t to print the thread ID in unsigned decimal format
  • %p to print the process ID in unsigned decimal format
  • %i to print the instance number in unsigned decimal format

These specifiers can optionally contain embedded format specifiers with the following prototype:

%[0][width][x|X]specifier

  • [0] left-pads the number with zeroes (0) instead of spaces when width is specified
  • [width] minimum number of characters to be printed. If the value to be printed is shorter than this number, the result is padded with blank spaces. The value is not truncated even if the result is larger.
  • [x] (lower case) number is as unsigned hexadecimal integer
  • [X] (upper case) number is as unsigned hexadecimal integer

Driver Error Codes

The table below lists the logical error codes logged by the driver in the log file and returned by ctutil. These errors are generated internally by the driver and are converted into an error to be returned to the application. They do not match any standard Btrieve error codes.

The error codes logged by the driver in the log file are formatted as follows:


THREAD> DATE T TIME SRC:LINE:FUNCTION TYPE E1:E2:E3 MESSAGE
 

For example:


00002038> 20150506T105656 api:5248:ctl_regins ERROR 19:133:0 INTISAMX(1280,32,64,1280,1,,(not displayed),FAIRCOMS)
 

The first part of the message is the thread ID. The next part is a date-time stamp. DATE is formatted as yyyymmdd followed by T and then the TIME formatted as hhmmss:

20140312T081659 = March 12, 2014 at 8:16:59 AM.

The next part of the message (SRC:LINE:FUNCTION) indicates the source module, line number, and function returning the error, which may be required by FairCom Support:

  • SRC: Columns 16-20 acronym for source module where the error is logged (usually add ctcb in front to get the actual source module name)
  • LINE: Columns 22-25 line number where the error has been logged (usually just after it is generated)
  • FUNCTION: Columns 27-36 function name where the error has been logged

For example:

api:4397:ctl_regins
 

Columns 38-42 indicate the event type: ERROR, WARNG, INFO, PROFL, DEBUG.

Following the ERROR event type, you will see three numbers delimited by colons (":"). These numbers indicate the following in the order listed:

For example, ERROR 19:133:0 indicates COBOL error 19 (CTE_INTERFACE), FairCom DB error 133 (ASKY_ERR), and sysiocod 0.

The final part of the message is internal information (the failing function and the function arguments), for example:

INTISAMX(1280,32,64,1280,1,a)
 

Below are examples of other event types:


20140725T165133 api:0436:ctl_init INFO configuration file: ctree.conf

20140725T165133 api:0437:ctl_init INFO client version:10.5.0.28751-140717 id:34

20140725T165133 api:4706:ctl_setins INFO server version:10.5.0.28751-140717 id:34


20140725T165908 core:0611:cts_make DEBUG FILE created: custmast

20140725T165908 api:5492:ctl_conffi DEBUG FILE "custmast" matches <file> #0

20140725T165908 fsi:0576:ct_make2 PROFL 079310 counts on file:custmast


20140725T170057 api:1926:ctl_open2 WARNG transaction configuration mismatch: <transaction>no</transaction> but file is ctPREIMG

 

FairCom RTG/ISAM Error Codes

 

Symbolic

Error Code

Description

CTE_NO_ERROR

0

Operation completed successfully

CTE_SYS_ERR

1

System error

CTE_PARAM_ERR

2

Parameter not correct

CTE_TOO_MANY_FILES

3

Too many files open. Check the FILES keyword in the configuration file

CTE_MODE_CLASH

4

File is open read-only

CTE_REC_LOCKED

5

Record locked by another user

CTE_BROKEN

6

File is corrupt. Rebuild it or restore it from a backup

CTE_DUPLICATE

7

Duplicate record not allowed

CTE_NOT_FOUND

8

Record not found

CTE_UNDEF_RECORD

9

Record position not set

CTE_DISK_FULL

10

Write error

CTE_FILE_LOCKED

11

File locked by another user

CTE_MISMATCH

13

File definition mismatch

CTE_NO_MEMORY

14

Out of memory error

CTE_MISSING_FILE

15

File not found

CTE_PERMISSION

16

User does not have appropriate access permission

CTE_NO_SUPPORT

17

Unsupported functionality

CTE_INTERFACE

19

Interface error, check FairCom DB error code (you may need to activate the error logging in ctree.conf and view the error log)

CTE_MODE_CLASH_W

23

File is open write-only

CTE_MODE_CLASH_RW

24

File is not open for read and write

CTE_AT_END

25

End of file

CTE_SYNTAX_ERR

31

Configuration syntax error

CTE_CONFIG_ERR

32

Configuration error

CTE_ENCRYPTED

33

Operation not allowed. File is encrypted

CTE_REDIRINST

34

Unexpected reference to redir instance

CTE_NOT_SQL

35

Server/database is not SQL

CTE_MISSING_TABLE

36

SQL table not found

CTE_INCOMPATIBLE

37

Client/server incompatibility

CTE_FILE_EXISTS

38

File already exists

CTE_NO_TRANSACTION

39

No active transaction

CTE_NOT_MODIFIABLE

40

Key is not modifiable

CTE_NOT_CTREE_FILE

41

Unknown file format

CTE_TRAN_EXIST

42

Transaction already active

CTE_XDD_RULE_ERR

43

XDD rule error

CTE_MISSING_IDXFILE

44

Missing index file

CTE_ALREADY_OPEN

45

File is already open

CTE_ALREADY_CLOSE

46

File is already close

CTE_DELETE_OPEN

47

File is open

CTE_CLOSE_WITH_LOCK

48

File was closed with lock

CTE_OPEN_MISSING

49

File not found

CTE_CHECK_DEFS_ERR

50

File definition error

CTE_FILE_SIZE_ERR

51

File size exceeds limit

CTE_ORPHAN_IDXFILE

52

File is corrupted. Remove orphan index file

CTE_DATABUFFER_ERR

53

Data buffer is too short

CTE_NOT_RTG_FILE

54

File is not compatible with RTG

CTE_DISCONNECT_ERR

55

Disconnection error

 

FairCom RTG/ISAM SQL Access Errors

The FairCom RTG/ISAM solution is enabled through a server-side callback module, which implements FairCom DB API callback routines. Errors that occur within these routines generate a standard FairCom DB API error code that is context sensitive to this implementation. Here is a list of possible return codes from this module, and their meaning in FairCom RTG/ISAM XDD handling.

Symbolic

Error Code

Description

CTDBRET_CALLBACK_1

4109

Could not find schema in XDD

CTDBRET_CALLBACK_2

4110

Record length does not match extended data definitions

CTDBRET_CALLBACK_3

4111

Invalid or corrupted XDD resource

CTDBRET_CALLBACK_4

4112

Syntax error parsing extended data definitions

CTDBRET_CALLBACK_5

4113

Internal error

CTDBRET_CALLBACK_6

4114

Could not find field in XDD

CTDBRET_CALLBACK_7

4115

Could not find filter in XDD

CTDBRET_CALLBACK_8

4116

Too many schemas in XDD

CTDBRET_CALLBACK_9

4117

Error setting filter condition on schema

CTDBRET_CALLBACK_10

4118

Field value conversion error

CTDBRET_CALLBACK_11

4119

Unsupported CLOB/BLOB definition in XDD

CTDBRET_CALLBACK_12

4120

Index not supported on field type

CTDBRET_CALLBACK_13

4121

Missing or bad dbtype information in XDD

CTDBRET_CALLBACK_14

4122

Invalid filter key settings in XDD

CTDBRET_CALLBACK_15

4123

"Regular" field found after virtual fields in the XDD <schema> (in earlier releases: Invalid field default settings in XML definitions)

CTDBRET_CALLBACK_16

4124

Not used

CTDBRET_CALLBACK_17

4125

Key definition does not match XDD information

CTDBRET_CALLBACK_18

4126

Missing or bad value in XDD

CTDBRET_CALLBACK_19

4127

Internal error (unexpected field type)

CTDBRET_CALLBACK_20

 

Not used

 

Troubleshooting

This section provides some useful troubleshooting tips.

For troubleshooting performance issues, see the section titled Performance Tuning.

A Note About Error Codes

Most of the FairCom RTG/ISAM errors are intended for developers and will seldom be seen during normal operation.

The FairCom RTG/ISAM products are built upon a specialized version of the FairCom DB core database engine. The complete list of possible FairCom RTG/ISAM errors can be found in the FairCom DB Error Codes document.

For error codes that are specific to FairCom RTG/ISAM, see the following:

For error codes returned by the XDDCHECK API, see:

  • XDDCHECK Errors

 

Error 407

Support has been added to the FairCom RTG/ISAM ctutil utility to open files affected by error 407 so it can export data from a file that has a damaged resource chain. This support requires ADMIN permission and the OPENCRPT file mode. To use this functionality, ctutil must be renamed to ctunload407. The ctunload407 utility functions similar to ctutil ‑unload except that it automatically connects as ADMIN (with the default ADMIN password) and enables the <allowcorrupt> setting.

Error 408 / 438

Error 408 / 438 during -sqlink indicates that no record definition is available. Either the file does not have an XDD resource (-sqlinfo was not performed) or the server did not load the data conversion callback library. Possible causes are:

  • LOAD_CALLBACK_LIB ctsrvr.cfg keyword was not specified or invalid.

Or

  • The callback library is not in LD_LIBRARY_PATH (UNIX).

 

Client/Server Incompatibility

An internal error CTE_INCOMPATIBLE (37) is returned when the client or server is outdated. An entry is sent to <log> with a logical error 37 and one of the following:

  • c-tree error -3 (CTE_OLD_CLIENT) when the client is older than the server
  • c-tree error -4 (CTE_OLD_SERVER) when the server is older than the client

 

File Matching Rules in ctree.conf

When ctree.conf contains only one <instance> element, it is not mandatory to specify a <file> rule because it is implicit that FairCom RTG/ISAM needs to use the one available instance to open files.

If you specify more than one instance, you need to specify a <file> rule so that FairCom RTG/ISAM knows which instance to use to open files. When specifying more than one instance, specify a default file rule into the instance you want to use:

<config>

<log>n</log>

<instance server="FAIRCOMS"></instance>

<redirinstance>

<file name="*">

</file>

</redirinstance>

</config>

Please notice that to specify a default file rule you can omit the name/dir attributes so the above configuration can also be specified as follows:

<config>

<log>n</log>

<instance server="FAIRCOMS"></instance>

<redirinstance><file/></redirinstance>

</config>

The above concept applies to all <*instance> elements: <instance>, <redirinstance>, etc.

Troubleshooting Performance

The following features can improve performance:

  • Using the <prefetch> feature to improve performance of sequential reads.
  • Using the KEEPOPEN feature (which can be enabled in ctsrvr.cfg) if the application is frequently using OPEN/CLOSE.
  • Disabling <optimisticadd> if the application frequently performs WRITE operations on existing records.
  • Disabling <transaction> if transactions are not in use and data is stored on secure media (hardware redundancy, etc.).
  • Enabling <ctfixed> to force creating fixed-length record data files as ctFIXED files.