Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client api error #1089

Closed
raoshemi opened this issue Mar 27, 2018 · 6 comments
Closed

client api error #1089

raoshemi opened this issue Mar 27, 2018 · 6 comments

Comments

@raoshemi
Copy link

raoshemi commented Mar 27, 2018

using client api:
/api/client/servers

found an error:

{
"errors" : {
"0" : {
"code" : "AccessDeniedHttpException",
"status" : "403",
"detail" : "",
"source" : {
"line" : "75",
"file" : "/app/Http/Middleware/Api/AuthenticateKey.php"
},
"meta" : {
"trace" : {
"0" : "#0 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Pterodactyl\Http\Middleware\Api\AuthenticateKey->handle(Object(Illuminate\Http\Request), Object(Closure), 1)",
"1" : "#1 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))",
"2" : "#2 /data/wwwroot/panel7.mc6m.com/app/Http/Middleware/Api/SetSessionDriver.php(50): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))",
"3" : "#3 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Pterodactyl\Http\Middleware\Api\SetSessionDriver->handle(Object(Illuminate\Http\Request), Object(Closure))",
"4" : "#4 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))",
"5" : "#5 /data/wwwroot/panel7.mc6m.com/app/Http/Middleware/Api/ApiSubstituteBindings.php(75): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))",
"6" : "#6 /data/wwwroot/panel7.mc6m.com/app/Http/Middleware/Api/Client/SubstituteClientApiBindings.php(37): Pterodactyl\Http\Middleware\Api\ApiSubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure))",
"7" : "#7 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Pterodactyl\Http\Middleware\Api\Client\SubstituteClientApiBindings->handle(Object(Illuminate\Http\Request), Object(Closure))",
"8" : "#8 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))",
"9" : "#9 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(57): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))",
"10" : "#10 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\Routing\Middleware\ThrottleRequests->handle(Object(Illuminate\Http\Request), Object(Closure), 60, '1')",
"11" : "#11 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))",
"12" : "#12 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))",
"13" : "#13 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(660): Illuminate\Pipeline\Pipeline->then(Object(Closure))",
"14" : "#14 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(635): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))",
"15" : "#15 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(601): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route))",
"16" : "#16 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(590): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))",
"17" : "#17 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(176): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))",
"18" : "#18 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http{closure}(Object(Illuminate\Http\Request))",
"19" : "#19 /data/wwwroot/panel7.mc6m.com/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(65): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))",
"20" : "#20 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Barryvdh\Debugbar\Middleware\InjectDebugbar->handle(Object(Illuminate\Http\Request), Object(Closure))",
"21" : "#21 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))",
"22" : "#22 /data/wwwroot/panel7.mc6m.com/vendor/fideloper/proxy/src/TrustProxies.php(56): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))",
"23" : "#23 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Fideloper\Proxy\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))",
"24" : "#24 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))",
"25" : "#25 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(30): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))",
"26" : "#26 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))",
"27" : "#27 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))",
"28" : "#28 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(30): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))",
"29" : "#29 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))",
"30" : "#30 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))",
"31" : "#31 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))",
"32" : "#32 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure))",
"33" : "#33 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))",
"34" : "#34 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(46): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))",
"35" : "#35 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))",
"36" : "#36 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))",
"37" : "#37 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))",
"38" : "#38 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(151): Illuminate\Pipeline\Pipeline->then(Object(Closure))",
"39" : "#39 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))",
"40" : "#40 /data/wwwroot/panel7.mc6m.com/public/index.php(53): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))",
"41" : "#41 {main}",
}
}
},
}
}<

The following error appears when I “echo $keyType;"

