pterodactyl / panel

Pterodactyl® is a free, open-source game server management panel built with PHP, React, and Go. Designed with security in mind, Pterodactyl runs all game servers in isolated Docker containers while exposing a beautiful and intuitive UI to end users.
https://pterodactyl.io
Other
6.66k stars 1.68k forks source link

Querying endpoint including eggs that use Process Management config inheritance throws exception #4964

Open MrJoshuaT opened 9 months ago

MrJoshuaT commented 9 months ago

Current Behavior

Querying an endpoint, such as api/application/servers?include=egg or /api/application/nests/1/eggs throws an internal server error via the API.

[2023-12-31 18:11:24] production.ERROR: Syntax error {"userId":1,"exception":"[object] (JsonException(code: 4): Syntax error at /var/www/pterodactyl/app/Transformers/Api/Application/EggTransformer.php:44) [stacktrace]

Expected Behavior

Endpoints including egg data should not return an error.

Steps to Reproduce

The default Minecraft nest with id 1, seems to only one causing this. Exporting and importing the eggs to a new nest will not throw this error anymore. If I can do anymore debugging steps myside I can do this.

Panel Version

1.11.5

Wings Version

1.11.8

Games and/or Eggs Affected

No response

Docker Image

No response

Error Logs

https://pteropaste.com/325f67a6sric/

Is there an existing issue for this?

MrJoshuaT commented 9 months ago

After much debugging, it seems I created an egg that was for Paper but with optimisations, with this under the Process Management section I used "Copy Settings From" and had Paper selected. When I just copied these values from the source egg to the new egg it didn't produce the error via the API

Boy132 commented 9 months ago

Can confirm this. Eggs that have set "Copy Settings From" produce an error with the api. The EggTransformer seems to ignore inherits.

DevNatan commented 8 months ago

I'm also having this issue, /nest/1 always fails with internal server error. Any other id like /nest/2 works fine

danny6167 commented 5 months ago

Quick note for anyone trying to reproduce this.

Clear the process management config from the child egg otherwise the error wont trigger.