[Transaction] Several 500 Internal Server Errors

Maniaplanet public API, ManiaConnect system and the open source PHP SDK.

Moderator: NADEO

User avatar
m4rcel
Posts: 653
Joined: 15 Jun 2010, 11:12
Contact:

[Transaction] Several 500 Internal Server Errors

Post by m4rcel » 11 May 2013, 17:55

As of an error in my scripts, I came across an 500 Internal Server Error. Whilte debugging it, I came across some more of them :D
  • create() on negative cost
    If the costs are set to a negative value, calling the create() method on the Payments class fails with a 500.
  • create() on fromLogin == toLogin
    If the fromLogin and toLogin fields are set both to the same value, you get another 500.
  • create() on wrong creatorSecurityKey or wrong creatorPassword
    If the SecurityKey or the Password is wrong, then the request is aborted with a 500.
  • pay() on missing id
    If the ID of the created Transaction is missing when calling pay(), guessing what you get? Yep, a 500 ^^
I think all of these error cases should be fixed to respond nice error messages instead of the 500 Internal Server Error :)
ImageImage
Image

User avatar
TMarc
Posts: 15261
Joined: 05 Apr 2011, 19:10
Location: Europe
Contact:

Re: [Transaction] Several 500 Internal Server Errors

Post by TMarc » 11 May 2013, 18:06

why don't you catch the errors in your script? :?

500 means your script is faulty, not the server.
The server just doesn't know what to display...

And the server does not necessarily know what you have intended there. ;)
maniaplanet forum global moderator

Link list with FAQ, Support, Wiki, Tutorials, Community activities, and much more.

System specs: Intel i7-970 12GB RAM, nVidia RTX 2060 6GB, Creative SB X-Fi, 2xSSD 1xHDD
Discord: TMarc#3002

User avatar
steeffeen
Translator
Translator
Posts: 2472
Joined: 14 Oct 2012, 16:22
Location: Germany

Re: [Transaction] Several 500 Internal Server Errors

Post by steeffeen » 11 May 2013, 18:16

TMarc wrote:why don't you catch the errors in your script? :?

500 means your script is faulty, not the server.
The server just doesn't know what to display...

And the server does not necessarily know what you have intended there. ;)
"internal server error"!

INTERNAL
not EXTERNAL

when it's about the script or the requests there should be "bad request" errors if you ask me

and how do you come to "what to display"? since when do web services display something?
    Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

    ManiaControl, FancyManiaLinks

    User avatar
    TMarc
    Posts: 15261
    Joined: 05 Apr 2011, 19:10
    Location: Europe
    Contact:

    Re: [Transaction] Several 500 Internal Server Errors

    Post by TMarc » 11 May 2013, 18:23

    :roll: it doesn't matter if it is internal or external. an error is an error ;)
    web services always display something.
    In ideal case the success, in bad case a fail indication, and in worst case a useless message like this 500.

    m4rcel, did you check the server logs if there are some details?
    maniaplanet forum global moderator

    Link list with FAQ, Support, Wiki, Tutorials, Community activities, and much more.

    System specs: Intel i7-970 12GB RAM, nVidia RTX 2060 6GB, Creative SB X-Fi, 2xSSD 1xHDD
    Discord: TMarc#3002

    User avatar
    TGYoshi
    Posts: 811
    Joined: 15 Mar 2011, 16:59

    Re: [Transaction] Several 500 Internal Server Errors

    Post by TGYoshi » 11 May 2013, 18:27

    So he asks for a normal error instead of 500 which is a faulty coded thing server-sided.
    500 errors are caused by Nando's programming server-sided, not by the user.

    It's the difference between a crash to desktop (a faulty coded thing) and a popup showing "Negative transactions aren't possible".
    =3

    The_Big_Boo
    Posts: 1041
    Joined: 15 Jun 2010, 15:46

    Re: [Transaction] Several 500 Internal Server Errors

    Post by The_Big_Boo » 11 May 2013, 18:32

    TMarc, whatever you say, 5xx errors are server issues. Here it should send a 4xx response (a 400 actually).

    Transactions are actually handled by the master server itself and the NadeoLive WS is using an internal API. From what I remember, an exception is created when the internal API sends an error but this kind of exception is supposed to be nicely sent back to the WS user. So something is indeed going wrong in the WS.

    Edit:
    TMarc wrote:m4rcel, did you check the server logs if there are some details?
    He won't find anything. Details are on the WS server logs.
    OS: Win 7 Pro x64
    RAM: 2x4GB Corsair @ 1600MHz
    CPU: Intel i5 760 @ 3.6GHz
    Mobo: Asus P7P55D-E
    GPU: NVidia GTX 760 2GB
    HDD: WD Black 1TB
    Sound: VIA VT1828S (onboard)
    Peripherals: Razer DeathAdder - Razer DeathStalker - Logitech F310

    User avatar
    TMarc
    Posts: 15261
    Joined: 05 Apr 2011, 19:10
    Location: Europe
    Contact:

    Re: [Transaction] Several 500 Internal Server Errors

    Post by TMarc » 11 May 2013, 19:00

    ok, thanks for the clarifications about this mysteries, something new learned today :thumbsup:
    maniaplanet forum global moderator

    Link list with FAQ, Support, Wiki, Tutorials, Community activities, and much more.

    System specs: Intel i7-970 12GB RAM, nVidia RTX 2060 6GB, Creative SB X-Fi, 2xSSD 1xHDD
    Discord: TMarc#3002

    User avatar
    m4rcel
    Posts: 653
    Joined: 15 Jun 2010, 11:12
    Contact:

    Re: [Transaction] Several 500 Internal Server Errors

    Post by m4rcel » 11 May 2013, 19:25

    Yes, all I want is a nice 4xx error instead of the 500, as 5xx is always the server's fault. For example, if not setting the creatorLogin, you already get "Missing login" (or so) as an 4xx error, so you directly know where the error is. With the 500, you only know that there IS an error, but not WHAT the error is... bad if you have a script dynamically creating transactions ;)
    ImageImage
    Image

    User avatar
    steeffeen
    Translator
    Translator
    Posts: 2472
    Joined: 14 Oct 2012, 16:22
    Location: Germany

    Re: [Transaction] Several 500 Internal Server Errors

    Post by steeffeen » 05 Jun 2013, 14:24

    the Payments web service seems to have a similar issue
    i get an internal server error (500) when checking the payment with the following id

    Code: Select all

    $service->isPaid(1141226);
    other ids work fine so i'm not sure what's exactly causing this

    //Edit: the same applies for id "1143838", "1150997", "1150998", "1155389", "1155385", "1178036", "1179527", "1199256"
    :D
    i couldn't recognize a pattern yet, most of the failing transactions are paid ones, but there are also unpaid ids
    i will add other ids as soon as i encounter error with them
    Last edited by steeffeen on 27 Jun 2013, 11:06, edited 5 times in total.
      Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

      ManiaControl, FancyManiaLinks

      User avatar
      steeffeen
      Translator
      Translator
      Posts: 2472
      Joined: 14 Oct 2012, 16:22
      Location: Germany

      Re: [Transaction] Several 500 Internal Server Errors

      Post by steeffeen » 06 Jun 2013, 22:21

      there is another internal server error thrown when you try to ->pay() a transaction with a cost which can't be payed because the account doesn't have enough planets :D
        Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

        ManiaControl, FancyManiaLinks

        Post Reply

        Return to “Maniaplanet Web Services”

        Who is online

        Users browsing this forum: No registered users and 0 guests