{
"errors" : {
"0" : {
"code" : "ErrorException",
"status" : "500",
"detail" : "Undefined variable: ketType",
"source" : {
"line" : "75",
"file" : "/app/Http/Middleware/Api/AuthenticateKey.php"
},
"meta" : {
"trace" : {
"0" : "#0 /data/wwwroot/panel7.mc6m.com/app/Http/Middleware/Api/AuthenticateKey.php(71): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'Undefined varia...', '/data/wwwroot/p...', 71, Array)",
"1" : "#1 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Pterodactyl\Http\Middleware\Api\AuthenticateKey->handle(Object(Illuminate\Http\Request), Object(Closure), 1)",
"2" : "#2 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))",
"3" : "#3 /data/wwwroot/panel7.mc6m.com/app/Http/Middleware/Api/SetSessionDriver.php(50): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))",
"4" : "#4 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Pterodactyl\Http\Middleware\Api\SetSessionDriver->handle(Object(Illuminate\Http\Request), Object(Closure))",
"5" : "#5 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))",
"6" : "#6 /data/wwwroot/panel7.mc6m.com/app/Http/Middleware/Api/ApiSubstituteBindings.php(75): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))",
"7" : "#7 /data/wwwroot/panel7.mc6m.com/app/Http/Middleware/Api/Client/SubstituteClientApiBindings.php(37): Pterodactyl\Http\Middleware\Api\ApiSubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure))",
"8" : "#8 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Pterodactyl\Http\Middleware\Api\Client\SubstituteClientApiBindings->handle(Object(Illuminate\Http\Request), Object(Closure))",
"9" : "#9 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))",
"10" : "#10 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(57): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))",
"11" : "#11 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\Routing\Middleware\ThrottleRequests->handle(Object(Illuminate\Http\Request), Object(Closure), 60, '1')",
"12" : "#12 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))",
"13" : "#13 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))",
"14" : "#14 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(660): Illuminate\Pipeline\Pipeline->then(Object(Closure))",
"15" : "#15 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(635): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))",
"16" : "#16 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(601): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route))",
"17" : "#17 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(590): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))",
"18" : "#18 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(176): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))",
"19" : "#19 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http{closure}(Object(Illuminate\Http\Request))",
"20" : "#20 /data/wwwroot/panel7.mc6m.com/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(65): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))",
"21" : "#21 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Barryvdh\Debugbar\Middleware\InjectDebugbar->handle(Object(Illuminate\Http\Request), Object(Closure))",
"22" : "#22 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))",
"23" : "#23 /data/wwwroot/panel7.mc6m.com/vendor/fideloper/proxy/src/TrustProxies.php(56): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))",
"24" : "#24 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Fideloper\Proxy\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))",
"25" : "#25 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))",
"26" : "#26 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(30): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))",
"27" : "#27 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))",
"28" : "#28 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))",
"29" : "#29 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(30): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))",
"30" : "#30 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))",
"31" : "#31 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))",
"32" : "#32 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))",
"33" : "#33 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure))",
"34" : "#34 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))",
"35" : "#35 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(46): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))",
"36" : "#36 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))",
"37" : "#37 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))",
"38" : "#38 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))",
"39" : "#39 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(151): Illuminate\Pipeline\Pipeline->then(Object(Closure))",
"40" : "#40 /data/wwwroot/panel7.mc6m.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))",
"41" : "#41 /data/wwwroot/panel7.mc6m.com/public/index.php(53): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))",
"42" : "#42 {main}",
}
}
},
}
}<

@TrixterTheTux
Copy link
Member

Are you sure you are using the correct API key? How are you sending the request and with what data/headers? Also for the 2nd error, you typo'd "ketType".

@raoshemi
Copy link
Author

I am sure that the correct API key is used because the other interfaces can be used normally.
"2nd error " is not a real error,it appears when I add “echo $keyType;" to "MiddleWare/Api/AuthenticateKey.php" in function "handle(Request $request, Closure $next, int $keyType)" , i guess the argument "keyType" is not set

sorry about my poor english

@raoshemi
Copy link
Author

The exception occurs only in "client api"

@DaneEveritt
Copy link
Member

This is not a bug. You're either authenticating incorrectly or passing the wrong key to the API.

@TheLBlack
Copy link

The problem still exists.

@DaneEveritt
Copy link
Member

This is not a bug. You're either authenticating incorrectly or passing the wrong key to the API.

@pterodactyl pterodactyl locked as resolved and limited conversation to collaborators Aug 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants