-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Current Behavior
If the APP_SERVICE_AUTHOR .env variable is not defined (which it is not in .env.example), attempting to create a new nest or import an egg results in a Laravel 500 error:
The error is as follows, and implies the existance of an author field during creation of the nest, or egg:
[2026-02-19 15:01:12] production.ERROR: Could not save Pterodactyl\Models\Nest[]: failed to validate data: {"author":["The author must be a valid email address."]} {"userId":1,"exception":"[object] (Pterodactyl\\Exceptions\\Model\\DataValidationException(code: 0): Could not save Pterodactyl\\Models\\Nest[]: failed to validate data: {\"author\":[\"The author must be a valid email address.\"]} at /var/www/pterodactyl/app/Models/Model.php:50)
The form does not contain such field (for the account). I have narrowed down the error ro the NestCreationService:
// cat /var/www/pterodactyl/app/Services/Nests/NestCreationService.php
<?php
namespace Pterodactyl\Services\Nests;
use Ramsey\Uuid\Uuid;
use Pterodactyl\Models\Nest;
use Pterodactyl\Contracts\Repository\NestRepositoryInterface;
use Illuminate\Contracts\Config\Repository as ConfigRepository;
class NestCreationService
{
/**
* NestCreationService constructor.
*/
public function __construct(private ConfigRepository $config, private NestRepositoryInterface $repository)
{
}
/**
* Create a new nest on the system.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
public function handle(array $data, ?string $author = null): Nest
{
return $this->repository->create([
'uuid' => Uuid::uuid4()->toString(),
'author' => $author ?? $this->config->get('pterodactyl.service.author'), // <-- $author is null here, and APP_SERVICE_AUTHOR is not defined in .env as fallback.
'name' => array_get($data, 'name'),
'description' => array_get($data, 'description'),
'splitter_keep_nest' => array_get($data, 'splitter_keep_nest', false),
], true, true);
}
}Defining APP_SERVICE_AUTHOR remedies this error and makes the panel work as intended, albeit using the email from the .env and not $author (whereever that variable might be from, I'm not sure).
Tip: I do have my email defined in both the admin pane and the user (front-facing) pane.
Expected Behavior
The author is assigned from a form field or the user's email.
Steps to Reproduce
- Attempt to create new nest using the "New Nest" button and form without
APP_SERVICE_AUTHORdefined in the environment variables.
It should crash.
Panel Version
1.12.1
Wings Version
N/A
Games and/or Eggs Affected
N/A
Docker Image
N/A
Error Logs
N/A (inserted in main body)Is there an existing issue for this?
- I have searched the existing issues before opening this issue. I understand that maintainers may close this issue without communication if I have not provided sufficient information.