Why am I seeing "An error was detected with your environment's locale configuration"?

This error can occur on POSIX (Mac or Linux) systems when the configured locale is not actually available. This is known to happen by default on certain AWS Lambda runtimes.

How can I fix this quickly?

Just set the LC_ALL environment variable to "C". You can do this at the command line before running your program, from within your program, or if running on AWS Lambda, from the configuration panel.

Set the LC_ALL environment variable

1export LC_ALL=C

If you are setting this from within your program, make sure you do so before you make any calls to the Apryse SDK.

Why does this happen?

This error occurs when one of the environment variables used to request a locale is set to a locale that is not present on the system. These variables are as follows:

  • LC_ALL
  • LC_COLLATE
  • LC_CTYPE
  • LC_MESSAGES
  • LC_MONETARY
  • LC_NUMERIC
  • LC_TIME
  • LANG

LC_ALL has the highest priority, so if it is set, it is used. LANG is used as a fallback, only if the other values are not set. You can search for the values of these, if set, using the following command:

Identify locale settings

1env | grep -E 'LC_.*=|LANG.*='

You can compare the values specified for each variable to the list of available locales:

List available locales

1locale -a

If one of the required locales is not available, you should either set the environment variable to an available locale (as shown above), or if required, generate the locale (out of scope for this FAQ).

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales