IBM / FoodTrackerBackend

This tutorial teaches how to create a Kitura Swift backend for the FoodTracker iOS app tutorial from Apple. This project contains a version of the tutorial code that has been updated to use Codable rather than NSCoder.
109 stars 38 forks source link

Error saving meal to Kitura: 500 : Internal Server Error #38

Open redwards72git opened 5 years ago

redwards72git commented 5 years ago

receiving the below error after any attempt to add records after the initially successful record Error saving meal to Kitura: 500 : Internal Server Error built on Xcode 10.1 Mojave

Also getting the same error when using the forked build.

ianpartridge commented 5 years ago

Hi, can you provide a bit more information please. Which stage of the tutorial are you doing? Can you share the code you're having problems with?

redwards72git commented 5 years ago

Hi thanks for looking. I am receiving the error as soon as I implement the database. So completing the tutorial but not completing any further stages.

Due to the generic error I’m finding it hard to confirm what part of the system is generating the issue.

I’m away from the desk will see if I can provide further debug info.

Thanks Ryan Edwards

Sent from my iPhone

On 13 Feb 2019, at 17:32, Ian Partridge notifications@github.com<mailto:notifications@github.com> wrote:

Hi, can you provide a bit more information please. Which stage of the tutorial are you doing? Can you share the code you're having problems with?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/IBM/FoodTrackerBackend/issues/38#issuecomment-463291587, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AHw5WAGEBX-DHFiC-Al7MzudnCkiMK6lks5vNEwYgaJpZM4a5z4r.

ianpartridge commented 5 years ago

Ok let me know when you have something I could look at.

redwards72git commented 5 years ago

Hi Ian. I have investigated further. Generally the data is being stored in the DB however the error is being thrown from the line:

client.post("/meals", data: meal) { (meal: Meal?, error: Error?) in

in the MealTableViewController Would you know what part of Kitura would throw the error so i can investigate further, not sure if error is coming from the server or the KituraKit.

ianpartridge commented 5 years ago

I suggest you find your POST handler in the Kitura app: router.post("/meals", postHandler) or something, then instrument in postHandler(). Does it succeed?