Troubleshooting Git in Snowflake

Use the tips described in this topic to resolve issues when using a Git repository in Snowflake.

Error message: “Failed to access the Git repository. Operation ‘clone’ is not authorized”

You might see this message for one of multiple reasons, but it’s typically due to a misconfiguration in Snowflake integration with the remote Git repository. To eliminate common misconfiguration issues, confirm the following:

  • You’re using correct credentials for authenticating with the remote Git repository, such as a correct username-and-password combination or correct personal access token.

    For more on authenticating from Snowflake, see Create a secret with credentials for authenticating.

  • You’ve correctly configured the Git repository URL, including the allowed prefixes in the API configuration.

    Read more about specifying an allowed prefix and origin URL.

  • You aren’t experiencing a connectivity issue, such as when the repository is in a private network.

    Access to a remote Git repository from Snowflake is allowed only over a public network. See Git in Snowflake limitations for more.

If you continue to have this issue after verifying that your configuration is correct, try the following:

  • If you’re using a fine-grained token for authorization (not the Classic token), confirm that you’ve set the proper permissions on the token. For read-only access, setting the “Content” to “read-only” should be enough.

    For information about managing a personal access token in GitHub, see Managing your personal access tokens in the GitHub documentation.

  • Outside of Snowflake, clone the repository with the command-line Git client using the same URL and TOKEN values that are resulting in the error in Snowflake.

    This should generate more verbose output, including messages indicating what the issue might be. For example, cloning might fail from the command line because SSO authorization is required for the operation, and this authorization was not available for the fine-grained token. Switching to a Classic token might resolve this issue.

Error message: “Processing aborted due to error” when using the SHOW GIT BRANCHES or SHOW GIT TAGS commands

You might see this message if you used Git from Snowflake during an early preview of the feature. An optimization in reading from a remote Git repository, added in a later release, might be complicating access to remote repositories for which you configured access in that early preview.

To ensure that you’re benefitting from the optimization — and to stop receiving this error — re-create your Git repository stages using REPLACE GIT REPOSITORY.