fix: Gitea Traefik routing and connection pool optimization
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Failing after 10m14s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Has been skipped
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
Security Vulnerability Scan / Check for Dependency Changes (push) Failing after 11m25s
Security Vulnerability Scan / Composer Security Audit (push) Has been cancelled

- Remove middleware reference from Gitea Traefik labels (caused routing issues)
- Optimize Gitea connection pool settings (MAX_IDLE_CONNS=30, authentication_timeout=180s)
- Add explicit service reference in Traefik labels
- Fix intermittent 504 timeouts by improving PostgreSQL connection handling

Fixes Gitea unreachability via git.michaelschiemer.de
This commit is contained in:
2025-11-09 14:46:15 +01:00
parent 85c369e846
commit 36ef2a1e2c
1366 changed files with 104925 additions and 28719 deletions

View File

@@ -5,7 +5,6 @@ declare(strict_types=1);
namespace App\Framework\Queue\Exceptions;
use App\Framework\Exception\Core\QueueErrorCode;
use App\Framework\Exception\ExceptionContext;
/**
* Exception thrown when attempting to complete or update steps after all steps are completed
@@ -14,17 +13,9 @@ final class AllStepsCompletedException extends QueueException
{
public static function forJob(string $jobId, int $totalSteps): self
{
$context = ExceptionContext::forOperation('step.complete', 'StepProgressTracker')
->withData([
'job_id' => $jobId,
'total_steps' => $totalSteps,
'current_step_index' => $totalSteps,
]);
return self::create(
QueueErrorCode::INVALID_STATE,
return new self(
"All {$totalSteps} steps have already been completed for job '{$jobId}'",
$context
(int) QueueErrorCode::INVALID_STATE->value
);
}
}

View File

@@ -5,7 +5,6 @@ declare(strict_types=1);
namespace App\Framework\Queue\Exceptions;
use App\Framework\Exception\Core\QueueErrorCode;
use App\Framework\Exception\ExceptionContext;
/**
* Exception thrown when a job chain cannot be found
@@ -14,31 +13,17 @@ final class ChainNotFoundException extends QueueException
{
public static function byId(string $chainId): self
{
$context = ExceptionContext::forOperation('chain.lookup', 'JobChainManager')
->withData([
'chain_id' => $chainId,
'search_type' => 'by_id',
]);
return self::create(
QueueErrorCode::CHAIN_NOT_FOUND,
return new self(
"Chain with ID '{$chainId}' not found",
$context
(int) QueueErrorCode::CHAIN_NOT_FOUND->value
);
}
public static function byName(string $name): self
{
$context = ExceptionContext::forOperation('chain.lookup', 'JobChainManager')
->withData([
'chain_name' => $name,
'search_type' => 'by_name',
]);
return self::create(
QueueErrorCode::CHAIN_NOT_FOUND,
return new self(
"Chain with name '{$name}' not found",
$context
(int) QueueErrorCode::CHAIN_NOT_FOUND->value
);
}
}

View File

@@ -5,7 +5,6 @@ declare(strict_types=1);
namespace App\Framework\Queue\Exceptions;
use App\Framework\Exception\Core\QueueErrorCode;
use App\Framework\Exception\ExceptionContext;
/**
* Exception thrown when circular dependencies are detected in job chains
@@ -14,16 +13,9 @@ final class CircularDependencyException extends QueueException
{
public static function inChain(string $chainId, array $circularDependencies = []): self
{
$context = ExceptionContext::forOperation('chain.validate', 'JobChainExecutionCoordinator')
->withData([
'chain_id' => $chainId,
'circular_dependencies' => $circularDependencies,
]);
return self::create(
QueueErrorCode::CIRCULAR_DEPENDENCY,
return new self(
"Chain '{$chainId}' has circular dependencies",
$context
(int) QueueErrorCode::CIRCULAR_DEPENDENCY->value
);
}
}

View File

@@ -5,7 +5,6 @@ declare(strict_types=1);
namespace App\Framework\Queue\Exceptions;
use App\Framework\Exception\Core\QueueErrorCode;
use App\Framework\Exception\ExceptionContext;
/**
* Exception thrown when a job chain is in an invalid state for the requested operation
@@ -14,47 +13,25 @@ final class InvalidChainStateException extends QueueException
{
public static function notPending(string $chainId, string $currentStatus): self
{
$context = ExceptionContext::forOperation('chain.start', 'JobChainManager')
->withData([
'chain_id' => $chainId,
'current_status' => $currentStatus,
'required_status' => 'pending',
]);
return self::create(
QueueErrorCode::INVALID_STATE,
return new self(
"Chain '{$chainId}' is not in pending status (current: {$currentStatus})",
$context
(int) QueueErrorCode::INVALID_STATE->value
);
}
public static function alreadyCompleted(string $chainId): self
{
$context = ExceptionContext::forOperation('chain.modify', 'JobChainManager')
->withData([
'chain_id' => $chainId,
'current_status' => 'completed',
]);
return self::create(
QueueErrorCode::INVALID_STATE,
return new self(
"Chain '{$chainId}' is already completed and cannot be modified",
$context
(int) QueueErrorCode::INVALID_STATE->value
);
}
public static function alreadyFailed(string $chainId): self
{
$context = ExceptionContext::forOperation('chain.modify', 'JobChainManager')
->withData([
'chain_id' => $chainId,
'current_status' => 'failed',
]);
return self::create(
QueueErrorCode::INVALID_STATE,
return new self(
"Chain '{$chainId}' has failed and cannot be modified",
$context
(int) QueueErrorCode::INVALID_STATE->value
);
}
}

View File

@@ -11,36 +11,25 @@ final class InvalidDeadLetterQueueNameException extends FrameworkException
{
public static function tooShort(string $name, int $minLength): self
{
return self::create(
ValidationErrorCode::BUSINESS_RULE_VIOLATION,
"Dead letter queue name '{$name}' is too short. Minimum length is {$minLength} characters."
)->withData([
'name' => $name,
'actual_length' => strlen($name),
'min_length' => $minLength,
]);
return new self(
"Dead letter queue name '{$name}' is too short. Minimum length is {$minLength} characters.",
(int) ValidationErrorCode::BUSINESS_RULE_VIOLATION->value
);
}
public static function tooLong(string $name, int $maxLength): self
{
return self::create(
ValidationErrorCode::BUSINESS_RULE_VIOLATION,
"Dead letter queue name '{$name}' is too long. Maximum length is {$maxLength} characters."
)->withData([
'name' => $name,
'actual_length' => strlen($name),
'max_length' => $maxLength,
]);
return new self(
"Dead letter queue name '{$name}' is too long. Maximum length is {$maxLength} characters.",
(int) ValidationErrorCode::BUSINESS_RULE_VIOLATION->value
);
}
public static function invalidFormat(string $name, string $pattern): self
{
return self::create(
ValidationErrorCode::BUSINESS_RULE_VIOLATION,
"Dead letter queue name '{$name}' contains invalid characters. Only alphanumeric characters, underscores, hyphens, and dots are allowed."
)->withData([
'name' => $name,
'valid_pattern' => $pattern,
]);
return new self(
"Dead letter queue name '{$name}' contains invalid characters. Only alphanumeric characters, underscores, hyphens, and dots are allowed.",
(int) ValidationErrorCode::BUSINESS_RULE_VIOLATION->value
);
}
}

View File

@@ -5,7 +5,6 @@ declare(strict_types=1);
namespace App\Framework\Queue\Exceptions;
use App\Framework\Exception\Core\QueueErrorCode;
use App\Framework\Exception\ExceptionContext;
use App\Framework\Queue\ValueObjects\JobId;
/**
@@ -15,32 +14,17 @@ final class JobNotFoundException extends QueueException
{
public static function byId(JobId $jobId): self
{
$context = ExceptionContext::forOperation('job.lookup', 'JobPersistenceLayer')
->withData([
'job_id' => $jobId->toString(),
'search_type' => 'by_id',
]);
return self::create(
QueueErrorCode::JOB_NOT_FOUND,
return new self(
"Job with ID '{$jobId->toString()}' not found",
$context
(int) QueueErrorCode::JOB_NOT_FOUND->value
);
}
public static function inQueue(JobId $jobId, string $queueName): self
{
$context = ExceptionContext::forOperation('job.lookup', 'Queue')
->withData([
'job_id' => $jobId->toString(),
'queue_name' => $queueName,
'search_type' => 'in_queue',
]);
return self::create(
QueueErrorCode::JOB_NOT_FOUND,
return new self(
"Job '{$jobId->toString()}' not found in queue '{$queueName}'",
$context
(int) QueueErrorCode::JOB_NOT_FOUND->value
);
}
}

View File

@@ -5,7 +5,6 @@ declare(strict_types=1);
namespace App\Framework\Queue\Exceptions;
use App\Framework\Exception\Core\QueueErrorCode;
use App\Framework\Exception\ExceptionContext;
/**
* Exception thrown when Redis PHP extension is not loaded
@@ -16,17 +15,9 @@ final class RedisExtensionNotLoadedException extends QueueException
{
public static function notLoaded(): self
{
$context = ExceptionContext::forOperation('queue.init', 'QueueInitializer')
->withData([
'required_extension' => 'redis',
'loaded_extensions' => get_loaded_extensions(),
'fallback_available' => 'FileQueue',
]);
return self::fromContext(
return new self(
'Redis PHP extension is not loaded',
$context,
QueueErrorCode::WORKER_UNAVAILABLE
(int) QueueErrorCode::WORKER_UNAVAILABLE->value
);
}
}