Troubleshoot the Go microagent

This is a non-exhaustive list of troubleshooting strategies. If you need help, please email us at or contact us through our web chat.

Increase log verbosity

The Sqreen microagent logs messages to a text file. These messages contain warnings about possible abnormal behavior and describe some actions the microagent is executing. Increase the verbosity of these messages to help you troubleshoot issues with the Sqreen microagent.

Use two environment variables to configure Sqreen's log verbosity:

Env variable name Role Default value Options
SQREEN_LOG_LOCATION Specifies a custom file to which the microagent writes logs. the terminal custom file path
SQREEN_LOG_LEVEL Sets the microagent logging level. WARN or CRITICAL INFO, DEBUG

Use INFO level in production environments.

Use DEBUG only for short periods of time due to the amount of data it generates.

Deprecated application tokens

Problem: There is a problem with my application token.

Solution: Sqreen microagents used to use application tokens. These tokens were unique to an application. Sqreen has deprecated application tokens.

Sqreen now uses organization tokens. These tokens are available throughout the organization to which your account belongs.

While Sqreen continues to support application tokens for backward compatibility in the short term, we encourage you to convert your applications to use organization tokens.

Expired tokens

Problem: My organization token is not working. The error message reads 401 Unauthorized.

Solution: If your Sqreen plan expires, the microagent and the organization tokens remain in your app, but the microagent cannot authenticate with the Sqreen Platform anymore.

To resolve the issue, you can uninstall the Sqreen microagent from your app, or you can contact Sqreen to renew your plan subsciption. With a renewed subscription, your microagent will be able to authenticate with the Sqreen Platform using the same organization tokens.

Relocation target not defined

Problem: Error: Relocation target _sqreen_atomic_load_pointer not defined

Solution: This a Go linker error due to the missing symbol _sqreen_atomic_load_pointer defined in the microagent package. It means that the microagent is either not imported in the compiled program, or the microagent version is v0.1.0-beta.10 or earlier. Update the microagent to the latest version.

Errors on compilation

Problem: fatal error: waf.h: No such file or directory and ld: library not found for -lwaf

Solution: The Go microagent package includes some C files and static libraries that vendor tools use. These errors occur when a vendor tool does not properly copy files and dependencies from the microagent package. Use go mod vendor to resolve the issue. Alternatively, copy the non-Go files manually from the microagent package. Access the C library from .

The following is an example of how you can workaround the issue by overwriting the vendor content.

# Update your vendor directory
my-project/ $ my-vendor-tool
# Download go-libsqreen with into your GOPATH
my-project/ $ go get -d
# Get the download directory filepath
my-project/ $ libsqreen_dir=$(go env GOPATH)/src/
# Overwrite your previously vendored one with it
my-project/ $ cp -r $(libsqreen_dir) ./vendor/

Unable to parse configuration file

Problem: Error on startup: Unable to parse configuration file.

Solution: When you edit the sqreen.yaml configuration file, be sure to indent with two spaces. If you do not indent correctly, the Sqreen microagent throws this error at startup.