Hi! I was working on the API (specifically /api/client/servers/x/resources) but when trying to request it, I get a 500 back. There is nothing in (install location)/storage/logs/laravel-2023-10-11.log. I'm doing the API request with a pterodactyl_session cookie but progrematically using Golang. (It's complicated but I need to do it that way)
#500 from API with nothing in logs
45 messages · Page 1 of 1 (latest)
do not use pterodactyl_session but use a bearer token
Like I said, I need to do it this way. And there is no reason it wouldn't work anyway?
I don't think pterodactyl_session is used anymore, and 500 is internal server error so you send it invalid json or did not specify json but the logs should show that
What do you mean? pterodactyl_session is used? I mean the frontend fetches and sends that cookie. Doing /api/client works just fine. And of course I have Accepts set to JSON. Also in the case of me sending it invalid JSON, shouldn't that be a 400?
it should not be used more for the api, It does still work but not recommended.
the logs should say something about that and share the request you send
If it shouldn't be used, why does the frontend use it to authenticate itself with the API? And like I said, the logs are empty.
sessions expire last time I check, api keys don't. Still then show the request you have send. as you are not able ( or there are non as you sas) logs
als this is for #api-and-modding
Um so Automod doesn't like my message with the request..
Yeah they expire, and that is behavior I want in my application. My request is as simple as this:
curl
--request GET
--url http://localhost:2001/api/client/servers/1aa80c68-84fb-403a-8421-630d35818e61/resources
--header 'Accept: application/json'
--header 'Cookie: [pterodactyl session cookie redacted]'
It did not like pterodactyl _ session
This is a general help channel.
most who give support do not even touch those post and just redirect users to the right channel
the Cookie is not realy a header it is a cookie zo in curl that is -b or --cookie not --header
Yeah but cookies are passed as headers to a server? You can send it like that but you can also just use a header.
But sure. I'll use --cookie for you.
Still 500.
if your panel is on localhost port 2001 some logs should be writen
And if that were the issue, it should've been a 400 or 401 anyway.
something is wrong on the panel side
[perny@fedora ~]$ cat /home/perny/Documents/pterodactyl/storage/logs/laravel-2023-10-11.log
[perny@fedora ~]$
I get that the log file is empty no worry
It's just pulled from release/v1.11.4
you run a lot of non default stufff,n non default ports , not default pterodactyl path.
and the panel itself functions fine?
what users owns the storage folder?
perny, but it's 777.
Panel works just fine.
And it's just my workstation Fedora so I just put in Documents.
try as the docs tels you making it owned by the webserver user. and I do not see fedora on the supported OS list
No. The docs tell you it needs to be 775.
My bet someone will know in #api-and-modding
but you run
- in a non default dir
- on a non default port
- folder is not owned by the webserver user ( bad for sequrity)
- on a not supported os
I just set it to 777 since there is nothing to execute anyway.
What do you mean by bad for security? The docs tell you to make it 775. So if you fololw the installation guide, every user has access to it anyway.
but try in #api-and-modding , as that there no logs that is just strange
I saw that no worry's I have installed the panel many times
But doesn't seem like you understand what's under the hood. I'll move to api and modding.
I get it, you make an api request to the resource endpoint and it return 500, so 40x = you made a mistake, 500 = server made a mistake
so something is wrong on the server side.
1 last thing, habe you tryed using the short uuid
so for example
"identifier": "1a7ce997",
"internal_id": "1a7ce997-259b-452e-8b4e-cecc464142ca",
have you tryed using 1a7ce997 instad of 1a7ce997-259b-452e-8b4e-cecc464142ca
so for you 1aa80c68
Frontend uses the internal ID when calling the API. But I tried with identifier and it returned the same error.
fine, just wanted to check