diff --git a/airbyte-server/src/main/java/io/airbyte/server/ConnectorDefinitionSpecBackfiller.java b/airbyte-server/src/main/java/io/airbyte/server/ConnectorDefinitionSpecBackfiller.java index 6ca6be7c9fe1..6877b79bb072 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/ConnectorDefinitionSpecBackfiller.java +++ b/airbyte-server/src/main/java/io/airbyte/server/ConnectorDefinitionSpecBackfiller.java @@ -10,6 +10,7 @@ import io.airbyte.analytics.TrackingClient; import io.airbyte.api.model.LogRead; import io.airbyte.commons.json.Jsons; +import io.airbyte.commons.resources.MoreResources; import io.airbyte.commons.version.AirbyteVersion; import io.airbyte.config.ConfigSchema; import io.airbyte.config.Configs; @@ -188,13 +189,17 @@ static void migrateAllDefinitionsToContainSpec(final ConfigRepository configRepo } if (failedBackfillImages.size() > 0 && !configs.getVersion31ForceUpgrade()) { - throw new RuntimeException(String.format( - "migrateAllDefinitionsToContainSpec - Specs could not be retrieved for the following connector images: %s. Upgrading to version %s " + final String attentionBanner = MoreResources.readResource("banner/attention-banner.txt"); + LOGGER.error(attentionBanner); + final String errorMessage = String.format( + "Specs could not be retrieved for the following connector images: %s. Upgrading to version %s " + "requires specs to be retrieved for all connector definitions, so you must either fix the images or restart the deployment with " + "the VERSION_0_31_0_FORCE_UPGRADE environment variable set to true, which will cause any connector definitions for which specs " + "cannot be retrieved to be deleted, as well as their associated connections/syncs.", failedBackfillImages.toString(), - VERSION_BREAK)); + VERSION_BREAK); + LOGGER.error(errorMessage); + throw new RuntimeException(errorMessage); } } diff --git a/airbyte-server/src/main/java/io/airbyte/server/ServerApp.java b/airbyte-server/src/main/java/io/airbyte/server/ServerApp.java index c11616e53847..3b148b048a1a 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/ServerApp.java +++ b/airbyte-server/src/main/java/io/airbyte/server/ServerApp.java @@ -74,8 +74,9 @@ public class ServerApp implements ServerRunnable { private static final AirbyteVersion VERSION_BREAK = new AirbyteVersion("0.31.0-alpha"); /** - * We can't support automatic migration for kube before this version because we had a bug in kube which would cause airbyte db to erase state upon - * termination, as a result the automatic migration wouldn't run + * We can't support automatic migration for kube before this version because we had a bug in kube + * which would cause airbyte db to erase state upon termination, as a result the automatic migration + * wouldn't run */ private static final AirbyteVersion KUBE_SUPPORT_FOR_AUTOMATIC_MIGRATION = new AirbyteVersion("0.26.5-alpha"); private final AirbyteVersion airbyteVersion; @@ -171,7 +172,7 @@ public static ServerRunnable getServer(final ServerFactory apiFactory, final Con configs.getConfigDatabaseUser(), configs.getConfigDatabasePassword(), configs.getConfigDatabaseUrl()) - .getAndInitialize(); + .getAndInitialize(); final DatabaseConfigPersistence configPersistence = new DatabaseConfigPersistence(configDatabase).migrateFileConfigs(configs); final SecretsHydrator secretsHydrator = SecretPersistence.getSecretsHydrator(configs); @@ -186,7 +187,7 @@ public static ServerRunnable getServer(final ServerFactory apiFactory, final Con configs.getDatabaseUser(), configs.getDatabasePassword(), configs.getDatabaseUrl()) - .getAndInitialize(); + .getAndInitialize(); final JobPersistence jobPersistence = new DefaultJobPersistence(jobDatabase); createDeploymentIfNoneExists(jobPersistence); @@ -235,6 +236,8 @@ public static ServerRunnable getServer(final ServerFactory apiFactory, final Con final HttpClient httpClient = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build(); if (!isLegalUpgrade(airbyteDatabaseVersion.orElse(null), airbyteVersion)) { + final String attentionBanner = MoreResources.readResource("banner/attention-banner.txt"); + LOGGER.error(attentionBanner); final String message = String.format( "Cannot upgrade from version %s to version %s directly. First you must upgrade to version %s. After that upgrade is complete, you may upgrade to version %s", airbyteDatabaseVersion.get(), @@ -299,11 +302,11 @@ static boolean isLegalUpgrade(final AirbyteVersion airbyteDatabaseVersion, final } /** - * Check to see if given the current version of the app and the version we are trying to upgrade if it passes through a version break (i.e. a major - * version bump). + * Check to see if given the current version of the app and the version we are trying to upgrade if + * it passes through a version break (i.e. a major version bump). * * @param airbyteDatabaseVersion - current version of the app - * @param airbyteVersion - version we are trying to upgrade to + * @param airbyteVersion - version we are trying to upgrade to * @return true if upgrading through a major version, otherwise false. */ private static boolean isUpgradingThroughVersionBreak(final AirbyteVersion airbyteDatabaseVersion, final AirbyteVersion airbyteVersion) { @@ -344,7 +347,8 @@ public static void main(final String[] args) throws Exception { } /** - * Ideally when automatic migration runs, we should make sure that we acquire a lock on database and no other operation is allowed + * Ideally when automatic migration runs, we should make sure that we acquire a lock on database and + * no other operation is allowed */ private static void runAutomaticMigration(final ConfigRepository configRepository, final JobPersistence jobPersistence, diff --git a/airbyte-server/src/main/resources/banner/attention-banner.txt b/airbyte-server/src/main/resources/banner/attention-banner.txt new file mode 100644 index 000000000000..e35652b219ef --- /dev/null +++ b/airbyte-server/src/main/resources/banner/attention-banner.txt @@ -0,0 +1,13 @@ + ___ ___________________ ________________ _ __ + / |/_ __/_ __/ ____/ | / /_ __/ _/ __ \/ | / / + ________________________ / /| | / / / / / __/ / |/ / / / / // / / / |/ / ________________________ +/_____/_____/_____/_____/ / ___ |/ / / / / /___/ /| / / / _/ // /_/ / /| / /_____/_____/_____/_____/ + __ _______ __________ /_/ _|_/_/ _/_/_/_____/_/_|_/_/_/ /___/\____/_/_|_/ __ __________ __________ + / / / / ___// ____/ __ \ / _/ | / / __ \/ / / /_ __/ / __ \/ ____/ __ \/ / / / _/ __ \/ ____/ __ \ + / / / /\__ \/ __/ / /_/ / / // |/ / /_/ / / / / / / / /_/ / __/ / / / / / / // // /_/ / __/ / / / / +/ /_/ /___/ / /___/ _, _/ _/ // /| / ____/ /_/ / / / / _, _/ /___/ /_/ / /_/ // // _, _/ /___/ /_/ / +\____//____/_____/_/ |_| /___/_/ |_/_/ \____/ /_/ /_/ |_/_____/\___\_\____/___/_/ |_/_____/_____/ + + ------------------- + See details below + -------------------