Skip to content

Commit

Permalink
Skip Sentry configuration in Lando environments
Browse files Browse the repository at this point in the history
** Why are these changes being introduced:

We integrate with Sentry provided a given ENV value is defined in
secrets.json, but this can result in local environments sending
exceptions to Sentry - which be quite noisy and undesired.

** Relevant ticket(s):

* https://mitlibraries.atlassian.net/browse/pw-106

** How does this address that need:

This adds an additional check around the Sentry configuration block,
making sure that the PANTHEON_ENVIRONMENT variable is not sent to
"lando" when integrating with Sentry.

** Document any side effects to this change:

None
  • Loading branch information
matt-bernhardt committed Sep 12, 2024
1 parent 9be1842 commit e250f4e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
29 changes: 29 additions & 0 deletions docs/howto/troubleshoot-build-failures.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# How to troubleshoot a build failure on Pantheon

This document describes some helpful steps to take when you run into a build
failure on Pantheon. These failures are seen most often when creating a brand
new instance.

## Identifying a build failure

A build failure on Pantheon might become evident when creating a multidev initially:

```bash
% terminus multidev:create mitlib-wp-network.live wp66
[error] The operation failed to complete.
```

It might also appear when trying to clone content between tiers:

```bash
% terminus remote:wp mitlib-wp-network.wp66 -- search-replace libraries.mit.edu wp66-mitlib-wp-network.pantheonsite.io --url=libraries.mit.edu
[warning] This environment is in read-only Git mode. If you want to make changes to the codebase of this site (e.g. updating modules or plugins), you will need to toggle into read/write SFTP mode first.
Warning: Permanently added 'REACTED' (RSA) to the list of known hosts.
Enter passphrase for key 'REDACTED':
Error: This does not seem to be a WordPress installation.
The used path is: /code/web/wp/
Pass --path=`path/to/wordpress` or run `wp core download`.
[notice] Command: mitlib-wp-network.wp66 -- wp search-replace libraries.mit.edu wp66-mitlib-wp-network.pantheonsite.io [Exit: 1]
[error]
```

2 changes: 1 addition & 1 deletion web/wp-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
define( 'WPMS_SMTP_PASS', $secrets['WPMS_SMTP_PASS'] );

// Sentry configuration is optional.
if ( array_key_exists( 'SENTRY_DSN', $secrets ) ) {
if ( array_key_exists( 'SENTRY_DSN', $secrets ) && $_ENV['PANTHEON_ENVIRONMENT'] != 'lando' ) {
define( 'WP_SENTRY_DSN', $secrets['SENTRY_DSN'] );
define( 'WP_SENTRY_ERROR_TYPES', E_ERROR & E_CORE_ERROR & E_COMPILE_ERROR );
define( 'WP_SENTRY_VERSION', 'v1' );
Expand Down

0 comments on commit e250f4e

Please sign in to comment.