-
-
Notifications
You must be signed in to change notification settings - Fork 558
Closed
Labels
Description
Description
When creating a new event, the backend throws a 500 Internal Server Error. The issue is caused because the HTMLPurifier library cannot write to its cache directory (DefinitionCache/Serializer).
Error Logs
[2024-12-17 12:36:51] local.DEBUG: Stripe secret key is not set in the configuration file. Payment processing will not work.
[2024-12-17 12:36:51] local.ERROR: Directory /app/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer not writable.
{"userId":1,"exception":"[object] (ErrorException(code: 0): Directory /app/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer not writable.
at /app/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer.php:295)
Stack Trace:
#0 /app/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(256): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(512, 'Directory /app/...', '/app/vendor/ezy...', 295)
#1 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->{closure}(512, 'Directory /app/...', '/app/vendor/ezy...', 295)
#2 /app/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer.php(295): trigger_error('Directory /app/...', 512)
...
#11 /app/app/Services/Domain/Event/CreateEventService.php(91): HTMLPurifier->purify('<p>asdf</p>')
#14 /app/app/Http/Actions/Events/CreateEventAction.php(39): HiEvents\Services\Handlers\Event\CreateEventHandler->handle(Object(HiEvents\Services\Handlers\Event\DTO\CreateEventDTO))
...
#59 /app/public/index.php(51): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#60 {main}
Steps to Reproduce
- Go to the
/eventsendpoint and attempt to create a new event. - The server returns a 500 Internal Server Error.
- Logs indicate the
DefinitionCache/Serializerdirectory is not writable.
Expected Behavior
The event should be created successfully without errors.
Actual Behavior
The server throws a 500 error due to a write permission issue.
Root Cause
-
HTMLPurifier Cache Directory Issue:
TheDefinitionCache/Serializerdirectory does not have the correct write permissions, causing HTMLPurifier to fail when attempting to write cache data. -
Stripe Configuration:
The Stripe secret key is missing in the.envfile.
Environment
- running in docker the Local development version without stripe or keys