If you're using CircleCI CLI to build locally and want to troubleshoot, then the
circleci config validate and
circleci diagnostic commands in combination with the
--debug flag will provide great help when debugging.
circleci config validate <path to config> [flags]
circleci diagnostic [flags]
For more help and a list of flags for each command, see the documentation here.