Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix: Haproxy check should not throw error

Andras Bacsai5c646c18984a
diff --git a/src/lib/haproxy/index.ts b/src/lib/haproxy/index.ts
index 2b811967ae..853bc38b64 100644
--- a/src/lib/haproxy/index.ts
+++ b/src/lib/haproxy/index.ts
@@ -106,7 +106,11 @@ export async function forceSSLOffApplication({ domain }) {
export async function forceSSLOnApplication({ domain }) {
if (!dev) {
const haproxy = await haproxyInstance();
- await checkHAProxy(haproxy);
+ try {
+ await checkHAProxy(haproxy);
+ } catch (error) {
+ return;
+ }
const transactionId = await getNextTransactionId();
try {
@@ -278,7 +282,11 @@ export async function reloadHaproxy(engine) {
}
export async function configureProxyForApplication({ domain, imageId, applicationId, port }) {
const haproxy = await haproxyInstance();
- await checkHAProxy(haproxy);
+ try {
+ await checkHAProxy(haproxy);
+ } catch (error) {
+ return;
+ }
let serverConfigured = false;
let backendAvailable: any = null;
@@ -358,7 +366,11 @@ export async function configureProxyForApplication({ domain, imageId, applicatio
export async function configureCoolifyProxyOff({ domain }) {
const haproxy = await haproxyInstance();
- await checkHAProxy(haproxy);
+ try {
+ await checkHAProxy(haproxy);
+ } catch (error) {
+ return;
+ }
try {
const transactionId = await getNextTransactionId();
@@ -388,7 +400,11 @@ export async function checkHAProxy(haproxy) {
}
export async function configureCoolifyProxyOn({ domain }) {
const haproxy = await haproxyInstance();
- await checkHAProxy(haproxy);
+ try {
+ await checkHAProxy(haproxy);
+ } catch (error) {
+ return;
+ }
let serverConfigured = false;
let backendAvailable: any = null;
try {
@@ -627,12 +643,15 @@ export async function configureSimpleServiceProxyOn({ id, domain, port }) {
export async function configureSimpleServiceProxyOff({ domain }) {
const haproxy = await haproxyInstance();
- await checkHAProxy(haproxy);
+ try {
+ await checkHAProxy(haproxy);
+ } catch (error) {
+ return;
+ }
try {
await haproxy.get(`v2/services/haproxy/configuration/backends/${domain}`).json();
const transactionId = await getNextTransactionId();
-
await haproxy
.delete(`v2/services/haproxy/configuration/backends/${domain}`, {
searchParams: {