APPX Software Library

Chapter 8: Solve Connection and Import Problems

Record a Diagnostic Log, Then Turn Logging Off

Use Environment Variables and Where to Set Them to select the process and configuration location. The defaults below were checked in this release's source. A configured value takes precedence over its source default; record the installation's actual settings before changing them.

DiagnosticDefault and file behaviorActivation and category selection
ASQL expert modeDisabled when ASQL_EXPERT_MODE is absent. Any present value enables the override.Set it in ASQL's command window before starting ASQL. Close ASQL and clear the variable to remove the override.
ASQL logDisabled when ASQL_LOG is absent. A configured file is opened for overwrite when ASQL starts.Set a writable local path in ASQL's command window. Keep raw logs private because the reviewed code can log a password-bearing connection string.
Gateway storage traceWith APPX_ODBC_LOG absent, the gateway attempts C:\tmp\appx-odbc.log. Opening a new gateway task can overwrite that file.Set a path in the gateway dictionary's appx.env; open a fresh connection. APPX_ODBC_CODE defaults to all bits, hexadecimal FFFFFFFF; use -1 to request that complete mask or 0 to suppress trace messages.
APPX/Net file-manager traceAPPX_NETIO_LOG and APPX_NETIO_SERVER have no default file. Their configured files are opened for overwrite.Put the client path/mask on the gateway and the server path in the APPX login manager's engine environment. APPX_NETIO_CODE defaults to all bits; use -1 for the complete mask. The client transmits its categories to the file-manager server.
APPX network traceNo file unless APPX_NET_LOG is set. The logger appends a PID/role suffix and opens the resulting file for append.APPX_NET_LOG_MASK defaults to all categories except timer and extra process-ID output. Set -1 for all bits or 0 to suppress categories. Use a fresh process/connection.
APPX native file-I/O traceNo log unless APPX_IO_LOG is set. This logger expands variables in its path, including the $(pid) example in the environment recipe.APPX_IO_BITS defaults to all bits and uses unsigned mask parsing; 0xFFFFFFFF requests all categories. Set it in the engine environment and start a new engine.
Pipe communication helperNo log unless APPX_COMM_LOG is set. The helper first opens the configured file for overwrite, then appends subsequent messages.This setting belongs to the Pipe helper selected by AppxPipeExe. Set it in the login manager's engine Environment subkey so the spawned helper inherits it. Its dedicated logger has no category-mask parameter.
Login managerCreateLogFile=false and LogAllEvents=false in the source defaults. If enabled without a custom log name, the source uses the APPX login-manager Windows service name plus .log under LogDirectory, whose default is C:\.These are named values under the APPX login-manager Windows service's Config subkey. LoadSystemEnvironment defaults to true, allowing machine environment definitions to override duplicate engine-environment names. Restart the affected login manager to apply changes.

This edition tests a Socket backend. The Pipe helper log applies only when a separately configured instance actually uses Pipe; it does not diagnose this selected Socket path.

Use the complete Windows trace mask

The gateway, APPX/Net client and APPX network source parse their category masks with signed strtol. A Windows C-runtime check returned 7FFFFFFF for the input 0xFFFFFFFF, but FFFFFFFF for -1. Use these assignments for a focused all-category capture, in the process scopes described above:

APPX_ODBC_CODE=-1
APPX_NETIO_CODE=-1
APPX_NET_LOG_MASK=-1

APPX_IO_BITS uses unsigned parsing and can retain 0xFFFFFFFF. A mask selects categories; the corresponding log-path setting and a writable directory still matter. Use one diagnostic connection when a logger has a fixed filename that can be overwritten by another connection.

Capture one failure and restore the settings

  1. Save the original dictionary appx.env and the relevant APPX login-manager Windows service Environment and Config subkeys. Record the client/driver versions, failing action, SQLSTATE and native error. Keep that connection's timestamp so the client, gateway and engine records can be matched.
  2. Choose the layer implicated by the error. Configure its local log directory and only the settings needed for one reproduction. Give the gateway and engine accounts write access to their respective directories. An unwritable configured APPX network log can terminate the affected process in the reviewed source.
  3. Close ASQL before changing its command-window settings. Open a fresh ODBC connection after a gateway-environment change. For engine/helper or login-manager changes, restart only the corresponding login manager at an agreed interval, then make a new connection; an existing engine keeps its inherited environment.
  4. Reproduce once. Preserve the original logs privately, then redact passwords, connection strings and private field values from a separate copy before sharing it. Windows ODBC Administrator tracing is a separate desktop diagnostic; stop it in its Tracing tab after the same reproduction.
  5. Close the diagnostic client. Restore the saved values and remove only the overrides added for this capture. For ASQL, close the program and run set "ASQL_LOG=" and set "ASQL_EXPERT_MODE=" in its command window. In a registry Environment subkey, remove an added variable rather than leaving an empty value that can still be present to the process.
  6. Apply the restoration using the same fresh-connection/restart rule, and verify the small COUNTRY query. Check that temporary desktop tracing has stopped and that only the intended restored logging remains.

Removing APPX_ODBC_LOG restores the fallback path; it does not turn gateway tracing off. To suppress its messages deliberately, use APPX_ODBC_CODE=0 and a fresh connection. The file can still be opened or truncated. Restore the previous setting when the diagnostic interval is complete; deleting the mask restores the source's all-category default.